lkml.org 
[lkml]   [2021]   [Jan]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v1 1/2] Removed NIH log functions
On Fri, Jan 29, 2021 at 07:26:05PM +0100, mail@richard-neumann.de wrote:
> From: Richard Neumann <mail@richard-neumann.de>

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


\
 
 \ /
  Last update: 2021-01-29 19:54    [W:1.035 / U:0.436 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site