From 535ef8086ced2a191555b093607231461023ecbe Mon Sep 17 00:00:00 2001 From: Oron Peled Date: Wed, 11 Jan 2012 15:17:09 +0000 Subject: [PATCH] xpp: style: convert __FUNCTION__ to __func__ * Applied via: perl -pi -e 's/\b__FUNCTION__\b/__func__/g' "$@" Signed-off-by: Oron Peled Acked-By: Tzafrir Cohen git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10422 a0bf4364-ded3-4de4-8d8a-66a801d63aff --- drivers/dahdi/xpp/card_bri.c | 4 +- drivers/dahdi/xpp/card_fxo.c | 4 +- drivers/dahdi/xpp/card_fxs.c | 4 +- drivers/dahdi/xpp/card_global.c | 2 +- drivers/dahdi/xpp/card_pri.c | 74 ++++++++++++++++---------------- drivers/dahdi/xpp/dahdi_debug.h | 10 ++--- drivers/dahdi/xpp/mmapdrv.c | 2 +- drivers/dahdi/xpp/xbus-core.c | 40 ++++++++--------- drivers/dahdi/xpp/xbus-pcm.c | 12 +++--- drivers/dahdi/xpp/xbus-sysfs.c | 14 +++--- drivers/dahdi/xpp/xdefs.h | 2 +- drivers/dahdi/xpp/xframe_queue.c | 8 ++-- drivers/dahdi/xpp/xpp_dahdi.c | 28 ++++++------ drivers/dahdi/xpp/xpp_usb.c | 8 ++-- drivers/dahdi/xpp/xproto.c | 34 +++++++-------- 15 files changed, 123 insertions(+), 123 deletions(-) diff --git a/drivers/dahdi/xpp/card_bri.c b/drivers/dahdi/xpp/card_bri.c index 8e4a16c..39e4f61 100644 --- a/drivers/dahdi/xpp/card_bri.c +++ b/drivers/dahdi/xpp/card_bri.c @@ -1372,7 +1372,7 @@ static void su_new_state(xpd_t *xpd, byte reg_x30) priv = xpd->priv; BUG_ON(!priv); if(!priv->initialized) { - XPD_ERR(xpd, "%s called on uninitialized AB\n", __FUNCTION__); + XPD_ERR(xpd, "%s called on uninitialized AB\n", __func__); return; } new_state.reg = reg_x30; @@ -1477,7 +1477,7 @@ static int BRI_card_register_reply(xbus_t *xbus, xpd_t *xpd, reg_cmd_t *info) static int rate_limit; if((rate_limit++ % 1003) < 5) - notify_bad_xpd(__FUNCTION__, xbus, addr , orig_xpd->xpdname); + notify_bad_xpd(__func__, xbus, addr , orig_xpd->xpdname); return -EPROTO; } spin_lock_irqsave(&xpd->lock, flags); diff --git a/drivers/dahdi/xpp/card_fxo.c b/drivers/dahdi/xpp/card_fxo.c index d21763c..6a069bd 100644 --- a/drivers/dahdi/xpp/card_fxo.c +++ b/drivers/dahdi/xpp/card_fxo.c @@ -835,7 +835,7 @@ HANDLER_DEF(FXO, SIG_CHANGED) struct FXO_priv_data *priv; if(!xpd) { - notify_bad_xpd(__FUNCTION__, xbus, XPACKET_ADDR(pack), cmd->name); + notify_bad_xpd(__func__, xbus, XPACKET_ADDR(pack), cmd->name); return -EPROTO; } priv = xpd->priv; @@ -1359,7 +1359,7 @@ static int fxo_xpd_probe(struct device *dev) XPD_DBG(DEVICES, xpd, "SYSFS\n"); ret = device_create_file(dev, &dev_attr_fxo_battery); if(ret) { - XPD_ERR(xpd, "%s: device_create_file(fxo_battery) failed: %d\n", __FUNCTION__, ret); + XPD_ERR(xpd, "%s: device_create_file(fxo_battery) failed: %d\n", __func__, ret); goto fail_fxo_battery; } return 0; diff --git a/drivers/dahdi/xpp/card_fxs.c b/drivers/dahdi/xpp/card_fxs.c index 0a96ee7..6484f91 100644 --- a/drivers/dahdi/xpp/card_fxs.c +++ b/drivers/dahdi/xpp/card_fxs.c @@ -805,7 +805,7 @@ static int FXS_card_hooksig(xpd_t *xpd, int pos, enum dahdi_txsig txsig) break; default: XPD_NOTICE(xpd, "%s: Can't set tx state to %s (%d)\n", - __FUNCTION__, txsig2str(txsig), txsig); + __func__, txsig2str(txsig), txsig); ret = -EINVAL; } return ret; @@ -872,7 +872,7 @@ static int FXS_card_ioctl(xpd_t *xpd, int pos, unsigned int cmd, unsigned long a return -ENODEV; if (pos < 0 || pos >= PHONEDEV(xpd).channels) { XPD_NOTICE(xpd, "Bad channel number %d in %s(), cmd=%u\n", - pos, __FUNCTION__, cmd); + pos, __func__, cmd); return -EINVAL; } diff --git a/drivers/dahdi/xpp/card_global.c b/drivers/dahdi/xpp/card_global.c index ff3b7e0..e0b56fd 100644 --- a/drivers/dahdi/xpp/card_global.c +++ b/drivers/dahdi/xpp/card_global.c @@ -545,7 +545,7 @@ HANDLER_DEF(GLOBAL, REGISTER_REPLY) static int rate_limit; if((rate_limit++ % 1003) < 5) - notify_bad_xpd(__FUNCTION__, xbus, XPACKET_ADDR(pack), ""); + notify_bad_xpd(__func__, xbus, XPACKET_ADDR(pack), ""); return -EPROTO; } if(debug & DBG_REGS) { diff --git a/drivers/dahdi/xpp/card_pri.c b/drivers/dahdi/xpp/card_pri.c index 7607032..f0157de 100644 --- a/drivers/dahdi/xpp/card_pri.c +++ b/drivers/dahdi/xpp/card_pri.c @@ -606,7 +606,7 @@ static int set_pri_proto(xpd_t *xpd, enum pri_protocol set_proto) return -ENOSYS; default: XPD_ERR(xpd, "%s: Unknown pri protocol = %d\n", - __FUNCTION__, set_proto); + __func__, set_proto); return -EINVAL; } priv->pri_protocol = set_proto; @@ -747,7 +747,7 @@ static void set_reg_lim0(const char *msg, xpd_t *xpd) lim0 |= REG_LIM0_MAS; else lim0 &= ~REG_LIM0_MAS; - XPD_DBG(SIGNAL, xpd, "%s(%s): %s, %s\n", __FUNCTION__, msg, + XPD_DBG(SIGNAL, xpd, "%s(%s): %s, %s\n", __func__, msg, (is_master_mode) ? "MASTER" : "SLAVE", (localloop) ? "LOCALLOOP" : "NO_LOCALLOOP"); write_subunit(xpd, REG_LIM0 , lim0); @@ -764,7 +764,7 @@ static int set_master_mode(const char *msg, xpd_t *xpd) { BUG_ON(!xpd); XPD_DBG(SIGNAL, xpd, "\n"); - set_reg_lim0(__FUNCTION__, xpd); + set_reg_lim0(__func__, xpd); set_clocking(xpd); return 0; } @@ -777,12 +777,12 @@ static int set_localloop(xpd_t *xpd, bool localloop) priv = xpd->priv; if(SPAN_REGISTERED(xpd)) { XPD_NOTICE(xpd, "Registered as span %d. Cannot do %s\n", - PHONEDEV(xpd).span.spanno, __FUNCTION__); + PHONEDEV(xpd).span.spanno, __func__); return -EBUSY; } priv->local_loopback = localloop; - XPD_DBG(SIGNAL, xpd, "%s: %s\n", __FUNCTION__, (localloop) ? "LOCALLOOP" : "NO"); - set_master_mode(__FUNCTION__, xpd); + XPD_DBG(SIGNAL, xpd, "%s: %s\n", __func__, (localloop) ? "LOCALLOOP" : "NO"); + set_master_mode(__func__, xpd); return 0; } @@ -921,7 +921,7 @@ static int pri_lineconfig(xpd_t *xpd, int lineconfig) } if(flags && flags != BIT(i)) { ERR("%s: BUG: i=%d flags=0x%X\n", - __FUNCTION__, i, flags); + __func__, i, flags); // BUG(); } } @@ -1012,24 +1012,24 @@ static int pri_lineconfig(xpd_t *xpd, int lineconfig) framingstr, codingstr, crcstr, (lineconfig & DAHDI_CONFIG_NOTOPEN)?"YELLOW":"", lineconfig); - set_reg_lim0(__FUNCTION__, xpd); - XPD_DBG(GENERAL, xpd, "%s: fmr1(0x%02X) = 0x%02X\n", __FUNCTION__, REG_FMR1, fmr1); + set_reg_lim0(__func__, xpd); + XPD_DBG(GENERAL, xpd, "%s: fmr1(0x%02X) = 0x%02X\n", __func__, REG_FMR1, fmr1); write_subunit(xpd, REG_FMR1, fmr1); - XPD_DBG(GENERAL, xpd, "%s: fmr2(0x%02X) = 0x%02X\n", __FUNCTION__, REG_FMR2, fmr2); + XPD_DBG(GENERAL, xpd, "%s: fmr2(0x%02X) = 0x%02X\n", __func__, REG_FMR2, fmr2); write_subunit(xpd, REG_FMR2, fmr2); - XPD_DBG(GENERAL, xpd, "%s: fmr0(0x%02X) = 0x%02X\n", __FUNCTION__, REG_FMR0, fmr0); + XPD_DBG(GENERAL, xpd, "%s: fmr0(0x%02X) = 0x%02X\n", __func__, REG_FMR0, fmr0); write_subunit(xpd, REG_FMR0, fmr0); - XPD_DBG(GENERAL, xpd, "%s: fmr4(0x%02X) = 0x%02X\n", __FUNCTION__, REG_FMR4, fmr4); + XPD_DBG(GENERAL, xpd, "%s: fmr4(0x%02X) = 0x%02X\n", __func__, REG_FMR4, fmr4); write_subunit(xpd, REG_FMR4, fmr4); if(fmr3) { - XPD_DBG(GENERAL, xpd, "%s: fmr3(0x%02X) = 0x%02X\n", __FUNCTION__, REG_FMR3, fmr3); + XPD_DBG(GENERAL, xpd, "%s: fmr3(0x%02X) = 0x%02X\n", __func__, REG_FMR3, fmr3); write_subunit(xpd, REG_FMR3, fmr3); } - XPD_DBG(GENERAL, xpd, "%s: cmdr(0x%02X) = 0x%02X\n", __FUNCTION__, REG_CMDR_E, cmdr); + XPD_DBG(GENERAL, xpd, "%s: cmdr(0x%02X) = 0x%02X\n", __func__, REG_CMDR_E, cmdr); write_subunit(xpd, REG_CMDR_E, cmdr); #ifdef JAPANEZE_SUPPORT if(rc0) { - XPD_DBG(GENERAL, xpd, "%s: rc0(0x%02X) = 0x%02X\n", __FUNCTION__, REG_RC0, rc0); + XPD_DBG(GENERAL, xpd, "%s: rc0(0x%02X) = 0x%02X\n", __func__, REG_RC0, rc0); write_subunit(xpd, REG_RC0, rc0); } #endif @@ -1042,12 +1042,12 @@ static int pri_lineconfig(xpd_t *xpd, int lineconfig) * They are unused in E1 and should be 1 */ XPD_DBG(GENERAL, xpd, "%s: rs1(0x%02X) = 0x%02X\n", - __FUNCTION__, REG_RS1_E, rs1); + __func__, REG_RS1_E, rs1); write_subunit(xpd, REG_RS1_E, rs1); } xsp |= REG_XSP_E_CASEN; /* Same as REG_FMR5_T_EIBR for T1 */ } - XPD_DBG(GENERAL, xpd, "%s: xsp(0x%02X) = 0x%02X\n", __FUNCTION__, REG_XSP_E, xsp); + XPD_DBG(GENERAL, xpd, "%s: xsp(0x%02X) = 0x%02X\n", __func__, REG_XSP_E, xsp); write_subunit(xpd, REG_XSP_E, xsp); return 0; bad_lineconfig: @@ -1206,7 +1206,7 @@ static int PRI_card_init(xbus_t *xbus, xpd_t *xpd) PHONEDEV(xpd).direction = TO_PSTN; XPD_DBG(DEVICES, xpd, "%s\n", xpd->type_name); PHONEDEV(xpd).timing_priority = 1; /* High priority SLAVE */ - set_master_mode(__FUNCTION__, xpd); + set_master_mode(__func__, xpd); for(ret = 0; ret < NUM_LEDS; ret++) { DO_LED(xpd, ret, PRI_LED_ON); msleep(20); @@ -1576,7 +1576,7 @@ static int encode_rbsbits_e1(xpd_t *xpd, int pos, int bits) if(pos == 15) return 0; /* Don't write dchan in CAS */ if(pos < 0 || pos > 31) { - XPD_NOTICE(xpd, "%s: pos=%d out of range. Ignore\n", __FUNCTION__, pos); + XPD_NOTICE(xpd, "%s: pos=%d out of range. Ignore\n", __func__, pos); return 0; } if(pos >= 16) { @@ -1609,7 +1609,7 @@ static int encode_rbsbits_t1(xpd_t *xpd, int pos, int bits) BUG_ON(!priv); BUG_ON(priv->pri_protocol != PRI_PROTO_T1); if(pos < 0 || pos >= PHONEDEV(xpd).channels) { - XPD_ERR(xpd, "%s: Bad pos=%d\n", __FUNCTION__, pos); + XPD_ERR(xpd, "%s: Bad pos=%d\n", __func__, pos); return 0; } chan_per_reg = CHAN_PER_REGS(priv); @@ -1701,7 +1701,7 @@ static int pri_rbsbits(struct dahdi_chan *chan, int bits) return -EINVAL; } else { XPD_NOTICE(xpd, "%s: protocol %s is not supported yet with CAS\n", - __FUNCTION__, pri_protocol_name(priv->pri_protocol)); + __func__, pri_protocol_name(priv->pri_protocol)); return -EINVAL; } return 0; @@ -1996,19 +1996,19 @@ static int decode_cas_e1(xpd_t *xpd, byte regnum, byte data_low) BUG_ON(priv->pri_protocol != PRI_PROTO_E1); XPD_DBG(SIGNAL, xpd, "RBS: RX: data_low=0x%02X\n", data_low); if(pos >= NUM_CAS_RS_E) { - XPD_ERR(xpd, "%s: got bad pos=%d [0-%d]\n", __FUNCTION__, pos, NUM_CAS_RS_E); + XPD_ERR(xpd, "%s: got bad pos=%d [0-%d]\n", __func__, pos, NUM_CAS_RS_E); return -EINVAL; } if(chan1 < 0 || chan1 > PHONEDEV(xpd).channels) { XPD_NOTICE(xpd, "%s: %s CAS: Bad chan1 number (%d)\n", - __FUNCTION__, + __func__, pri_protocol_name(priv->pri_protocol), chan1); return -EINVAL; } if(chan2 < 0 || chan2 > PHONEDEV(xpd).channels) { XPD_NOTICE(xpd, "%s: %s CAS: Bad chan2 number (%d)\n", - __FUNCTION__, + __func__, pri_protocol_name(priv->pri_protocol), chan2); return -EINVAL; @@ -2058,12 +2058,12 @@ static int decode_cas_t1(xpd_t *xpd, byte regnum, byte data_low) rxsig <<= 2; pos = rsnum * chan_per_reg + chan_per_reg - i - 1; if(pos < 0 || pos >= PHONEDEV(xpd).channels) { - XPD_ERR(xpd, "%s: Bad pos=%d\n", __FUNCTION__, pos); + XPD_ERR(xpd, "%s: Bad pos=%d\n", __func__, pos); continue; } chan = XPD_CHAN(xpd, pos); if(!chan) { - XPD_ERR(xpd, "%s: Null channel in pos=%d\n", __FUNCTION__, pos); + XPD_ERR(xpd, "%s: Null channel in pos=%d\n", __func__, pos); continue; } if(chan->rxsig != rxsig) { @@ -2110,7 +2110,7 @@ static void process_cas_dchan(xpd_t *xpd, byte regnum, byte data_low) XPD_NOTICE(xpd, "%s: received register 0x%X in protocol %s. Ignore\n", - __FUNCTION__, regnum, pri_protocol_name(priv->pri_protocol)); + __func__, regnum, pri_protocol_name(priv->pri_protocol)); return; } if(decode_cas_e1(xpd, regnum, data_low) < 0) @@ -2119,14 +2119,14 @@ static void process_cas_dchan(xpd_t *xpd, byte regnum, byte data_low) if(regnum > REG_RS12_E) { XPD_NOTICE(xpd, "%s: received register 0x%X in protocol %s. Ignore\n", - __FUNCTION__, regnum, pri_protocol_name(priv->pri_protocol)); + __func__, regnum, pri_protocol_name(priv->pri_protocol)); return; } if(decode_cas_t1(xpd, regnum, data_low) < 0) return; } else { XPD_NOTICE(xpd, "%s: protocol %s is not supported yet with CAS\n", - __FUNCTION__, pri_protocol_name(priv->pri_protocol)); + __func__, pri_protocol_name(priv->pri_protocol)); } priv->cas_replies++; } @@ -2151,7 +2151,7 @@ static int PRI_card_register_reply(xbus_t *xbus, xpd_t *xpd, reg_cmd_t *info) static int rate_limit; if((rate_limit++ % 1003) < 5) - notify_bad_xpd(__FUNCTION__, xbus, addr , orig_xpd->xpdname); + notify_bad_xpd(__func__, xbus, addr , orig_xpd->xpdname); return -EPROTO; } spin_lock_irqsave(&xpd->lock, flags); @@ -2518,37 +2518,37 @@ static int pri_xpd_probe(struct device *dev) XPD_DBG(DEVICES, xpd, "SYSFS\n"); ret = device_create_file(dev, &dev_attr_pri_protocol); if(ret) { - XPD_ERR(xpd, "%s: device_create_file(pri_protocol) failed: %d\n", __FUNCTION__, ret); + XPD_ERR(xpd, "%s: device_create_file(pri_protocol) failed: %d\n", __func__, ret); goto fail_pri_protocol; } ret = device_create_file(dev, &dev_attr_pri_localloop); if(ret) { - XPD_ERR(xpd, "%s: device_create_file(pri_localloop) failed: %d\n", __FUNCTION__, ret); + XPD_ERR(xpd, "%s: device_create_file(pri_localloop) failed: %d\n", __func__, ret); goto fail_pri_localloop; } ret = device_create_file(dev, &dev_attr_pri_layer1); if(ret) { - XPD_ERR(xpd, "%s: device_create_file(pri_layer1) failed: %d\n", __FUNCTION__, ret); + XPD_ERR(xpd, "%s: device_create_file(pri_layer1) failed: %d\n", __func__, ret); goto fail_pri_layer1; } ret = device_create_file(dev, &dev_attr_pri_alarms); if(ret) { - XPD_ERR(xpd, "%s: device_create_file(pri_alarms) failed: %d\n", __FUNCTION__, ret); + XPD_ERR(xpd, "%s: device_create_file(pri_alarms) failed: %d\n", __func__, ret); goto fail_pri_alarms; } ret = device_create_file(dev, &dev_attr_pri_cas); if(ret) { - XPD_ERR(xpd, "%s: device_create_file(pri_cas) failed: %d\n", __FUNCTION__, ret); + XPD_ERR(xpd, "%s: device_create_file(pri_cas) failed: %d\n", __func__, ret); goto fail_pri_cas; } ret = device_create_file(dev, &dev_attr_pri_dchan); if(ret) { - XPD_ERR(xpd, "%s: device_create_file(pri_dchan) failed: %d\n", __FUNCTION__, ret); + XPD_ERR(xpd, "%s: device_create_file(pri_dchan) failed: %d\n", __func__, ret); goto fail_pri_dchan; } ret = device_create_file(dev, &dev_attr_pri_clocking); if(ret) { - XPD_ERR(xpd, "%s: device_create_file(pri_clocking) failed: %d\n", __FUNCTION__, ret); + XPD_ERR(xpd, "%s: device_create_file(pri_clocking) failed: %d\n", __func__, ret); goto fail_pri_clocking; } return 0; diff --git a/drivers/dahdi/xpp/dahdi_debug.h b/drivers/dahdi/xpp/dahdi_debug.h index 7bf68f3..ce6ed1b 100644 --- a/drivers/dahdi/xpp/dahdi_debug.h +++ b/drivers/dahdi/xpp/dahdi_debug.h @@ -46,33 +46,33 @@ category, THIS_MODULE->name, (xbus)->busname, (unit), (port), ## __VA_ARGS__) #define DBG(bits, fmt, ...) \ - ((void)((debug & (DBG_ ## bits)) && PRINTK(DEBUG, "-" #bits, "%s: " fmt, __FUNCTION__, ## __VA_ARGS__))) + ((void)((debug & (DBG_ ## bits)) && PRINTK(DEBUG, "-" #bits, "%s: " fmt, __func__, ## __VA_ARGS__))) #define INFO(fmt, ...) PRINTK(INFO, "", fmt, ## __VA_ARGS__) #define NOTICE(fmt, ...) PRINTK(NOTICE, "", fmt, ## __VA_ARGS__) #define WARNING(fmt, ...) PRINTK(WARNING, "", fmt, ## __VA_ARGS__) #define ERR(fmt, ...) PRINTK(ERR, "", fmt, ## __VA_ARGS__) #define XBUS_DBG(bits, xbus, fmt, ...) \ - ((void)((debug & (DBG_ ## bits)) && XBUS_PRINTK(DEBUG, "-" #bits, xbus, "%s: " fmt, __FUNCTION__, ## __VA_ARGS__))) + ((void)((debug & (DBG_ ## bits)) && XBUS_PRINTK(DEBUG, "-" #bits, xbus, "%s: " fmt, __func__, ## __VA_ARGS__))) #define XBUS_INFO(xbus, fmt, ...) XBUS_PRINTK(INFO, "", xbus, fmt, ## __VA_ARGS__) #define XBUS_NOTICE(xbus, fmt, ...) XBUS_PRINTK(NOTICE, "", xbus, fmt, ## __VA_ARGS__) #define XBUS_ERR(xbus, fmt, ...) XBUS_PRINTK(ERR, "", xbus, fmt, ## __VA_ARGS__) #define XPD_DBG(bits, xpd, fmt, ...) \ - ((void)((debug & (DBG_ ## bits)) && XPD_PRINTK(DEBUG, "-" #bits, xpd, "%s: " fmt, __FUNCTION__, ## __VA_ARGS__))) + ((void)((debug & (DBG_ ## bits)) && XPD_PRINTK(DEBUG, "-" #bits, xpd, "%s: " fmt, __func__, ## __VA_ARGS__))) #define XPD_INFO(xpd, fmt, ...) XPD_PRINTK(INFO, "", xpd, fmt, ## __VA_ARGS__) #define XPD_NOTICE(xpd, fmt, ...) XPD_PRINTK(NOTICE, "", xpd, fmt, ## __VA_ARGS__) #define XPD_WARNING(xpd, fmt, ...) XPD_PRINTK(WARNING, "", xpd, fmt, ## __VA_ARGS__) #define XPD_ERR(xpd, fmt, ...) XPD_PRINTK(ERR, "", xpd, fmt, ## __VA_ARGS__) #define LINE_DBG(bits, xpd, pos, fmt, ...) \ - ((void)((debug & (DBG_ ## bits)) && LINE_PRINTK(DEBUG, "-" #bits, xpd, pos, "%s: " fmt, __FUNCTION__, ## __VA_ARGS__))) + ((void)((debug & (DBG_ ## bits)) && LINE_PRINTK(DEBUG, "-" #bits, xpd, pos, "%s: " fmt, __func__, ## __VA_ARGS__))) #define LINE_NOTICE(xpd, pos, fmt, ...) LINE_PRINTK(NOTICE, "", xpd, pos, fmt, ## __VA_ARGS__) #define LINE_ERR(xpd, pos, fmt, ...) LINE_PRINTK(ERR, "", xpd, pos, fmt, ## __VA_ARGS__) #define PORT_DBG(bits, xbus, unit, port, fmt, ...) \ ((void)((debug & (DBG_ ## bits)) && PORT_PRINTK(DEBUG, "-" #bits, \ - xbus, unit, port, "%s: " fmt, __FUNCTION__, ## __VA_ARGS__))) + xbus, unit, port, "%s: " fmt, __func__, ## __VA_ARGS__))) #define PORT_NOTICE(xbus, unit, port, fmt, ...) PORT_PRINTK(NOTICE, "", xbus, unit, port, fmt, ## __VA_ARGS__) #define PORT_ERR(xbus, unit, port, fmt, ...) PORT_PRINTK(ERR, "", xbus, unit, port, fmt, ## __VA_ARGS__) diff --git a/drivers/dahdi/xpp/mmapdrv.c b/drivers/dahdi/xpp/mmapdrv.c index 05c91ab..0635903 100644 --- a/drivers/dahdi/xpp/mmapdrv.c +++ b/drivers/dahdi/xpp/mmapdrv.c @@ -383,7 +383,7 @@ static int xpp_mmap_proc_write(struct file *file, const char __user *buffer, uns if (*p == '\0') break; value = simple_strtoul(p, &endp, 16); if (endp == p || value > 0xFF) { - INFO("%s: Bad input\n", __FUNCTION__); + INFO("%s: Bad input\n", __func__); count = -EINVAL; goto out; } diff --git a/drivers/dahdi/xpp/xbus-core.c b/drivers/dahdi/xpp/xbus-core.c index 6e02313..3209e3e 100644 --- a/drivers/dahdi/xpp/xbus-core.c +++ b/drivers/dahdi/xpp/xbus-core.c @@ -164,7 +164,7 @@ static void finalize_xbuses_array(void) for(i = 0; i < ARRAY_SIZE(xbuses_array); i++) { if(xbuses_array[i].xbus != NULL) { - ERR("%s: xbus #%d is not NULL\n", __FUNCTION__, i); + ERR("%s: xbus #%d is not NULL\n", __func__, i); BUG(); } } @@ -272,7 +272,7 @@ void dump_xframe(const char msg[], const xbus_t *xbus, const xframe_t *xframe, i if(xframe->xframe_magic != XFRAME_MAGIC) { XBUS_ERR(xbus, "%s: bad xframe_magic %lX\n", - __FUNCTION__, xframe->xframe_magic); + __func__, xframe->xframe_magic); return; } spin_lock_irqsave(&serialize_dump_xframe, flags); @@ -472,13 +472,13 @@ int send_cmd_frame(xbus_t *xbus, xframe_t *xframe) goto err; } if(debug & DBG_COMMANDS) - dump_xframe(__FUNCTION__, xbus, xframe, DBG_ANY); + dump_xframe(__func__, xbus, xframe, DBG_ANY); if(!xframe_enqueue(&xbus->command_queue, xframe)) { if((rate_limit++ % 1003) == 0) { XBUS_ERR(xbus, "Dropped command xframe. Cannot enqueue (%d)\n", rate_limit); - dump_xframe(__FUNCTION__, xbus, xframe, DBG_ANY); + dump_xframe(__func__, xbus, xframe, DBG_ANY); } xbus_setstate(xbus, XBUS_STATE_FAIL); ret = -E2BIG; @@ -582,7 +582,7 @@ int xbus_xpd_bind(xbus_t *xbus, xpd_t *xpd, int unit, int subunit) spin_unlock_irqrestore(&xbus->lock, flags); /* Must be done out of atomic context */ if(xpd_device_register(xbus, xpd) < 0) { - XPD_ERR(xpd, "%s: xpd_device_register() failed\n", __FUNCTION__); + XPD_ERR(xpd, "%s: xpd_device_register() failed\n", __func__); /* FIXME: What to do? */ } return 0; @@ -595,18 +595,18 @@ int xbus_xpd_unbind(xbus_t *xbus, xpd_t *xpd) XBUS_DBG(DEVICES, xbus, "XPD #%d\n", xpd_num); if(!VALID_XPD_NUM(xpd_num)) { - XBUS_ERR(xbus, "%s: Bad xpd_num = %d\n", __FUNCTION__, xpd_num); + XBUS_ERR(xbus, "%s: Bad xpd_num = %d\n", __func__, xpd_num); BUG(); } if(xbus->xpds[xpd_num] == NULL) { - XBUS_ERR(xbus, "%s: slot xpd_num=%d is empty\n", __FUNCTION__, xpd_num); + XBUS_ERR(xbus, "%s: slot xpd_num=%d is empty\n", __func__, xpd_num); BUG(); } if(xbus->xpds[xpd_num] != xpd) { xpd_t *other = xbus->xpds[xpd_num]; XBUS_ERR(xbus, "%s: slot xpd_num=%d is occupied by %p (%s)\n", - __FUNCTION__, xpd_num, other, other->xpdname); + __func__, xpd_num, other, other->xpdname); BUG(); } spin_lock_irqsave(&xbus->lock, flags); @@ -1031,7 +1031,7 @@ void xbus_populate(void *data) xbus = container_of(worker, xbus_t, worker); xbus = get_xbus(__func__, xbus->num); /* return in function end */ - XBUS_DBG(DEVICES, xbus, "Entering %s\n", __FUNCTION__); + XBUS_DBG(DEVICES, xbus, "Entering %s\n", __func__); spin_lock_irqsave(&worker->worker_lock, flags); list_for_each_safe(card, next_card, &worker->card_list) { struct card_desc_struct *card_desc = list_entry(card, struct card_desc_struct, card_list); @@ -1091,12 +1091,12 @@ int xbus_process_worker(xbus_t *xbus) struct xbus_workqueue *worker; if(!xbus) { - ERR("%s: xbus gone -- skip initialization\n", __FUNCTION__); + ERR("%s: xbus gone -- skip initialization\n", __func__); return 0; } worker = &xbus->worker; if (down_trylock(&worker->running_initialization)) { - ERR("%s: xbus is disconnected -- skip initialization\n", __FUNCTION__); + ERR("%s: xbus is disconnected -- skip initialization\n", __func__); return 0; } XBUS_DBG(DEVICES, xbus, "\n"); @@ -1130,7 +1130,7 @@ static void worker_reset(xbus_t *xbus) DBG(DEVICES, "%s\n", name); if(!worker->xpds_init_done) { NOTICE("%s: worker(%s)->xpds_init_done=%d\n", - __FUNCTION__, name, worker->xpds_init_done); + __func__, name, worker->xpds_init_done); } spin_lock_irqsave(&worker->worker_lock, flags); list_for_each_safe(card, next_card, &worker->card_list) { @@ -1278,7 +1278,7 @@ bool xbus_setstate(xbus_t *xbus, enum xbus_state newstate) goto bad_state; break; default: - XBUS_NOTICE(xbus, "%s: unknown state %d\n", __FUNCTION__, newstate); + XBUS_NOTICE(xbus, "%s: unknown state %d\n", __func__, newstate); goto out; } /* All good */ @@ -1387,7 +1387,7 @@ static xbus_t *xbus_alloc(void) xbus = KZALLOC(sizeof(xbus_t), GFP_KERNEL); if(!xbus) { - ERR("%s: out of memory\n", __FUNCTION__); + ERR("%s: out of memory\n", __func__); return NULL; } spin_lock_irqsave(&xbuses_lock, flags); @@ -1395,7 +1395,7 @@ static xbus_t *xbus_alloc(void) if(xbuses_array[i].xbus == NULL) break; if(i >= MAX_BUSES) { - ERR("%s: No free slot for new bus. i=%d\n", __FUNCTION__, i); + ERR("%s: No free slot for new bus. i=%d\n", __func__, i); KZFREE(xbus); xbus = NULL; goto out; @@ -1456,7 +1456,7 @@ xbus_t *xbus_new(struct xbus_ops *ops, ushort max_send_size, struct device *tran BUG_ON(!ops); xbus = xbus_alloc(); if(!xbus) { - ERR("%s: Failed allocating new xbus\n", __FUNCTION__); + ERR("%s: Failed allocating new xbus\n", __func__); return NULL; } snprintf(xbus->busname, XBUS_NAMELEN, "XBUS-%02d", xbus->num); @@ -1700,7 +1700,7 @@ static int xbus_read_proc(char *page, char **start, off_t off, int count, int *e } len += sprintf(page + len, "<-- len=%d\n", len); spin_unlock_irqrestore(&xbus->lock, flags); - put_xbus(__FUNCTION__, xbus); /* from xbus_read_proc() */ + put_xbus(__func__, xbus); /* from xbus_read_proc() */ out: if (len <= off+count) *eof = 1; @@ -1728,7 +1728,7 @@ static int proc_xbus_command_write(struct file *file, const char __user *buffer, const size_t max_text = max_len * 3 + 10; if(count > max_text) { - XBUS_ERR(xbus, "%s: line too long (%ld > %zd)\n", __FUNCTION__, count, max_len); + XBUS_ERR(xbus, "%s: line too long (%ld > %zd)\n", __func__, count, max_len); return -EFBIG; } /* 3 bytes per hex-digit and space */ @@ -1757,7 +1757,7 @@ static int proc_xbus_command_write(struct file *file, const char __user *buffer, break; if(!isxdigit(*p)) { XBUS_ERR(xbus, "%s: bad hex value ASCII='0x%X' at position %ld\n", - __FUNCTION__, *p, (long)(p - buf)); + __func__, *p, (long)(p - buf)); count = -EINVAL; goto out; } @@ -1768,7 +1768,7 @@ static int proc_xbus_command_write(struct file *file, const char __user *buffer, hexdigit[1] = *p++; if(sscanf(hexdigit, "%2X", &val) != 1) { XBUS_ERR(xbus, "%s: bad hex value '%s' at position %ld\n", - __FUNCTION__, hexdigit, (long)(p - buf)); + __func__, hexdigit, (long)(p - buf)); count = -EINVAL; goto out; } diff --git a/drivers/dahdi/xpp/xbus-pcm.c b/drivers/dahdi/xpp/xbus-pcm.c index 4c9fd27..4a00c55 100644 --- a/drivers/dahdi/xpp/xbus-pcm.c +++ b/drivers/dahdi/xpp/xbus-pcm.c @@ -401,7 +401,7 @@ void got_new_syncer(xbus_t *xbus, enum sync_mode mode, int drift) case SYNC_MODE_QUERY: /* ignore */ break; default: - XBUS_ERR(xbus, "%s: unknown mode=0x%X\n", __FUNCTION__, mode); + XBUS_ERR(xbus, "%s: unknown mode=0x%X\n", __func__, mode); } out: spin_unlock_irqrestore(&ref_ticker_lock, flags2); @@ -987,7 +987,7 @@ static int copy_pcm_tospan(xbus_t *xbus, xframe_t *xframe) if((rate_limit++ % 1003) == 0) { XBUS_NOTICE(xbus, "%s: Non-PCM packet within a PCM xframe. (%d)\n", - __FUNCTION__, rate_limit); + __func__, rate_limit); dump_xframe("In PCM xframe", xbus, xframe, debug); } goto out; @@ -999,7 +999,7 @@ static int copy_pcm_tospan(xbus_t *xbus, xframe_t *xframe) if((rate_limit++ % 1003) == 0) { XBUS_NOTICE(xbus, "%s: Invalid packet length %d. (%d)\n", - __FUNCTION__, len, rate_limit); + __func__, len, rate_limit); dump_xframe("BAD LENGTH", xbus, xframe, debug); } goto out; @@ -1009,7 +1009,7 @@ static int copy_pcm_tospan(xbus_t *xbus, xframe_t *xframe) static int rate_limit; if((rate_limit++ % 1003) == 0) { - notify_bad_xpd(__FUNCTION__, xbus, XPACKET_ADDR(pack), "RECEIVE PCM"); + notify_bad_xpd(__func__, xbus, XPACKET_ADDR(pack), "RECEIVE PCM"); dump_xframe("Unknown XPD addr", xbus, xframe, debug); } goto out; @@ -1093,7 +1093,7 @@ static void xbus_tick(xbus_t *xbus) if((rate_limit++ % 3001) == 0) XBUS_ERR(xbus, "%s: failed to allocate new xframe\n", - __FUNCTION__); + __func__); return; } } @@ -1227,7 +1227,7 @@ int exec_sync_command(const char *buf, size_t count) CALL_PROTO(GLOBAL, SYNC_SOURCE, xbus, NULL, SYNC_MODE_QUERY, 0); put_xbus(__func__, xbus); } else { - ERR("%s: cannot parse '%s'\n", __FUNCTION__, buf); + ERR("%s: cannot parse '%s'\n", __func__, buf); ret = -EINVAL; } return ret; diff --git a/drivers/dahdi/xpp/xbus-sysfs.c b/drivers/dahdi/xpp/xbus-sysfs.c index f730ec1..71c4920 100644 --- a/drivers/dahdi/xpp/xbus-sysfs.c +++ b/drivers/dahdi/xpp/xbus-sysfs.c @@ -88,7 +88,7 @@ static DEVICE_ATTR_WRITER(xbus_state_store, dev, buf, count) xbus_activate(xbus); else { XBUS_NOTICE(xbus, "%s: Illegal action %s in state %s. Ignored.\n", - __FUNCTION__, buf, + __func__, buf, xbus_statename(XBUS_STATE(xbus))); return -EINVAL; } @@ -759,7 +759,7 @@ int xpd_driver_register(struct device_driver *driver) driver->bus = &xpd_type; if((ret = driver_register(driver)) < 0) { ERR("%s: driver_register(%s) failed. Error number %d", - __FUNCTION__, driver->name, ret); + __func__, driver->name, ret); } return ret; } @@ -794,7 +794,7 @@ int xpd_device_register(xbus_t *xbus, xpd_t *xpd) dev->release = xpd_release; ret = device_register(dev); if(ret) { - XPD_ERR(xpd, "%s: device_register failed: %d\n", __FUNCTION__, ret); + XPD_ERR(xpd, "%s: device_register failed: %d\n", __func__, ret); return ret; } return 0; @@ -979,7 +979,7 @@ int xbus_sysfs_create(xbus_t *xbus) astribank->release = astribank_release; ret = device_register(astribank); if(ret) { - XBUS_ERR(xbus, "%s: device_register failed: %d\n", __FUNCTION__, ret); + XBUS_ERR(xbus, "%s: device_register failed: %d\n", __func__, ret); dev_set_drvdata(astribank, NULL); } return ret; @@ -992,17 +992,17 @@ int __init xpp_driver_init(void) DBG(DEVICES, "SYSFS\n"); if((ret = bus_register(&toplevel_bus_type)) < 0) { ERR("%s: bus_register(%s) failed. Error number %d", - __FUNCTION__, toplevel_bus_type.name, ret); + __func__, toplevel_bus_type.name, ret); goto failed_toplevel; } if((ret = driver_register(&xpp_driver)) < 0) { ERR("%s: driver_register(%s) failed. Error number %d", - __FUNCTION__, xpp_driver.name, ret); + __func__, xpp_driver.name, ret); goto failed_xpp_driver; } if((ret = bus_register(&xpd_type)) < 0) { ERR("%s: bus_register(%s) failed. Error number %d", - __FUNCTION__, xpd_type.name, ret); + __func__, xpd_type.name, ret); goto failed_xpd_bus; } return 0; diff --git a/drivers/dahdi/xpp/xdefs.h b/drivers/dahdi/xpp/xdefs.h index 0a1617f..a97ee9b 100644 --- a/drivers/dahdi/xpp/xdefs.h +++ b/drivers/dahdi/xpp/xdefs.h @@ -39,7 +39,7 @@ typedef uint32_t __u32; #include -#define DBG(fmt, ...) printf("DBG: %s: " fmt, __FUNCTION__, ## __VA_ARGS__) +#define DBG(fmt, ...) printf("DBG: %s: " fmt, __func__, ## __VA_ARGS__) #define INFO(fmt, ...) printf("INFO: " fmt, ## __VA_ARGS__) #define NOTICE(fmt, ...) printf("NOTICE: " fmt, ## __VA_ARGS__) #define ERR(fmt, ...) printf("ERR: " fmt, ## __VA_ARGS__) diff --git a/drivers/dahdi/xpp/xframe_queue.c b/drivers/dahdi/xpp/xframe_queue.c index c94cfb9..cc3ea6c 100644 --- a/drivers/dahdi/xpp/xframe_queue.c +++ b/drivers/dahdi/xpp/xframe_queue.c @@ -162,7 +162,7 @@ static xframe_t *transport_alloc_xframe(xbus_t *xbus, gfp_t gfp_flags) return NULL; } spin_lock_irqsave(&xbus->transport.lock, flags); - //XBUS_INFO(xbus, "%s (transport_refcount=%d)\n", __FUNCTION__, atomic_read(&xbus->transport.transport_refcount)); + //XBUS_INFO(xbus, "%s (transport_refcount=%d)\n", __func__, atomic_read(&xbus->transport.transport_refcount)); xframe = ops->alloc_xframe(xbus, gfp_flags); if(!xframe) { static int rate_limit; @@ -187,7 +187,7 @@ static void transport_free_xframe(xbus_t *xbus, xframe_t *xframe) ops = xbus->transport.ops; BUG_ON(!ops); spin_lock_irqsave(&xbus->transport.lock, flags); - //XBUS_INFO(xbus, "%s (transport_refcount=%d)\n", __FUNCTION__, atomic_read(&xbus->transport.transport_refcount)); + //XBUS_INFO(xbus, "%s (transport_refcount=%d)\n", __func__, atomic_read(&xbus->transport.transport_refcount)); ops->free_xframe(xbus, xframe); transportops_put(xbus); spin_unlock_irqrestore(&xbus->transport.lock, flags); @@ -273,7 +273,7 @@ xframe_t *get_xframe(struct xframe_queue *q) * * memset(xframe->packets, 0, xframe->frame_maxlen); */ - //XBUS_INFO(xbus, "%s\n", __FUNCTION__); + //XBUS_INFO(xbus, "%s\n", __func__); return xframe; } @@ -284,7 +284,7 @@ void put_xframe(struct xframe_queue *q, xframe_t *xframe) BUG_ON(!q); xbus = (xbus_t *)q->priv; BUG_ON(!xbus); - //XBUS_INFO(xbus, "%s\n", __FUNCTION__); + //XBUS_INFO(xbus, "%s\n", __func__); BUG_ON(!TRANSPORT_EXIST(xbus)); if(unlikely(!xframe_enqueue(q, xframe))) { XBUS_ERR(xbus, "Failed returning xframe to %s\n", q->name); diff --git a/drivers/dahdi/xpp/xpp_dahdi.c b/drivers/dahdi/xpp/xpp_dahdi.c index efc112e..2d2cbd9 100644 --- a/drivers/dahdi/xpp/xpp_dahdi.c +++ b/drivers/dahdi/xpp/xpp_dahdi.c @@ -210,7 +210,7 @@ void xpd_free(xpd_t *xpd) /* * This must be last, so the xbus cannot be released before the xpd */ - put_xbus(__FUNCTION__, xbus); /* was taken in xpd_alloc() */ + put_xbus(__func__, xbus); /* was taken in xpd_alloc() */ } /* @@ -401,7 +401,7 @@ const char *xpd_statename(enum xpd_state st) bool xpd_setstate(xpd_t *xpd, enum xpd_state newstate) { BUG_ON(!xpd); - XPD_DBG(DEVICES, xpd, "%s: %s (%d) -> %s (%d)\n", __FUNCTION__, + XPD_DBG(DEVICES, xpd, "%s: %s (%d) -> %s (%d)\n", __func__, xpd_statename(xpd->xpd_state), xpd->xpd_state, xpd_statename(newstate), newstate); switch(newstate) { @@ -413,7 +413,7 @@ bool xpd_setstate(xpd_t *xpd, enum xpd_state newstate) if(xpd->addr.subunit != 0) { XPD_NOTICE(xpd, "%s: Moving to %s allowed only for subunit 0\n", - __FUNCTION__, xpd_statename(newstate)); + __func__, xpd_statename(newstate)); goto badstate; } break; @@ -430,13 +430,13 @@ bool xpd_setstate(xpd_t *xpd, enum xpd_state newstate) case XPD_STATE_NOHW: break; default: - XPD_ERR(xpd, "%s: Unknown newstate=%d\n", __FUNCTION__, newstate); + XPD_ERR(xpd, "%s: Unknown newstate=%d\n", __func__, newstate); } xpd->xpd_state = newstate; return 1; badstate: XPD_NOTICE(xpd, "%s: cannot transition: %s (%d) -> %s (%d)\n", - __FUNCTION__, + __func__, xpd_statename(xpd->xpd_state), xpd->xpd_state, xpd_statename(newstate), newstate); return 0; @@ -477,7 +477,7 @@ __must_check static int phonedev_init(xpd_t *xpd, const xproto_table_t *proto_ta atomic_set(&phonedev->open_counter, 0); for (x = 0; x < phonedev->channels; x++) { if (!(phonedev->chans[x] = KZALLOC(sizeof(*(phonedev->chans[x])), GFP_KERNEL))) { - ERR("%s: Unable to allocate channel %d\n", __FUNCTION__, x); + ERR("%s: Unable to allocate channel %d\n", __func__, x); goto err; } phonedev->ec[x] = KZALLOC(sizeof(*(phonedev->ec[x])), @@ -513,13 +513,13 @@ __must_check xpd_t *xpd_alloc(xbus_t *xbus, type, channels, alloc_size); if(channels > CHANNELS_PERXPD) { XBUS_ERR(xbus, "%s: type=%d: too many channels %d\n", - __FUNCTION__, type, channels); + __func__, type, channels); goto err; } if((xpd = KZALLOC(alloc_size, GFP_KERNEL)) == NULL) { XBUS_ERR(xbus, "%s: type=%d: Unable to allocate memory\n", - __FUNCTION__, type); + __func__, type); goto err; } xpd->priv = (byte *)xpd + sizeof(xpd_t); @@ -576,7 +576,7 @@ void update_xpd_status(xpd_t *xpd, int alarm_flag) struct dahdi_span *span = &PHONEDEV(xpd).span; if(!SPAN_REGISTERED(xpd)) { - // XPD_NOTICE(xpd, "%s: XPD is not registered. Skipping.\n", __FUNCTION__); + // XPD_NOTICE(xpd, "%s: XPD is not registered. Skipping.\n", __func__); return; } switch (alarm_flag) { @@ -749,7 +749,7 @@ int xpp_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned long arg) if(!xpd) { ERR("%s: channel in pos %d, was already closed. Ignore.\n", - __FUNCTION__, pos); + __func__, pos); return -ENODEV; } switch (cmd) { @@ -772,13 +772,13 @@ int xpp_hooksig(struct dahdi_chan *chan, enum dahdi_txsig txsig) if(!xpd) { ERR("%s: channel in pos %d, was already closed. Ignore.\n", - __FUNCTION__, pos); + __func__, pos); return -ENODEV; } if(!PHONE_METHOD(card_hooksig, xpd)) { LINE_ERR(xpd, pos, "%s: No hooksig method for this channel. Ignore.\n", - __FUNCTION__); + __func__); return -ENODEV; } xbus = xpd->xbus; @@ -863,7 +863,7 @@ static void echocan_free(struct dahdi_chan *chan, LINE_DBG(GENERAL, xpd, pos, "mode=0x%X\n", ec->status.mode); CALL_EC_METHOD(ec_set, xbus, xpd, pos, 0); CALL_EC_METHOD(ec_update, xbus, xbus); - put_xpd(__FUNCTION__, xpd); /* aquired in xpp_echocan_create() */ + put_xpd(__func__, xpd); /* aquired in xpp_echocan_create() */ } static const struct dahdi_echocan_features xpp_ec_features = { @@ -935,7 +935,7 @@ int xpp_echocan_create(struct dahdi_chan *chan, *ec = phonedev->ec[pos]; (*ec)->ops = &xpp_ec_ops; (*ec)->features = xpp_ec_features; - xpd = get_xpd(__FUNCTION__, xpd); /* Returned in echocan_free() */ + xpd = get_xpd(__func__, xpd); /* Returned in echocan_free() */ LINE_DBG(GENERAL, xpd, pos, "(tap=%d, param_count=%d)\n", ecp->tap_length, ecp->param_count); ret = CALL_EC_METHOD(ec_set, xbus, xpd, pos, 1); diff --git a/drivers/dahdi/xpp/xpp_usb.c b/drivers/dahdi/xpp/xpp_usb.c index c581078..7577901 100644 --- a/drivers/dahdi/xpp/xpp_usb.c +++ b/drivers/dahdi/xpp/xpp_usb.c @@ -57,7 +57,7 @@ static DEF_PARM(uint, drop_pcm_after, 6, 0644, "Number of consecutive tx_sluggis THIS_MODULE->name, (xusb)->index, xusb->path, xusb->serial, ## __VA_ARGS__) #define XUSB_DBG(bits, xusb, fmt, ...) \ - ((void)((debug & (DBG_ ## bits)) && XUSB_PRINTK(DEBUG, xusb, "%s: " fmt, __FUNCTION__, ## __VA_ARGS__))) + ((void)((debug & (DBG_ ## bits)) && XUSB_PRINTK(DEBUG, xusb, "%s: " fmt, __func__, ## __VA_ARGS__))) #define XUSB_ERR(xusb, fmt, ...) XUSB_PRINTK(ERR, xusb, fmt, ## __VA_ARGS__) #define XUSB_NOTICE(xusb, fmt, ...) XUSB_PRINTK(NOTICE, xusb, fmt, ## __VA_ARGS__) #define XUSB_INFO(xusb, fmt, ...) XUSB_PRINTK(INFO, xusb, fmt, ## __VA_ARGS__) @@ -399,7 +399,7 @@ static int do_send_xframe(xbus_t *xbus, xframe_t *xframe) if((rate_limit++ % 1000) == 0) XBUS_ERR(xbus, "%s: usb_submit_urb failed: %d\n", - __FUNCTION__, ret); + __func__, ret); ret = -EBADF; goto failure; } @@ -439,7 +439,7 @@ static int xframe_send_cmd(xbus_t *xbus, xframe_t *xframe) { BUG_ON(!xbus); BUG_ON(!xframe); - //XBUS_INFO(xbus, "%s:\n", __FUNCTION__); + //XBUS_INFO(xbus, "%s:\n", __func__); return do_send_xframe(xbus, xframe); } @@ -467,7 +467,7 @@ static bool xusb_listen(xusb_t *xusb) if((rate_limit++ % 1000) == 0) XBUS_ERR(xbus, "%s: usb_submit_urb failed: %d\n", - __FUNCTION__, ret); + __func__, ret); FREE_RECV_XFRAME(xbus, xframe); goto out; } diff --git a/drivers/dahdi/xpp/xproto.c b/drivers/dahdi/xpp/xproto.c index e07e3d1..a1bc337 100644 --- a/drivers/dahdi/xpp/xproto.c +++ b/drivers/dahdi/xpp/xproto.c @@ -86,7 +86,7 @@ const xproto_table_t *xproto_get(xpd_type_t cardtype) int ret = request_module(XPD_TYPE_PREFIX "%d", cardtype); if(ret != 0) { NOTICE("%s: Failed to load module for type=%d. exit status=%d.\n", - __FUNCTION__, cardtype, ret); + __func__, cardtype, ret); /* Drop through: we may be lucky... */ } xtable = xprotocol_tables[cardtype]; @@ -97,7 +97,7 @@ const xproto_table_t *xproto_get(xpd_type_t cardtype) DBG(GENERAL, "%s refcount was %d\n", xtable->name, module_refcount(xtable->owner)); #endif if(!try_module_get(xtable->owner)) { - ERR("%s: try_module_get for %s failed.\n", __FUNCTION__, xtable->name); + ERR("%s: try_module_get for %s failed.\n", __func__, xtable->name); return NULL; } } @@ -142,7 +142,7 @@ static int packet_process(xbus_t *xbus, xpacket_t *pack) if(!valid_xpd_addr(&XPACKET_ADDR(pack))) { if(printk_ratelimit()) { XBUS_NOTICE(xbus, "%s: from %d%d: bad address.\n", - __FUNCTION__, + __func__, XPACKET_ADDR_UNIT(pack), XPACKET_ADDR_SUBUNIT(pack)); dump_packet("packet_process -- bad address", pack, debug); } @@ -159,7 +159,7 @@ static int packet_process(xbus_t *xbus, xpacket_t *pack) if(!xpd) { if(printk_ratelimit()) { XBUS_NOTICE(xbus, "%s: from %d%d opcode=0x%02X: no such global command.\n", - __FUNCTION__, + __func__, XPACKET_ADDR_UNIT(pack), XPACKET_ADDR_SUBUNIT(pack), op); dump_packet("packet_process -- no such global command", pack, 1); } @@ -169,7 +169,7 @@ static int packet_process(xbus_t *xbus, xpacket_t *pack) if(!xtable) { if(printk_ratelimit()) XPD_ERR(xpd, "%s: no protocol table (type=%d)\n", - __FUNCTION__, + __func__, xpd->type); goto out; } @@ -177,7 +177,7 @@ static int packet_process(xbus_t *xbus, xpacket_t *pack) if(!xe) { if(printk_ratelimit()) { XPD_NOTICE(xpd, "%s: bad command (type=%d,opcode=0x%x)\n", - __FUNCTION__, + __func__, xpd->type, op); dump_packet("packet_process -- bad command", pack, 1); } @@ -189,7 +189,7 @@ static int packet_process(xbus_t *xbus, xpacket_t *pack) if(!table->packet_is_valid(pack)) { if(printk_ratelimit()) { ERR("xpp: %s: wrong size %d for opcode=0x%02X\n", - __FUNCTION__, XPACKET_LEN(pack), op); + __func__, XPACKET_LEN(pack), op); dump_packet("packet_process -- wrong size", pack, debug); } goto out; @@ -322,10 +322,10 @@ void dump_packet(const char *msg, const xpacket_t *packet, bool debug) if(i >= sizeof(xpacket_t)) { if(limiter < ERR_REPORT_LIMIT) { ERR("%s: length overflow i=%d > sizeof(xpacket_t)=%lu\n", - __FUNCTION__, i+1, (long)sizeof(xpacket_t)); + __func__, i+1, (long)sizeof(xpacket_t)); } else if(limiter == ERR_REPORT_LIMIT) { ERR("%s: error packet #%d... squelsh reports.\n", - __FUNCTION__, limiter); + __func__, limiter); } limiter++; break; @@ -349,7 +349,7 @@ void dump_reg_cmd(const char msg[], bool writing, xbus_t *xbus, if(regcmd->bytes > sizeof(*regcmd) - 1) { /* The size byte is not included */ PORT_NOTICE(xbus, unit, port, "%s: %s: Too long: regcmd->bytes = %d\n", - __FUNCTION__, msg, regcmd->bytes); + __func__, msg, regcmd->bytes); return; } if(regcmd->is_multibyte) { @@ -370,7 +370,7 @@ void dump_reg_cmd(const char msg[], bool writing, xbus_t *xbus, } if(regcmd->bytes != sizeof(*regcmd) - 1) { /* The size byte is not included */ PORT_NOTICE(xbus, unit, port, "%s: %s: Wrong size: regcmd->bytes = %d\n", - __FUNCTION__, msg, regcmd->bytes); + __func__, msg, regcmd->bytes); return; } snprintf(port_buf, MAX_PROC_WRITE, "%d%s", @@ -416,13 +416,13 @@ const char *xproto_name(xpd_type_t xpd_type) #define CHECK_XOP(xops, f) \ if(!(xops)->f) { \ - ERR("%s: missing xmethod %s [%s (%d)]\n", __FUNCTION__, #f, name, type); \ + ERR("%s: missing xmethod %s [%s (%d)]\n", __func__, #f, name, type); \ return -EINVAL; \ } #define CHECK_PHONEOP(phoneops, f) \ if(!(phoneops)->f) { \ - ERR("%s: missing phone method %s [%s (%d)]\n", __FUNCTION__, #f, name, type); \ + ERR("%s: missing phone method %s [%s (%d)]\n", __func__, #f, name, type); \ return -EINVAL; \ } @@ -437,12 +437,12 @@ int xproto_register(const xproto_table_t *proto_table) type = proto_table->type; name = proto_table->name; if(type >= XPD_TYPE_NOMODULE) { - NOTICE("%s: Bad xproto type %d\n", __FUNCTION__, type); + NOTICE("%s: Bad xproto type %d\n", __func__, type); return -EINVAL; } DBG(GENERAL, "%s (%d)\n", name, type); if(xprotocol_tables[type]) - NOTICE("%s: overriding registration of %s (%d)\n", __FUNCTION__, name, type); + NOTICE("%s: overriding registration of %s (%d)\n", __func__, name, type); xops = proto_table->xops; CHECK_XOP(xops, card_new); CHECK_XOP(xops, card_init); @@ -477,11 +477,11 @@ void xproto_unregister(const xproto_table_t *proto_table) name = proto_table->name; DBG(GENERAL, "%s (%d)\n", name, type); if(type >= XPD_TYPE_NOMODULE) { - NOTICE("%s: Bad xproto type %s (%d)\n", __FUNCTION__, name, type); + NOTICE("%s: Bad xproto type %s (%d)\n", __func__, name, type); return; } if(!xprotocol_tables[type]) - NOTICE("%s: xproto type %s (%d) is already unregistered\n", __FUNCTION__, name, type); + NOTICE("%s: xproto type %s (%d) is already unregistered\n", __func__, name, type); xprotocol_tables[type] = NULL; }