Commit ddcb01d4 authored by Alessio Igor Bogani's avatar Alessio Igor Bogani Committed by Greg Kroah-Hartman

Staging: comedi: replace __FUNCTION__ usages

__FUNCTION__ is gcc-specific, use __func__
Signed-off-by: default avatarAlessio Igor Bogani <abogani@texware.it>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent c5331be1
...@@ -696,7 +696,7 @@ static enum NI_660x_Register ni_gpct_to_660x_register(enum ni_gpct_register reg) ...@@ -696,7 +696,7 @@ static enum NI_660x_Register ni_gpct_to_660x_register(enum ni_gpct_register reg)
break; break;
default: default:
rt_printk("%s: unhandled register 0x%x in switch.\n", rt_printk("%s: unhandled register 0x%x in switch.\n",
__FUNCTION__, reg); __func__, reg);
BUG(); BUG();
return 0; return 0;
break; break;
...@@ -720,7 +720,7 @@ static inline void ni_660x_write_register(struct comedi_device * dev, ...@@ -720,7 +720,7 @@ static inline void ni_660x_write_register(struct comedi_device * dev,
break; break;
default: default:
rt_printk("%s: %s: bug! unhandled case (reg=0x%x) in switch.\n", rt_printk("%s: %s: bug! unhandled case (reg=0x%x) in switch.\n",
__FILE__, __FUNCTION__, reg); __FILE__, __func__, reg);
BUG(); BUG();
break; break;
} }
...@@ -742,7 +742,7 @@ static inline unsigned ni_660x_read_register(struct comedi_device * dev, ...@@ -742,7 +742,7 @@ static inline unsigned ni_660x_read_register(struct comedi_device * dev,
break; break;
default: default:
rt_printk("%s: %s: bug! unhandled case (reg=0x%x) in switch.\n", rt_printk("%s: %s: bug! unhandled case (reg=0x%x) in switch.\n",
__FILE__, __FUNCTION__, reg); __FILE__, __func__, reg);
BUG(); BUG();
break; break;
} }
......
...@@ -397,7 +397,7 @@ static inline void ni_set_bitfield(struct comedi_device * dev, int reg, ...@@ -397,7 +397,7 @@ static inline void ni_set_bitfield(struct comedi_device * dev, int reg,
break; break;
default: default:
rt_printk("Warning %s() called with invalid register\n", rt_printk("Warning %s() called with invalid register\n",
__FUNCTION__); __func__);
rt_printk("reg is %d\n", reg); rt_printk("reg is %d\n", reg);
break; break;
} }
...@@ -2845,7 +2845,7 @@ static int ni_m_series_ao_config_chanlist(struct comedi_device * dev, ...@@ -2845,7 +2845,7 @@ static int ni_m_series_ao_config_chanlist(struct comedi_device * dev,
break; break;
default: default:
rt_printk("%s: bug! unhandled ao reference voltage\n", rt_printk("%s: bug! unhandled ao reference voltage\n",
__FUNCTION__); __func__);
break; break;
} }
switch (krange->max + krange->min) { switch (krange->max + krange->min) {
...@@ -2857,7 +2857,7 @@ static int ni_m_series_ao_config_chanlist(struct comedi_device * dev, ...@@ -2857,7 +2857,7 @@ static int ni_m_series_ao_config_chanlist(struct comedi_device * dev,
break; break;
default: default:
rt_printk("%s: bug! unhandled ao offset voltage\n", rt_printk("%s: bug! unhandled ao offset voltage\n",
__FUNCTION__); __func__);
break; break;
} }
if (timed) if (timed)
...@@ -4104,7 +4104,7 @@ static unsigned ni_gpct_to_stc_register(enum ni_gpct_register reg) ...@@ -4104,7 +4104,7 @@ static unsigned ni_gpct_to_stc_register(enum ni_gpct_register reg)
break; break;
default: default:
rt_printk("%s: unhandled register 0x%x in switch.\n", rt_printk("%s: unhandled register 0x%x in switch.\n",
__FUNCTION__, reg); __func__, reg);
BUG(); BUG();
return 0; return 0;
break; break;
...@@ -5229,7 +5229,7 @@ static unsigned ni_old_get_pfi_routing(struct comedi_device * dev, unsigned chan ...@@ -5229,7 +5229,7 @@ static unsigned ni_old_get_pfi_routing(struct comedi_device * dev, unsigned chan
return NI_PFI_OUTPUT_G_GATE0; return NI_PFI_OUTPUT_G_GATE0;
break; break;
default: default:
rt_printk("%s: bug, unhandled case in switch.\n", __FUNCTION__); rt_printk("%s: bug, unhandled case in switch.\n", __func__);
break; break;
} }
return 0; return 0;
...@@ -5396,7 +5396,7 @@ static int ni_mseries_get_pll_parameters(unsigned reference_period_ns, ...@@ -5396,7 +5396,7 @@ static int ni_mseries_get_pll_parameters(unsigned reference_period_ns,
} }
if (best_period_picosec == 0) { if (best_period_picosec == 0) {
rt_printk("%s: bug, failed to find pll parameters\n", rt_printk("%s: bug, failed to find pll parameters\n",
__FUNCTION__); __func__);
return -EIO; return -EIO;
} }
*freq_divider = best_div; *freq_divider = best_div;
...@@ -5432,7 +5432,7 @@ static int ni_mseries_set_pll_master_clock(struct comedi_device * dev, unsigned ...@@ -5432,7 +5432,7 @@ static int ni_mseries_set_pll_master_clock(struct comedi_device * dev, unsigned
if (period_ns < min_period_ns || period_ns > max_period_ns) { if (period_ns < min_period_ns || period_ns > max_period_ns) {
rt_printk rt_printk
("%s: you must specify an input clock frequency between %i and %i nanosec " ("%s: you must specify an input clock frequency between %i and %i nanosec "
"for the phased-lock loop.\n", __FUNCTION__, "for the phased-lock loop.\n", __func__,
min_period_ns, max_period_ns); min_period_ns, max_period_ns);
return -EINVAL; return -EINVAL;
} }
...@@ -5506,7 +5506,7 @@ static int ni_mseries_set_pll_master_clock(struct comedi_device * dev, unsigned ...@@ -5506,7 +5506,7 @@ static int ni_mseries_set_pll_master_clock(struct comedi_device * dev, unsigned
if (i == timeout) { if (i == timeout) {
rt_printk rt_printk
("%s: timed out waiting for PLL to lock to reference clock source %i with period %i ns.\n", ("%s: timed out waiting for PLL to lock to reference clock source %i with period %i ns.\n",
__FUNCTION__, source, period_ns); __func__, source, period_ns);
return -ETIMEDOUT; return -ETIMEDOUT;
} }
return 3; return 3;
...@@ -5543,7 +5543,7 @@ static int ni_set_master_clock(struct comedi_device * dev, unsigned source, ...@@ -5543,7 +5543,7 @@ static int ni_set_master_clock(struct comedi_device * dev, unsigned source,
if (period_ns == 0) { if (period_ns == 0) {
rt_printk rt_printk
("%s: we don't handle an unspecified clock period correctly yet, returning error.\n", ("%s: we don't handle an unspecified clock period correctly yet, returning error.\n",
__FUNCTION__); __func__);
return -EINVAL; return -EINVAL;
} else { } else {
devpriv->clock_ns = period_ns; devpriv->clock_ns = period_ns;
...@@ -5566,7 +5566,7 @@ static int ni_valid_rtsi_output_source(struct comedi_device * dev, unsigned chan ...@@ -5566,7 +5566,7 @@ static int ni_valid_rtsi_output_source(struct comedi_device * dev, unsigned chan
else { else {
rt_printk rt_printk
("%s: invalid source for channel=%i, channel %i is always the RTSI clock for pre-m-series boards.\n", ("%s: invalid source for channel=%i, channel %i is always the RTSI clock for pre-m-series boards.\n",
__FUNCTION__, chan, __func__, chan,
old_RTSI_clock_channel); old_RTSI_clock_channel);
return 0; return 0;
} }
...@@ -5629,7 +5629,7 @@ static unsigned ni_get_rtsi_routing(struct comedi_device * dev, unsigned chan) ...@@ -5629,7 +5629,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;
rt_printk("%s: bug! should never get here?\n", __FUNCTION__); rt_printk("%s: bug! should never get here?\n", __func__);
return 0; return 0;
} }
} }
...@@ -5724,7 +5724,7 @@ static int cs5529_wait_for_idle(struct comedi_device * dev) ...@@ -5724,7 +5724,7 @@ static int cs5529_wait_for_idle(struct comedi_device * dev)
} }
/* printk("looped %i times waiting for idle\n", i); */ /* printk("looped %i times waiting for idle\n", i); */
if (i == timeout) { if (i == timeout) {
rt_printk("%s: %s: timeout\n", __FILE__, __FUNCTION__); rt_printk("%s: %s: timeout\n", __FILE__, __func__);
return -ETIME; return -ETIME;
} }
return 0; return 0;
......
...@@ -1351,7 +1351,7 @@ static void m_series_stc_writew(struct comedi_device * dev, uint16_t data, int r ...@@ -1351,7 +1351,7 @@ static void m_series_stc_writew(struct comedi_device * dev, uint16_t data, int r
case DIO_Control_Register: case DIO_Control_Register:
rt_printk rt_printk
("%s: FIXME: register 0x%x does not map cleanly on to m-series boards.\n", ("%s: FIXME: register 0x%x does not map cleanly on to m-series boards.\n",
__FUNCTION__, reg); __func__, reg);
return; return;
break; break;
case G_Autoincrement_Register(0): case G_Autoincrement_Register(0):
...@@ -1412,7 +1412,7 @@ static void m_series_stc_writew(struct comedi_device * dev, uint16_t data, int r ...@@ -1412,7 +1412,7 @@ static void m_series_stc_writew(struct comedi_device * dev, uint16_t data, int r
and M_Offset_SCXI_Serial_Data_Out (8 bit) */ and M_Offset_SCXI_Serial_Data_Out (8 bit) */
default: default:
rt_printk("%s: bug! unhandled register=0x%x in switch.\n", rt_printk("%s: bug! unhandled register=0x%x in switch.\n",
__FUNCTION__, reg); __func__, reg);
BUG(); BUG();
return; return;
break; break;
...@@ -1447,7 +1447,7 @@ static uint16_t m_series_stc_readw(struct comedi_device * dev, int reg) ...@@ -1447,7 +1447,7 @@ static uint16_t m_series_stc_readw(struct comedi_device * dev, int reg)
break; break;
default: default:
rt_printk("%s: bug! unhandled register=0x%x in switch.\n", rt_printk("%s: bug! unhandled register=0x%x in switch.\n",
__FUNCTION__, reg); __func__, reg);
BUG(); BUG();
return 0; return 0;
break; break;
...@@ -1488,7 +1488,7 @@ static void m_series_stc_writel(struct comedi_device * dev, uint32_t data, int r ...@@ -1488,7 +1488,7 @@ static void m_series_stc_writel(struct comedi_device * dev, uint32_t data, int r
break; break;
default: default:
rt_printk("%s: bug! unhandled register=0x%x in switch.\n", rt_printk("%s: bug! unhandled register=0x%x in switch.\n",
__FUNCTION__, reg); __func__, reg);
BUG(); BUG();
return; return;
break; break;
...@@ -1514,7 +1514,7 @@ static uint32_t m_series_stc_readl(struct comedi_device * dev, int reg) ...@@ -1514,7 +1514,7 @@ static uint32_t m_series_stc_readl(struct comedi_device * dev, int reg)
break; break;
default: default:
rt_printk("%s: bug! unhandled register=0x%x in switch.\n", rt_printk("%s: bug! unhandled register=0x%x in switch.\n",
__FUNCTION__, reg); __func__, reg);
BUG(); BUG();
return 0; return 0;
break; break;
......
...@@ -339,7 +339,7 @@ static inline unsigned RTSI_Output_Bit(unsigned channel, int is_mseries) ...@@ -339,7 +339,7 @@ static inline unsigned RTSI_Output_Bit(unsigned channel, int is_mseries)
max_channel = 6; max_channel = 6;
} }
if (channel > max_channel) { if (channel > max_channel) {
rt_printk("%s: bug, invalid RTSI_channel=%i\n", __FUNCTION__, rt_printk("%s: bug, invalid RTSI_channel=%i\n", __func__,
channel); channel);
return 0; return 0;
} }
...@@ -1085,7 +1085,7 @@ static inline int M_Offset_Static_AI_Control(int i) ...@@ -1085,7 +1085,7 @@ static inline int M_Offset_Static_AI_Control(int i)
0x263, 0x263,
}; };
if (((unsigned)i) >= sizeof(offset) / sizeof(offset[0])) { if (((unsigned)i) >= sizeof(offset) / sizeof(offset[0])) {
rt_printk("%s: invalid channel=%i\n", __FUNCTION__, i); rt_printk("%s: invalid channel=%i\n", __func__, i);
return offset[0]; return offset[0];
} }
return offset[i]; return offset[i];
...@@ -1099,7 +1099,7 @@ static inline int M_Offset_AO_Reference_Attenuation(int channel) ...@@ -1099,7 +1099,7 @@ static inline int M_Offset_AO_Reference_Attenuation(int channel)
0x267 0x267
}; };
if (((unsigned)channel) >= sizeof(offset) / sizeof(offset[0])) { if (((unsigned)channel) >= sizeof(offset) / sizeof(offset[0])) {
rt_printk("%s: invalid channel=%i\n", __FUNCTION__, channel); rt_printk("%s: invalid channel=%i\n", __func__, channel);
return offset[0]; return offset[0];
} }
return offset[channel]; return offset[channel];
...@@ -1108,7 +1108,7 @@ static inline unsigned M_Offset_PFI_Output_Select(unsigned n) ...@@ -1108,7 +1108,7 @@ static inline unsigned M_Offset_PFI_Output_Select(unsigned n)
{ {
if (n < 1 || n > NUM_PFI_OUTPUT_SELECT_REGS) { if (n < 1 || n > NUM_PFI_OUTPUT_SELECT_REGS) {
rt_printk("%s: invalid pfi output select register=%i\n", rt_printk("%s: invalid pfi output select register=%i\n",
__FUNCTION__, n); __func__, n);
return M_Offset_PFI_Output_Select_1; return M_Offset_PFI_Output_Select_1;
} }
return M_Offset_PFI_Output_Select_1 + (n - 1) * 2; return M_Offset_PFI_Output_Select_1 + (n - 1) * 2;
...@@ -1162,7 +1162,7 @@ static inline unsigned MSeries_PLL_In_Source_Select_RTSI_Bits(unsigned ...@@ -1162,7 +1162,7 @@ static inline unsigned MSeries_PLL_In_Source_Select_RTSI_Bits(unsigned
RTSI_channel) RTSI_channel)
{ {
if (RTSI_channel > 7) { if (RTSI_channel > 7) {
rt_printk("%s: bug, invalid RTSI_channel=%i\n", __FUNCTION__, rt_printk("%s: bug, invalid RTSI_channel=%i\n", __func__,
RTSI_channel); RTSI_channel);
return 0; return 0;
} }
...@@ -1183,7 +1183,7 @@ static inline unsigned MSeries_PLL_Divisor_Bits(unsigned divisor) ...@@ -1183,7 +1183,7 @@ static inline unsigned MSeries_PLL_Divisor_Bits(unsigned divisor)
{ {
static const unsigned max_divisor = 0x10; static const unsigned max_divisor = 0x10;
if (divisor < 1 || divisor > max_divisor) { if (divisor < 1 || divisor > max_divisor) {
rt_printk("%s: bug, invalid divisor=%i\n", __FUNCTION__, rt_printk("%s: bug, invalid divisor=%i\n", __func__,
divisor); divisor);
return 0; return 0;
} }
...@@ -1193,7 +1193,7 @@ static inline unsigned MSeries_PLL_Multiplier_Bits(unsigned multiplier) ...@@ -1193,7 +1193,7 @@ static inline unsigned MSeries_PLL_Multiplier_Bits(unsigned multiplier)
{ {
static const unsigned max_multiplier = 0x100; static const unsigned max_multiplier = 0x100;
if (multiplier < 1 || multiplier > max_multiplier) { if (multiplier < 1 || multiplier > max_multiplier) {
rt_printk("%s: bug, invalid multiplier=%i\n", __FUNCTION__, rt_printk("%s: bug, invalid multiplier=%i\n", __func__,
multiplier); multiplier);
return 0; return 0;
} }
......
...@@ -1273,7 +1273,7 @@ static int ni_tio_set_other_src(struct ni_gpct *counter, unsigned index, ...@@ -1273,7 +1273,7 @@ static int ni_tio_set_other_src(struct ni_gpct *counter, unsigned index,
counter_dev->regs[abz_reg] &= ~mask; counter_dev->regs[abz_reg] &= ~mask;
counter_dev->regs[abz_reg] |= (source << shift) & mask; counter_dev->regs[abz_reg] |= (source << shift) & mask;
write_register(counter, counter_dev->regs[abz_reg], abz_reg); write_register(counter, counter_dev->regs[abz_reg], abz_reg);
/* rt_printk("%s %x %d %d\n", __FUNCTION__, counter_dev->regs[abz_reg], index, source); */ /* rt_printk("%s %x %d %d\n", __func__, counter_dev->regs[abz_reg], index, source); */
return 0; return 0;
} }
return -EINVAL; return -EINVAL;
......
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