Skip to contentSkip to conversation

iio: adc: bcm_iproc_adc: Use %s and __func__

PATCH In review Mugilraj Dhavachelvan 4 participants 5 messages Apr 1, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iio: adc: bcm_iproc_adc: Use %s and __func__

Change function's name to %s and __func__ to fix checkpatch.pl errors.

---
 drivers/iio/adc/bcm_iproc_adc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/iio/adc/bcm_iproc_adc.c +1 -2
index 5e396104ac86..6bffda1082a2 100644
@@ -170,8 +170,7 @@ static irqreturn_t iproc_adc_interrupt_handler(int irq, void *data)
 	adc_priv = iio_priv(indio_dev);
 
 	regmap_read(adc_priv->regmap, IPROC_INTERRUPT_STATUS, &intr_status);
-	dev_dbg(&indio_dev->dev, "iproc_adc_interrupt_handler(),INTRPT_STS:%x\n",
-			intr_status);
+	dev_dbg(&indio_dev->dev, "%s,INTRPT_STS:%x\n", __func__, intr_status);
 
 	intr_channels = (intr_status & IPROC_ADC_INTR_MASK) >> IPROC_ADC_INTR;
 	if (intr_channels) {
Signature · 1 line
2.25.1
#1 lore raw
Quoted 2 lines · Mugilraj Dhavachelvan

Change function's name to %s and __func__ to fix checkpatch.pl errors.

No, just drop the __func__ completely. First of all, we have a device name, and uniqueness of the messages in the driver should guarantee easy findings. Second, specific to _dbg() variants, with enabled Dynamic Debug it can be chosen at run time!

I recommend going through all drivers and drop __func__ near to dev_dbg() and pr_debug().

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#2 lore raw
Quoted 5 lines · On Thu, 1 Apr 2021 12:24:50 +0300 Andy Shevchenko <[email protected]>…
Quoted 2 lines · Mugilraj Dhavachelvan

Change function's name to %s and __func__ to fix checkpatch.pl errors.

Quoted 8 lines

No, just drop the __func__ completely. First of all, we have a device name, and uniqueness of the messages in the driver should guarantee easy findings. Second, specific to _dbg() variants, with enabled Dynamic Debug it can be chosen at run time!

I recommend going through all drivers and drop __func__ near to dev_dbg() and pr_debug().

Agreed. Though beware that some maintainers will count this as noise and get grumpy.

I'm fine with such patches for IIO.

Jonathan

author
#3 lore raw
Quoted 13 lines · Jonathan Cameron
Quoted 10 lines · On Thu, 1 Apr 2021 12:24:50 +0300 Andy Shevchenko <[email protected]>…
Quoted 2 lines · Mugilraj Dhavachelvan

Change function's name to %s and __func__ to fix checkpatch.pl errors.

No, just drop the __func__ completely. First of all, we have a device name, and uniqueness of the messages in the driver should guarantee easy findings. Second, specific to _dbg() variants, with enabled Dynamic Debug it can be chosen at run time!

Quoted 8 lines
Quoted 3 lines

I recommend going through all drivers and drop __func__ near to dev_dbg() and pr_debug().

Agreed. Though beware that some maintainers will count this as noise and get grumpy.

I'm fine with such patches for IIO.

Sorry for the noise. I just seen the docs about dynamic debug. So, if we use dev_dbg("log_msg") it will print statement like filename:lineno [module]func flag log_msg, If I get it correctly. And no need of specifying __func__ in dev_dbg() and dp_dbg() right!!

Jonathan do you have any TODO's?

Quoted 3 lines

Jonathan

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

maintainer
#4 lore raw
Quoted 21 lines · On Thu, 1 Apr 2021 20:22:47 +0530 Mugilraj D <[email protected]> wrote:
Quoted 20 lines · Jonathan Cameron
Quoted 5 lines · On Thu, 1 Apr 2021 12:24:50 +0300 Andy Shevchenko <[email protected]>…
Quoted 2 lines · Mugilraj Dhavachelvan

Change function's name to %s and __func__ to fix checkpatch.pl errors.

Quoted 8 lines

No, just drop the __func__ completely. First of all, we have a device name, and uniqueness of the messages in the driver should guarantee easy findings. Second, specific to _dbg() variants, with enabled Dynamic Debug it can be chosen at run time!

I recommend going through all drivers and drop __func__ near to dev_dbg() and pr_debug().

Agreed. Though beware that some maintainers will count this as noise and get grumpy.

Quoted 8 lines
Quoted 1 line

I'm fine with such patches for IIO.

Sorry for the noise. I just seen the docs about dynamic debug. So, if we use dev_dbg("log_msg") it will print statement like filename:lineno [module]func flag log_msg, If I get it correctly. And no need of specifying __func__ in dev_dbg() and dp_dbg() right!!

Jonathan do you have any TODO's?

I tend not to mind cleanup patches (within reason)in IIO so I'm absolutely fine with a series removing any __func__ items like this. One patch per driver preferred because it avoids issues with this interfering with backports etc. There will end up being about 18 patches from a quick grep. Perhaps send a small number first though to avoid having to put in too much effort as any issues likely to affect the whole set.

Just be careful with other maintainers, they sometimes strike a different balance for what they consider noise vs useful.

Jonathan

Quoted 4 lines
Quoted 4 lines

Jonathan

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel