Commit cd25503f authored by Haneen Mohammed's avatar Haneen Mohammed Committed by Greg Kroah-Hartman

Staging: comedi: Clean dev_err() logging

This patch removes  __func__ from dev_err. dev_err includes information about:
 (devcice, driver, specific instance of device, etc) in the log printout, so there is no need for  __func__.
This was done using Coccinelle, with the following semantic patch:

@A@
expression E;
expression  msg;
@@

dev_err(E, msg, __func__);

@script:python b@
e << a.msg;
y;
@@

if(e.find("%s: ") == True):
	m = e.replace("%s: ", "");
	coccinelle.y = m;
elif(e.find("%s ") == True):
	m = e.replace("%s ", "");
	coccinelle.y = m;
else:
	m = e.replace("%s", "");

@c@
expression a.E, a.msg;
identifier  b.y;
@@

- dev_err(E, msg, __func__);
+ dev_err(E, y);
Signed-off-by: default avatarHaneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6d67b3a2
...@@ -1703,8 +1703,7 @@ static void i2c_write(struct comedi_device *dev, unsigned int address, ...@@ -1703,8 +1703,7 @@ static void i2c_write(struct comedi_device *dev, unsigned int address,
/* get acknowledge */ /* get acknowledge */
if (i2c_read_ack(dev) != 0) { if (i2c_read_ack(dev) != 0) {
dev_err(dev->class_dev, "%s failed: no acknowledge\n", dev_err(dev->class_dev, "failed: no acknowledge\n");
__func__);
i2c_stop(dev); i2c_stop(dev);
return; return;
} }
...@@ -1712,8 +1711,7 @@ static void i2c_write(struct comedi_device *dev, unsigned int address, ...@@ -1712,8 +1711,7 @@ static void i2c_write(struct comedi_device *dev, unsigned int address,
for (i = 0; i < length; i++) { for (i = 0; i < length; i++) {
i2c_write_byte(dev, data[i]); i2c_write_byte(dev, data[i]);
if (i2c_read_ack(dev) != 0) { if (i2c_read_ack(dev) != 0) {
dev_err(dev->class_dev, "%s failed: no acknowledge\n", dev_err(dev->class_dev, "failed: no acknowledge\n");
__func__);
i2c_stop(dev); i2c_stop(dev);
return; return;
} }
......
...@@ -1068,7 +1068,7 @@ static int ni_ai_drain_dma(struct comedi_device *dev) ...@@ -1068,7 +1068,7 @@ static int ni_ai_drain_dma(struct comedi_device *dev)
udelay(5); udelay(5);
} }
if (i == timeout) { if (i == timeout) {
dev_err(dev->class_dev, "%s timed out\n", __func__); dev_err(dev->class_dev, "timed out\n");
dev_err(dev->class_dev, dev_err(dev->class_dev,
"mite_bytes_in_transit=%i, AI_Status1_Register=0x%x\n", "mite_bytes_in_transit=%i, AI_Status1_Register=0x%x\n",
mite_bytes_in_transit(devpriv->ai_mite_chan), mite_bytes_in_transit(devpriv->ai_mite_chan),
...@@ -2116,8 +2116,7 @@ static int ni_ai_insn_read(struct comedi_device *dev, ...@@ -2116,8 +2116,7 @@ static int ni_ai_insn_read(struct comedi_device *dev,
} }
} }
if (i == NI_TIMEOUT) { if (i == NI_TIMEOUT) {
dev_err(dev->class_dev, "%s timeout\n", dev_err(dev->class_dev, "timeout\n");
__func__);
return -ETIME; return -ETIME;
} }
d += signbits; d += signbits;
...@@ -2140,8 +2139,7 @@ static int ni_ai_insn_read(struct comedi_device *dev, ...@@ -2140,8 +2139,7 @@ static int ni_ai_insn_read(struct comedi_device *dev,
} }
} }
if (i == NI_TIMEOUT) { if (i == NI_TIMEOUT) {
dev_err(dev->class_dev, "%s timeout\n", dev_err(dev->class_dev, "timeout\n");
__func__);
return -ETIME; return -ETIME;
} }
data[n] = (((dl >> 16) & 0xFFFF) + signbits) & 0xFFFF; data[n] = (((dl >> 16) & 0xFFFF) + signbits) & 0xFFFF;
...@@ -2156,8 +2154,7 @@ static int ni_ai_insn_read(struct comedi_device *dev, ...@@ -2156,8 +2154,7 @@ static int ni_ai_insn_read(struct comedi_device *dev,
break; break;
} }
if (i == NI_TIMEOUT) { if (i == NI_TIMEOUT) {
dev_err(dev->class_dev, "%s timeout\n", dev_err(dev->class_dev, "timeout\n");
__func__);
return -ETIME; return -ETIME;
} }
if (devpriv->is_m_series) { if (devpriv->is_m_series) {
...@@ -2808,8 +2805,7 @@ static int ni_m_series_ao_config_chanlist(struct comedi_device *dev, ...@@ -2808,8 +2805,7 @@ static int ni_m_series_ao_config_chanlist(struct comedi_device *dev,
break; break;
default: default:
dev_err(dev->class_dev, dev_err(dev->class_dev,
"%s: bug! unhandled ao reference voltage\n", "bug! unhandled ao reference voltage\n");
__func__);
break; break;
} }
switch (krange->max + krange->min) { switch (krange->max + krange->min) {
...@@ -2821,8 +2817,7 @@ static int ni_m_series_ao_config_chanlist(struct comedi_device *dev, ...@@ -2821,8 +2817,7 @@ static int ni_m_series_ao_config_chanlist(struct comedi_device *dev,
break; break;
default: default:
dev_err(dev->class_dev, dev_err(dev->class_dev,
"%s: bug! unhandled ao offset voltage\n", "bug! unhandled ao offset voltage\n");
__func__);
break; break;
} }
if (timed) if (timed)
...@@ -3694,8 +3689,7 @@ static int ni_serial_hw_readwrite8(struct comedi_device *dev, ...@@ -3694,8 +3689,7 @@ static int ni_serial_hw_readwrite8(struct comedi_device *dev,
udelay((devpriv->serial_interval_ns + 999) / 1000); udelay((devpriv->serial_interval_ns + 999) / 1000);
if (--count < 0) { if (--count < 0) {
dev_err(dev->class_dev, dev_err(dev->class_dev,
"%s: SPI serial I/O didn't finish in time!\n", "SPI serial I/O didn't finish in time!\n");
__func__);
err = -ETIME; err = -ETIME;
goto Error; goto Error;
} }
...@@ -3833,8 +3827,7 @@ static int ni_serial_insn_config(struct comedi_device *dev, ...@@ -3833,8 +3827,7 @@ static int ni_serial_insn_config(struct comedi_device *dev,
err = ni_serial_sw_readwrite8(dev, s, byte_out, err = ni_serial_sw_readwrite8(dev, s, byte_out,
&byte_in); &byte_in);
} else { } else {
dev_err(dev->class_dev, "%s: serial disabled!\n", dev_err(dev->class_dev, "serial disabled!\n");
__func__);
return -EINVAL; return -EINVAL;
} }
if (err < 0) if (err < 0)
...@@ -4520,8 +4513,7 @@ static unsigned ni_old_get_pfi_routing(struct comedi_device *dev, ...@@ -4520,8 +4513,7 @@ static unsigned ni_old_get_pfi_routing(struct comedi_device *dev,
case 9: case 9:
return NI_PFI_OUTPUT_G_GATE0; return NI_PFI_OUTPUT_G_GATE0;
default: default:
dev_err(dev->class_dev, dev_err(dev->class_dev, "bug, unhandled case in switch.\n");
"%s: bug, unhandled case in switch.\n", __func__);
break; break;
} }
return 0; return 0;
...@@ -4673,7 +4665,7 @@ static int cs5529_wait_for_idle(struct comedi_device *dev) ...@@ -4673,7 +4665,7 @@ static int cs5529_wait_for_idle(struct comedi_device *dev)
return -EIO; return -EIO;
} }
if (i == timeout) { if (i == timeout) {
dev_err(dev->class_dev, "%s timeout\n", __func__); dev_err(dev->class_dev, "timeout\n");
return -ETIME; return -ETIME;
} }
return 0; return 0;
...@@ -4908,7 +4900,7 @@ static int ni_mseries_set_pll_master_clock(struct comedi_device *dev, ...@@ -4908,7 +4900,7 @@ static int ni_mseries_set_pll_master_clock(struct comedi_device *dev,
&devpriv->clock_ns); &devpriv->clock_ns);
if (retval < 0) { if (retval < 0) {
dev_err(dev->class_dev, dev_err(dev->class_dev,
"%s: bug, failed to find pll parameters\n", __func__); "bug, failed to find pll parameters\n");
return retval; return retval;
} }
...@@ -4966,8 +4958,7 @@ static int ni_set_master_clock(struct comedi_device *dev, ...@@ -4966,8 +4958,7 @@ static int ni_set_master_clock(struct comedi_device *dev,
RTSI_Trig_Direction_Register); RTSI_Trig_Direction_Register);
if (period_ns == 0) { if (period_ns == 0) {
dev_err(dev->class_dev, dev_err(dev->class_dev,
"%s: we don't handle an unspecified clock period correctly yet, returning error\n", "we don't handle an unspecified clock period correctly yet, returning error\n");
__func__);
return -EINVAL; return -EINVAL;
} }
devpriv->clock_ns = period_ns; devpriv->clock_ns = period_ns;
...@@ -5057,8 +5048,7 @@ static unsigned ni_get_rtsi_routing(struct comedi_device *dev, unsigned chan) ...@@ -5057,8 +5048,7 @@ static unsigned ni_get_rtsi_routing(struct comedi_device *dev, unsigned chan)
} else { } else {
if (chan == old_RTSI_clock_channel) if (chan == old_RTSI_clock_channel)
return NI_RTSI_OUTPUT_RTSI_OSC; return NI_RTSI_OUTPUT_RTSI_OSC;
dev_err(dev->class_dev, "%s: bug! should never get here?\n", dev_err(dev->class_dev, "bug! should never get here?\n");
__func__);
return 0; return 0;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment