Re: [PATCH v1 1/2] Removed NIH log functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jan 29, 2021 at 07:26:05PM +0100, mail@xxxxxxxxxxxxxxxxxx wrote:
> From: Richard Neumann <mail@xxxxxxxxxxxxxxxxxx>

Thanks for the patch, my comments below.

> Removed unnecessary ndev_pdev, ndev_name and ndev_dev macros.
> Using pci_{info,warn,err,dbg} functions of the kernel's PCI API.

First of all Subject should be in imperative mode with corresponding prefix,
something like: "i2c: amd-mp2: Remove NIH logging functions". Same to the rest
of the series.

While at it, drop useless __func__ parameters.

...

> -	dev_dbg(ndev_dev(privdata), "%s id: %d\n", __func__,
> +	pci_dbg(privdata->pci_dev, "%s id: %d\n", __func__,
>  		i2c_common->bus_id);

E.g. this will become one line after dropping __func__.

...

Also in some cases, like here, you may consider simple trick to reduce amount
of LOCs.

	struct pci_dev *pdev = privdata->pci_dev;

>  		if (res != command_failed)
> -			dev_err(ndev_dev(privdata), "invalid response to i2c command!\n");

> +			pci_err(privdata->pci_dev,
> +				"invalid response to i2c command!\n");

			pci_err(pdev, "invalid response to i2c command!\n");

>  		return;

-- 
With Best Regards,
Andy Shevchenko





[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux