Commit 6c91023d authored by Joe Perches's avatar Joe Perches Committed by David S. Miller

irda: Remove IRDA_<TYPE> logging macros

And use the more common mechanisms directly.

Other miscellanea:

o Coalesce formats
o Add missing newlines
o Realign arguments
o Remove unnecessary OOM message logging as
  there's a generic stack dump already on OOM.
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 09626e9d
...@@ -240,7 +240,8 @@ static int act200l_reset(struct sir_dev *dev) ...@@ -240,7 +240,8 @@ static int act200l_reset(struct sir_dev *dev)
dev->speed = 9600; dev->speed = 9600;
break; break;
default: default:
IRDA_ERROR("%s(), unknown state %d\n", __func__, state); net_err_ratelimited("%s(), unknown state %d\n",
__func__, state);
ret = -1; ret = -1;
break; break;
} }
......
...@@ -158,8 +158,8 @@ static int __init ali_ircc_init(void) ...@@ -158,8 +158,8 @@ static int __init ali_ircc_init(void)
ret = platform_driver_register(&ali_ircc_driver); ret = platform_driver_register(&ali_ircc_driver);
if (ret) { if (ret) {
IRDA_ERROR("%s, Can't register driver!\n", net_err_ratelimited("%s, Can't register driver!\n",
ALI_IRCC_DRIVER_NAME); ALI_IRCC_DRIVER_NAME);
return ret; return ret;
} }
...@@ -292,8 +292,8 @@ static int ali_ircc_open(int i, chipio_t *info) ...@@ -292,8 +292,8 @@ static int ali_ircc_open(int i, chipio_t *info)
IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __func__); IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __func__);
if (i >= ARRAY_SIZE(dev_self)) { if (i >= ARRAY_SIZE(dev_self)) {
IRDA_ERROR("%s(), maximum number of supported chips reached!\n", net_err_ratelimited("%s(), maximum number of supported chips reached!\n",
__func__); __func__);
return -ENOMEM; return -ENOMEM;
} }
...@@ -303,8 +303,8 @@ static int ali_ircc_open(int i, chipio_t *info) ...@@ -303,8 +303,8 @@ static int ali_ircc_open(int i, chipio_t *info)
dev = alloc_irdadev(sizeof(*self)); dev = alloc_irdadev(sizeof(*self));
if (dev == NULL) { if (dev == NULL) {
IRDA_ERROR("%s(), can't allocate memory for control block!\n", net_err_ratelimited("%s(), can't allocate memory for control block!\n",
__func__); __func__);
return -ENOMEM; return -ENOMEM;
} }
...@@ -328,8 +328,8 @@ static int ali_ircc_open(int i, chipio_t *info) ...@@ -328,8 +328,8 @@ static int ali_ircc_open(int i, chipio_t *info)
/* Reserve the ioports that we need */ /* Reserve the ioports that we need */
if (!request_region(self->io.fir_base, self->io.fir_ext, if (!request_region(self->io.fir_base, self->io.fir_ext,
ALI_IRCC_DRIVER_NAME)) { ALI_IRCC_DRIVER_NAME)) {
IRDA_WARNING("%s(), can't get iobase of 0x%03x\n", __func__, net_warn_ratelimited("%s(), can't get iobase of 0x%03x\n",
self->io.fir_base); __func__, self->io.fir_base);
err = -ENODEV; err = -ENODEV;
goto err_out1; goto err_out1;
} }
...@@ -380,15 +380,17 @@ static int ali_ircc_open(int i, chipio_t *info) ...@@ -380,15 +380,17 @@ static int ali_ircc_open(int i, chipio_t *info)
err = register_netdev(dev); err = register_netdev(dev);
if (err) { if (err) {
IRDA_ERROR("%s(), register_netdev() failed!\n", __func__); net_err_ratelimited("%s(), register_netdev() failed!\n",
__func__);
goto err_out4; goto err_out4;
} }
IRDA_MESSAGE("IrDA: Registered device %s\n", dev->name); net_info_ratelimited("IrDA: Registered device %s\n", dev->name);
/* Check dongle id */ /* Check dongle id */
dongle_id = ali_ircc_read_dongle_id(i, info); dongle_id = ali_ircc_read_dongle_id(i, info);
IRDA_MESSAGE("%s(), %s, Found dongle: %s\n", __func__, net_info_ratelimited("%s(), %s, Found dongle: %s\n",
ALI_IRCC_DRIVER_NAME, dongle_types[dongle_id]); __func__, ALI_IRCC_DRIVER_NAME,
dongle_types[dongle_id]);
self->io.dongle_id = dongle_id; self->io.dongle_id = dongle_id;
...@@ -521,7 +523,8 @@ static int ali_ircc_probe_53(ali_chip_t *chip, chipio_t *info) ...@@ -521,7 +523,8 @@ static int ali_ircc_probe_53(ali_chip_t *chip, chipio_t *info)
info->dma = reg & 0x07; info->dma = reg & 0x07;
if(info->dma == 0x04) if(info->dma == 0x04)
IRDA_WARNING("%s(), No DMA channel assigned !\n", __func__); net_warn_ratelimited("%s(), No DMA channel assigned !\n",
__func__);
else else
IRDA_DEBUG(2, "%s(), probing dma=%d\n", __func__, info->dma); IRDA_DEBUG(2, "%s(), probing dma=%d\n", __func__, info->dma);
...@@ -578,8 +581,8 @@ static int ali_ircc_setup(chipio_t *info) ...@@ -578,8 +581,8 @@ static int ali_ircc_setup(chipio_t *info)
/* Should be 0x00 in the M1535/M1535D */ /* Should be 0x00 in the M1535/M1535D */
if(version != 0x00) if(version != 0x00)
{ {
IRDA_ERROR("%s, Wrong chip version %02x\n", net_err_ratelimited("%s, Wrong chip version %02x\n",
ALI_IRCC_DRIVER_NAME, version); ALI_IRCC_DRIVER_NAME, version);
return -1; return -1;
} }
...@@ -612,8 +615,8 @@ static int ali_ircc_setup(chipio_t *info) ...@@ -612,8 +615,8 @@ static int ali_ircc_setup(chipio_t *info)
/* Switch to SIR space */ /* Switch to SIR space */
FIR2SIR(iobase); FIR2SIR(iobase);
IRDA_MESSAGE("%s, driver loaded (Benjamin Kong)\n", net_info_ratelimited("%s, driver loaded (Benjamin Kong)\n",
ALI_IRCC_DRIVER_NAME); ALI_IRCC_DRIVER_NAME);
/* Enable receive interrupts */ /* Enable receive interrupts */
// outb(UART_IER_RDI, iobase+UART_IER); //benjamin 2000/11/23 01:25PM // outb(UART_IER_RDI, iobase+UART_IER); //benjamin 2000/11/23 01:25PM
...@@ -1352,9 +1355,8 @@ static int ali_ircc_net_open(struct net_device *dev) ...@@ -1352,9 +1355,8 @@ static int ali_ircc_net_open(struct net_device *dev)
/* Request IRQ and install Interrupt Handler */ /* Request IRQ and install Interrupt Handler */
if (request_irq(self->io.irq, ali_ircc_interrupt, 0, dev->name, dev)) if (request_irq(self->io.irq, ali_ircc_interrupt, 0, dev->name, dev))
{ {
IRDA_WARNING("%s, unable to allocate irq=%d\n", net_warn_ratelimited("%s, unable to allocate irq=%d\n",
ALI_IRCC_DRIVER_NAME, ALI_IRCC_DRIVER_NAME, self->io.irq);
self->io.irq);
return -EAGAIN; return -EAGAIN;
} }
...@@ -1363,9 +1365,8 @@ static int ali_ircc_net_open(struct net_device *dev) ...@@ -1363,9 +1365,8 @@ static int ali_ircc_net_open(struct net_device *dev)
* failure. * failure.
*/ */
if (request_dma(self->io.dma, dev->name)) { if (request_dma(self->io.dma, dev->name)) {
IRDA_WARNING("%s, unable to allocate dma=%d\n", net_warn_ratelimited("%s, unable to allocate dma=%d\n",
ALI_IRCC_DRIVER_NAME, ALI_IRCC_DRIVER_NAME, self->io.dma);
self->io.dma);
free_irq(self->io.irq, dev); free_irq(self->io.irq, dev);
return -EAGAIN; return -EAGAIN;
} }
...@@ -1671,7 +1672,8 @@ static int ali_ircc_dma_xmit_complete(struct ali_ircc_cb *self) ...@@ -1671,7 +1672,8 @@ static int ali_ircc_dma_xmit_complete(struct ali_ircc_cb *self)
if((inb(iobase+FIR_LSR) & LSR_FRAME_ABORT) == LSR_FRAME_ABORT) if((inb(iobase+FIR_LSR) & LSR_FRAME_ABORT) == LSR_FRAME_ABORT)
{ {
IRDA_ERROR("%s(), ********* LSR_FRAME_ABORT *********\n", __func__); net_err_ratelimited("%s(), ********* LSR_FRAME_ABORT *********\n",
__func__);
self->netdev->stats.tx_errors++; self->netdev->stats.tx_errors++;
self->netdev->stats.tx_fifo_errors++; self->netdev->stats.tx_fifo_errors++;
} }
...@@ -1918,9 +1920,6 @@ static int ali_ircc_dma_receive_complete(struct ali_ircc_cb *self) ...@@ -1918,9 +1920,6 @@ static int ali_ircc_dma_receive_complete(struct ali_ircc_cb *self)
skb = dev_alloc_skb(len+1); skb = dev_alloc_skb(len+1);
if (skb == NULL) if (skb == NULL)
{ {
IRDA_WARNING("%s(), memory squeeze, "
"dropping frame.\n",
__func__);
self->netdev->stats.rx_dropped++; self->netdev->stats.rx_dropped++;
return FALSE; return FALSE;
...@@ -2127,7 +2126,7 @@ static int ali_ircc_suspend(struct platform_device *dev, pm_message_t state) ...@@ -2127,7 +2126,7 @@ static int ali_ircc_suspend(struct platform_device *dev, pm_message_t state)
{ {
struct ali_ircc_cb *self = platform_get_drvdata(dev); struct ali_ircc_cb *self = platform_get_drvdata(dev);
IRDA_MESSAGE("%s, Suspending\n", ALI_IRCC_DRIVER_NAME); net_info_ratelimited("%s, Suspending\n", ALI_IRCC_DRIVER_NAME);
if (self->io.suspended) if (self->io.suspended)
return 0; return 0;
...@@ -2148,7 +2147,7 @@ static int ali_ircc_resume(struct platform_device *dev) ...@@ -2148,7 +2147,7 @@ static int ali_ircc_resume(struct platform_device *dev)
ali_ircc_net_open(self->netdev); ali_ircc_net_open(self->netdev);
IRDA_MESSAGE("%s, Waking up\n", ALI_IRCC_DRIVER_NAME); net_info_ratelimited("%s, Waking up\n", ALI_IRCC_DRIVER_NAME);
self->io.suspended = 0; self->io.suspended = 0;
......
...@@ -179,7 +179,8 @@ static int girbil_change_speed(struct sir_dev *dev, unsigned speed) ...@@ -179,7 +179,8 @@ static int girbil_change_speed(struct sir_dev *dev, unsigned speed)
break; break;
default: default:
IRDA_ERROR("%s - undefined state %d\n", __func__, state); net_err_ratelimited("%s - undefined state %d\n",
__func__, state);
ret = -EINVAL; ret = -EINVAL;
break; break;
} }
...@@ -241,7 +242,8 @@ static int girbil_reset(struct sir_dev *dev) ...@@ -241,7 +242,8 @@ static int girbil_reset(struct sir_dev *dev)
break; break;
default: default:
IRDA_ERROR("%s(), undefined state %d\n", __func__, state); net_err_ratelimited("%s(), undefined state %d\n",
__func__, state);
ret = -1; ret = -1;
break; break;
} }
......
...@@ -307,7 +307,7 @@ static void irda_usb_change_speed_xbofs(struct irda_usb_cb *self) ...@@ -307,7 +307,7 @@ static void irda_usb_change_speed_xbofs(struct irda_usb_cb *self)
/* Grab the speed URB */ /* Grab the speed URB */
urb = self->speed_urb; urb = self->speed_urb;
if (urb->status != 0) { if (urb->status != 0) {
IRDA_WARNING("%s(), URB still in use!\n", __func__); net_warn_ratelimited("%s(), URB still in use!\n", __func__);
return; return;
} }
...@@ -333,7 +333,7 @@ static void irda_usb_change_speed_xbofs(struct irda_usb_cb *self) ...@@ -333,7 +333,7 @@ static void irda_usb_change_speed_xbofs(struct irda_usb_cb *self)
/* Irq disabled -> GFP_ATOMIC */ /* Irq disabled -> GFP_ATOMIC */
if ((ret = usb_submit_urb(urb, GFP_ATOMIC))) { if ((ret = usb_submit_urb(urb, GFP_ATOMIC))) {
IRDA_WARNING("%s(), failed Speed URB\n", __func__); net_warn_ratelimited("%s(), failed Speed URB\n", __func__);
} }
} }
...@@ -435,7 +435,7 @@ static netdev_tx_t irda_usb_hard_xmit(struct sk_buff *skb, ...@@ -435,7 +435,7 @@ static netdev_tx_t irda_usb_hard_xmit(struct sk_buff *skb,
} }
if (urb->status != 0) { if (urb->status != 0) {
IRDA_WARNING("%s(), URB still in use!\n", __func__); net_warn_ratelimited("%s(), URB still in use!\n", __func__);
goto drop; goto drop;
} }
...@@ -522,7 +522,7 @@ static netdev_tx_t irda_usb_hard_xmit(struct sk_buff *skb, ...@@ -522,7 +522,7 @@ static netdev_tx_t irda_usb_hard_xmit(struct sk_buff *skb,
/* Ask USB to send the packet - Irq disabled -> GFP_ATOMIC */ /* Ask USB to send the packet - Irq disabled -> GFP_ATOMIC */
if ((res = usb_submit_urb(urb, GFP_ATOMIC))) { if ((res = usb_submit_urb(urb, GFP_ATOMIC))) {
IRDA_WARNING("%s(), failed Tx URB\n", __func__); net_warn_ratelimited("%s(), failed Tx URB\n", __func__);
netdev->stats.tx_errors++; netdev->stats.tx_errors++;
/* Let USB recover : We will catch that in the watchdog */ /* Let USB recover : We will catch that in the watchdog */
/*netif_start_queue(netdev);*/ /*netif_start_queue(netdev);*/
...@@ -638,7 +638,7 @@ static void irda_usb_net_timeout(struct net_device *netdev) ...@@ -638,7 +638,7 @@ static void irda_usb_net_timeout(struct net_device *netdev)
/* self->present *MUST* be read under spinlock */ /* self->present *MUST* be read under spinlock */
if (!self->present) { if (!self->present) {
IRDA_WARNING("%s(), device not present!\n", __func__); net_warn_ratelimited("%s(), device not present!\n", __func__);
netif_stop_queue(netdev); netif_stop_queue(netdev);
spin_unlock_irqrestore(&self->lock, flags); spin_unlock_irqrestore(&self->lock, flags);
return; return;
...@@ -783,8 +783,8 @@ static void irda_usb_submit(struct irda_usb_cb *self, struct sk_buff *skb, struc ...@@ -783,8 +783,8 @@ static void irda_usb_submit(struct irda_usb_cb *self, struct sk_buff *skb, struc
if (ret) { if (ret) {
/* If this ever happen, we are in deep s***. /* If this ever happen, we are in deep s***.
* Basically, the Rx path will stop... */ * Basically, the Rx path will stop... */
IRDA_WARNING("%s(), Failed to submit Rx URB %d\n", net_warn_ratelimited("%s(), Failed to submit Rx URB %d\n",
__func__, ret); __func__, ret);
} }
} }
...@@ -859,7 +859,7 @@ static void irda_usb_receive(struct urb *urb) ...@@ -859,7 +859,7 @@ static void irda_usb_receive(struct urb *urb)
/* Check for empty frames */ /* Check for empty frames */
if (urb->actual_length <= self->header_length) { if (urb->actual_length <= self->header_length) {
IRDA_WARNING("%s(), empty frame!\n", __func__); net_warn_ratelimited("%s(), empty frame!\n", __func__);
goto done; goto done;
} }
...@@ -1088,8 +1088,8 @@ static int stir421x_patch_device(struct irda_usb_cb *self) ...@@ -1088,8 +1088,8 @@ static int stir421x_patch_device(struct irda_usb_cb *self)
return ret; return ret;
/* We get a patch from userspace */ /* We get a patch from userspace */
IRDA_MESSAGE("%s(): Received firmware %s (%zu bytes)\n", net_info_ratelimited("%s(): Received firmware %s (%zu bytes)\n",
__func__, stir421x_fw_name, fw->size); __func__, stir421x_fw_name, fw->size);
ret = -EINVAL; ret = -EINVAL;
...@@ -1179,13 +1179,13 @@ static int irda_usb_net_open(struct net_device *netdev) ...@@ -1179,13 +1179,13 @@ static int irda_usb_net_open(struct net_device *netdev)
/* Can only open the device if it's there */ /* Can only open the device if it's there */
if(!self->present) { if(!self->present) {
spin_unlock_irqrestore(&self->lock, flags); spin_unlock_irqrestore(&self->lock, flags);
IRDA_WARNING("%s(), device not present!\n", __func__); net_warn_ratelimited("%s(), device not present!\n", __func__);
return -1; return -1;
} }
if(self->needspatch) { if(self->needspatch) {
spin_unlock_irqrestore(&self->lock, flags); spin_unlock_irqrestore(&self->lock, flags);
IRDA_WARNING("%s(), device needs patch\n", __func__) ; net_warn_ratelimited("%s(), device needs patch\n", __func__);
return -EIO ; return -EIO ;
} }
...@@ -1227,8 +1227,6 @@ static int irda_usb_net_open(struct net_device *netdev) ...@@ -1227,8 +1227,6 @@ static int irda_usb_net_open(struct net_device *netdev)
if (!skb) { if (!skb) {
/* If this ever happen, we are in deep s***. /* If this ever happen, we are in deep s***.
* Basically, we can't start the Rx path... */ * Basically, we can't start the Rx path... */
IRDA_WARNING("%s(), Failed to allocate Rx skb\n",
__func__);
return -1; return -1;
} }
//skb_reserve(newskb, USB_IRDA_HEADER - 1); //skb_reserve(newskb, USB_IRDA_HEADER - 1);
...@@ -1505,7 +1503,8 @@ static inline int irda_usb_parse_endpoints(struct irda_usb_cb *self, struct usb_ ...@@ -1505,7 +1503,8 @@ static inline int irda_usb_parse_endpoints(struct irda_usb_cb *self, struct usb_
/* This is our interrupt endpoint */ /* This is our interrupt endpoint */
self->bulk_int_ep = ep; self->bulk_int_ep = ep;
} else { } else {
IRDA_ERROR("%s(), Unrecognised endpoint %02X.\n", __func__, ep); net_err_ratelimited("%s(), Unrecognised endpoint %02X\n",
__func__, ep);
} }
} }
} }
...@@ -1575,11 +1574,11 @@ static inline struct irda_class_desc *irda_usb_find_class_desc(struct usb_interf ...@@ -1575,11 +1574,11 @@ static inline struct irda_class_desc *irda_usb_find_class_desc(struct usb_interf
IRDA_DEBUG(1, "%s(), ret=%d\n", __func__, ret); IRDA_DEBUG(1, "%s(), ret=%d\n", __func__, ret);
if (ret < sizeof(*desc)) { if (ret < sizeof(*desc)) {
IRDA_WARNING("usb-irda: class_descriptor read %s (%d)\n", net_warn_ratelimited("usb-irda: class_descriptor read %s (%d)\n",
(ret<0) ? "failed" : "too short", ret); ret < 0 ? "failed" : "too short", ret);
} }
else if (desc->bDescriptorType != USB_DT_IRDA) { else if (desc->bDescriptorType != USB_DT_IRDA) {
IRDA_WARNING("usb-irda: bad class_descriptor type\n"); net_warn_ratelimited("usb-irda: bad class_descriptor type\n");
} }
else { else {
#ifdef IU_DUMP_CLASS_DESC #ifdef IU_DUMP_CLASS_DESC
...@@ -1622,9 +1621,9 @@ static int irda_usb_probe(struct usb_interface *intf, ...@@ -1622,9 +1621,9 @@ static int irda_usb_probe(struct usb_interface *intf,
* don't need to check if the dongle is really ours. * don't need to check if the dongle is really ours.
* Jean II */ * Jean II */
IRDA_MESSAGE("IRDA-USB found at address %d, Vendor: %x, Product: %x\n", net_info_ratelimited("IRDA-USB found at address %d, Vendor: %x, Product: %x\n",
dev->devnum, le16_to_cpu(dev->descriptor.idVendor), dev->devnum, le16_to_cpu(dev->descriptor.idVendor),
le16_to_cpu(dev->descriptor.idProduct)); le16_to_cpu(dev->descriptor.idProduct));
net = alloc_irdadev(sizeof(*self)); net = alloc_irdadev(sizeof(*self));
if (!net) if (!net)
...@@ -1700,7 +1699,7 @@ static int irda_usb_probe(struct usb_interface *intf, ...@@ -1700,7 +1699,7 @@ static int irda_usb_probe(struct usb_interface *intf,
interface = intf->cur_altsetting; interface = intf->cur_altsetting;
if(!irda_usb_parse_endpoints(self, interface->endpoint, if(!irda_usb_parse_endpoints(self, interface->endpoint,
interface->desc.bNumEndpoints)) { interface->desc.bNumEndpoints)) {
IRDA_ERROR("%s(), Bogus endpoints...\n", __func__); net_err_ratelimited("%s(), Bogus endpoints...\n", __func__);
ret = -EIO; ret = -EIO;
goto err_out_3; goto err_out_3;
} }
...@@ -1746,7 +1745,7 @@ static int irda_usb_probe(struct usb_interface *intf, ...@@ -1746,7 +1745,7 @@ static int irda_usb_probe(struct usb_interface *intf,
if (ret) if (ret)
goto err_out_5; goto err_out_5;
IRDA_MESSAGE("IrDA: Registered device %s\n", net->name); net_info_ratelimited("IrDA: Registered device %s\n", net->name);
usb_set_intfdata(intf, self); usb_set_intfdata(intf, self);
if (self->needspatch) { if (self->needspatch) {
...@@ -1754,7 +1753,7 @@ static int irda_usb_probe(struct usb_interface *intf, ...@@ -1754,7 +1753,7 @@ static int irda_usb_probe(struct usb_interface *intf,
ret = stir421x_patch_device(self); ret = stir421x_patch_device(self);
self->needspatch = (ret < 0); self->needspatch = (ret < 0);
if (self->needspatch) { if (self->needspatch) {
IRDA_ERROR("STIR421X: Couldn't upload patch\n"); net_err_ratelimited("STIR421X: Couldn't upload patch\n");
goto err_out_6; goto err_out_6;
} }
......
...@@ -231,7 +231,7 @@ static void irtty_receive_buf(struct tty_struct *tty, const unsigned char *cp, ...@@ -231,7 +231,7 @@ static void irtty_receive_buf(struct tty_struct *tty, const unsigned char *cp,
dev = priv->dev; dev = priv->dev;
if (!dev) { if (!dev) {
IRDA_WARNING("%s(), not ready yet!\n", __func__); net_warn_ratelimited("%s(), not ready yet!\n", __func__);
return; return;
} }
...@@ -555,8 +555,8 @@ static int __init irtty_sir_init(void) ...@@ -555,8 +555,8 @@ static int __init irtty_sir_init(void)
int err; int err;
if ((err = tty_register_ldisc(N_IRDA, &irda_ldisc)) != 0) if ((err = tty_register_ldisc(N_IRDA, &irda_ldisc)) != 0)
IRDA_ERROR("IrDA: can't register line discipline (err = %d)\n", net_err_ratelimited("IrDA: can't register line discipline (err = %d)\n",
err); err);
return err; return err;
} }
...@@ -565,8 +565,8 @@ static void __exit irtty_sir_cleanup(void) ...@@ -565,8 +565,8 @@ static void __exit irtty_sir_cleanup(void)
int err; int err;
if ((err = tty_unregister_ldisc(N_IRDA))) { if ((err = tty_unregister_ldisc(N_IRDA))) {
IRDA_ERROR("%s(), can't unregister line discipline (err = %d)\n", net_err_ratelimited("%s(), can't unregister line discipline (err = %d)\n",
__func__, err); __func__, err);
} }
} }
......
...@@ -198,9 +198,9 @@ static int ma600_change_speed(struct sir_dev *dev, unsigned speed) ...@@ -198,9 +198,9 @@ static int ma600_change_speed(struct sir_dev *dev, unsigned speed)
sirdev_raw_read(dev, &byte, sizeof(byte)); sirdev_raw_read(dev, &byte, sizeof(byte));
if (byte != get_control_byte(speed)) { if (byte != get_control_byte(speed)) {
IRDA_WARNING("%s(): bad control byte read-back %02x != %02x\n", net_warn_ratelimited("%s(): bad control byte read-back %02x != %02x\n",
__func__, (unsigned) byte, __func__, (unsigned)byte,
(unsigned) get_control_byte(speed)); (unsigned)get_control_byte(speed));
return -1; return -1;
} }
else else
......
...@@ -155,7 +155,8 @@ static int mcp2120_change_speed(struct sir_dev *dev, unsigned speed) ...@@ -155,7 +155,8 @@ static int mcp2120_change_speed(struct sir_dev *dev, unsigned speed)
break; break;
default: default:
IRDA_ERROR("%s(), undefine state %d\n", __func__, state); net_err_ratelimited("%s(), undefine state %d\n",
__func__, state);
ret = -EINVAL; ret = -EINVAL;
break; break;
} }
...@@ -213,7 +214,8 @@ static int mcp2120_reset(struct sir_dev *dev) ...@@ -213,7 +214,8 @@ static int mcp2120_reset(struct sir_dev *dev)
break; break;
default: default:
IRDA_ERROR("%s(), undefined state %d\n", __func__, state); net_err_ratelimited("%s(), undefined state %d\n",
__func__, state);
ret = -EINVAL; ret = -EINVAL;
break; break;
} }
......
...@@ -197,14 +197,14 @@ static inline int mcs_setup_transceiver_vishay(struct mcs_cb *mcs) ...@@ -197,14 +197,14 @@ static inline int mcs_setup_transceiver_vishay(struct mcs_cb *mcs)
/* Setup a communication between mcs7780 and agilent chip. */ /* Setup a communication between mcs7780 and agilent chip. */
static inline int mcs_setup_transceiver_agilent(struct mcs_cb *mcs) static inline int mcs_setup_transceiver_agilent(struct mcs_cb *mcs)
{ {
IRDA_WARNING("This transceiver type is not supported yet.\n"); net_warn_ratelimited("This transceiver type is not supported yet\n");
return 1; return 1;
} }
/* Setup a communication between mcs7780 and sharp chip. */ /* Setup a communication between mcs7780 and sharp chip. */
static inline int mcs_setup_transceiver_sharp(struct mcs_cb *mcs) static inline int mcs_setup_transceiver_sharp(struct mcs_cb *mcs)
{ {
IRDA_WARNING("This transceiver type is not supported yet.\n"); net_warn_ratelimited("This transceiver type is not supported yet\n");
return 1; return 1;
} }
...@@ -213,9 +213,9 @@ static inline int mcs_setup_transceiver(struct mcs_cb *mcs) ...@@ -213,9 +213,9 @@ static inline int mcs_setup_transceiver(struct mcs_cb *mcs)
{ {
int ret = 0; int ret = 0;
__u16 rval; __u16 rval;
char *msg; const char *msg;
msg = "Basic transceiver setup error."; msg = "Basic transceiver setup error";
/* read value of MODE Register, set the DRIVER and RESET bits /* read value of MODE Register, set the DRIVER and RESET bits
* and write value back out to MODE Register * and write value back out to MODE Register
...@@ -261,7 +261,7 @@ static inline int mcs_setup_transceiver(struct mcs_cb *mcs) ...@@ -261,7 +261,7 @@ static inline int mcs_setup_transceiver(struct mcs_cb *mcs)
if(unlikely(ret)) if(unlikely(ret))
goto error; goto error;
msg = "transceiver model specific setup error."; msg = "transceiver model specific setup error";
switch (mcs->transceiver_type) { switch (mcs->transceiver_type) {
case MCS_TSC_VISHAY: case MCS_TSC_VISHAY:
ret = mcs_setup_transceiver_vishay(mcs); ret = mcs_setup_transceiver_vishay(mcs);
...@@ -276,8 +276,8 @@ static inline int mcs_setup_transceiver(struct mcs_cb *mcs) ...@@ -276,8 +276,8 @@ static inline int mcs_setup_transceiver(struct mcs_cb *mcs)
break; break;
default: default:
IRDA_WARNING("Unknown transceiver type: %d\n", net_warn_ratelimited("Unknown transceiver type: %d\n",
mcs->transceiver_type); mcs->transceiver_type);
ret = 1; ret = 1;
} }
if (unlikely(ret)) if (unlikely(ret))
...@@ -300,7 +300,7 @@ static inline int mcs_setup_transceiver(struct mcs_cb *mcs) ...@@ -300,7 +300,7 @@ static inline int mcs_setup_transceiver(struct mcs_cb *mcs)
goto error; goto error;
} }
msg = "transceiver reset."; msg = "transceiver reset";
ret = mcs_get_reg(mcs, MCS_MODE_REG, &rval); ret = mcs_get_reg(mcs, MCS_MODE_REG, &rval);
if (unlikely(ret != 2)) if (unlikely(ret != 2))
...@@ -315,7 +315,7 @@ static inline int mcs_setup_transceiver(struct mcs_cb *mcs) ...@@ -315,7 +315,7 @@ static inline int mcs_setup_transceiver(struct mcs_cb *mcs)
return ret; return ret;
error: error:
IRDA_ERROR("%s\n", msg); net_err_ratelimited("%s\n", msg);
return ret; return ret;
} }
...@@ -399,8 +399,8 @@ static void mcs_unwrap_mir(struct mcs_cb *mcs, __u8 *buf, int len) ...@@ -399,8 +399,8 @@ static void mcs_unwrap_mir(struct mcs_cb *mcs, __u8 *buf, int len)
new_len = len - 2; new_len = len - 2;
if(unlikely(new_len <= 0)) { if(unlikely(new_len <= 0)) {
IRDA_ERROR("%s short frame length %d\n", net_err_ratelimited("%s short frame length %d\n",
mcs->netdev->name, new_len); mcs->netdev->name, new_len);
++mcs->netdev->stats.rx_errors; ++mcs->netdev->stats.rx_errors;
++mcs->netdev->stats.rx_length_errors; ++mcs->netdev->stats.rx_length_errors;
return; return;
...@@ -409,8 +409,8 @@ static void mcs_unwrap_mir(struct mcs_cb *mcs, __u8 *buf, int len) ...@@ -409,8 +409,8 @@ static void mcs_unwrap_mir(struct mcs_cb *mcs, __u8 *buf, int len)
fcs = irda_calc_crc16(~fcs, buf, len); fcs = irda_calc_crc16(~fcs, buf, len);
if(fcs != GOOD_FCS) { if(fcs != GOOD_FCS) {
IRDA_ERROR("crc error calc 0x%x len %d\n", net_err_ratelimited("crc error calc 0x%x len %d\n",
fcs, new_len); fcs, new_len);
mcs->netdev->stats.rx_errors++; mcs->netdev->stats.rx_errors++;
mcs->netdev->stats.rx_crc_errors++; mcs->netdev->stats.rx_crc_errors++;
return; return;
...@@ -452,8 +452,8 @@ static void mcs_unwrap_fir(struct mcs_cb *mcs, __u8 *buf, int len) ...@@ -452,8 +452,8 @@ static void mcs_unwrap_fir(struct mcs_cb *mcs, __u8 *buf, int len)
new_len = len - 4; new_len = len - 4;
if(unlikely(new_len <= 0)) { if(unlikely(new_len <= 0)) {
IRDA_ERROR("%s short frame length %d\n", net_err_ratelimited("%s short frame length %d\n",
mcs->netdev->name, new_len); mcs->netdev->name, new_len);
++mcs->netdev->stats.rx_errors; ++mcs->netdev->stats.rx_errors;
++mcs->netdev->stats.rx_length_errors; ++mcs->netdev->stats.rx_length_errors;
return; return;
...@@ -461,7 +461,8 @@ static void mcs_unwrap_fir(struct mcs_cb *mcs, __u8 *buf, int len) ...@@ -461,7 +461,8 @@ static void mcs_unwrap_fir(struct mcs_cb *mcs, __u8 *buf, int len)
fcs = ~(crc32_le(~0, buf, new_len)); fcs = ~(crc32_le(~0, buf, new_len));
if(fcs != get_unaligned_le32(buf + new_len)) { if(fcs != get_unaligned_le32(buf + new_len)) {
IRDA_ERROR("crc error calc 0x%x len %d\n", fcs, new_len); net_err_ratelimited("crc error calc 0x%x len %d\n",
fcs, new_len);
mcs->netdev->stats.rx_errors++; mcs->netdev->stats.rx_errors++;
mcs->netdev->stats.rx_crc_errors++; mcs->netdev->stats.rx_crc_errors++;
return; return;
...@@ -583,7 +584,7 @@ static int mcs_speed_change(struct mcs_cb *mcs) ...@@ -583,7 +584,7 @@ static int mcs_speed_change(struct mcs_cb *mcs)
} while(cnt++ < 100 && (rval & MCS_IRINTX)); } while(cnt++ < 100 && (rval & MCS_IRINTX));
if (cnt > 100) { if (cnt > 100) {
IRDA_ERROR("unable to change speed\n"); net_err_ratelimited("unable to change speed\n");
ret = -EIO; ret = -EIO;
goto error; goto error;
} }
...@@ -634,8 +635,8 @@ static int mcs_speed_change(struct mcs_cb *mcs) ...@@ -634,8 +635,8 @@ static int mcs_speed_change(struct mcs_cb *mcs)
default: default:
ret = 1; ret = 1;
IRDA_WARNING("Unknown transceiver type: %d\n", net_warn_ratelimited("Unknown transceiver type: %d\n",
mcs->transceiver_type); mcs->transceiver_type);
} }
if (unlikely(ret)) if (unlikely(ret))
goto error; goto error;
...@@ -731,7 +732,7 @@ static int mcs_net_open(struct net_device *netdev) ...@@ -731,7 +732,7 @@ static int mcs_net_open(struct net_device *netdev)
sprintf(hwname, "usb#%d", mcs->usbdev->devnum); sprintf(hwname, "usb#%d", mcs->usbdev->devnum);
mcs->irlap = irlap_open(netdev, &mcs->qos, hwname); mcs->irlap = irlap_open(netdev, &mcs->qos, hwname);
if (!mcs->irlap) { if (!mcs->irlap) {
IRDA_ERROR("mcs7780: irlap_open failed\n"); net_err_ratelimited("mcs7780: irlap_open failed\n");
goto error2; goto error2;
} }
...@@ -851,7 +852,7 @@ static netdev_tx_t mcs_hard_xmit(struct sk_buff *skb, ...@@ -851,7 +852,7 @@ static netdev_tx_t mcs_hard_xmit(struct sk_buff *skb,
mcs->out_buf, wraplen, mcs_send_irq, mcs); mcs->out_buf, wraplen, mcs_send_irq, mcs);
if ((ret = usb_submit_urb(mcs->tx_urb, GFP_ATOMIC))) { if ((ret = usb_submit_urb(mcs->tx_urb, GFP_ATOMIC))) {
IRDA_ERROR("failed tx_urb: %d\n", ret); net_err_ratelimited("failed tx_urb: %d\n", ret);
switch (ret) { switch (ret) {
case -ENODEV: case -ENODEV:
case -EPIPE: case -EPIPE:
...@@ -899,7 +900,7 @@ static int mcs_probe(struct usb_interface *intf, ...@@ -899,7 +900,7 @@ static int mcs_probe(struct usb_interface *intf,
ret = usb_reset_configuration(udev); ret = usb_reset_configuration(udev);
if (ret != 0) { if (ret != 0) {
IRDA_ERROR("mcs7780: usb reset configuration failed\n"); net_err_ratelimited("mcs7780: usb reset configuration failed\n");
goto error2; goto error2;
} }
......
...@@ -211,7 +211,8 @@ static int __init nsc_ircc_init(void) ...@@ -211,7 +211,8 @@ static int __init nsc_ircc_init(void)
ret = platform_driver_register(&nsc_ircc_driver); ret = platform_driver_register(&nsc_ircc_driver);
if (ret) { if (ret) {
IRDA_ERROR("%s, Can't register driver!\n", driver_name); net_err_ratelimited("%s, Can't register driver!\n",
driver_name);
return ret; return ret;
} }
...@@ -260,7 +261,8 @@ static int __init nsc_ircc_init(void) ...@@ -260,7 +261,8 @@ static int __init nsc_ircc_init(void)
info.irq = pnp_info.irq; info.irq = pnp_info.irq;
if (info.fir_base < 0x2000) { if (info.fir_base < 0x2000) {
IRDA_MESSAGE("%s, chip->init\n", driver_name); net_info_ratelimited("%s, chip->init\n",
driver_name);
chip->init(chip, &info); chip->init(chip, &info);
} else } else
chip->probe(chip, &info); chip->probe(chip, &info);
...@@ -370,22 +372,23 @@ static int __init nsc_ircc_open(chipio_t *info) ...@@ -370,22 +372,23 @@ static int __init nsc_ircc_open(chipio_t *info)
} }
if (chip_index == ARRAY_SIZE(dev_self)) { if (chip_index == ARRAY_SIZE(dev_self)) {
IRDA_ERROR("%s(), maximum number of supported chips reached!\n", __func__); net_err_ratelimited("%s(), maximum number of supported chips reached!\n",
__func__);
return -ENOMEM; return -ENOMEM;
} }
IRDA_MESSAGE("%s, Found chip at base=0x%03x\n", driver_name, net_info_ratelimited("%s, Found chip at base=0x%03x\n",
info->cfg_base); driver_name, info->cfg_base);
if ((nsc_ircc_setup(info)) == -1) if ((nsc_ircc_setup(info)) == -1)
return -1; return -1;
IRDA_MESSAGE("%s, driver loaded (Dag Brattli)\n", driver_name); net_info_ratelimited("%s, driver loaded (Dag Brattli)\n", driver_name);
dev = alloc_irdadev(sizeof(struct nsc_ircc_cb)); dev = alloc_irdadev(sizeof(struct nsc_ircc_cb));
if (dev == NULL) { if (dev == NULL) {
IRDA_ERROR("%s(), can't allocate memory for " net_err_ratelimited("%s(), can't allocate memory for control block!\n",
"control block!\n", __func__); __func__);
return -ENOMEM; return -ENOMEM;
} }
...@@ -408,8 +411,8 @@ static int __init nsc_ircc_open(chipio_t *info) ...@@ -408,8 +411,8 @@ static int __init nsc_ircc_open(chipio_t *info)
/* Reserve the ioports that we need */ /* Reserve the ioports that we need */
ret = request_region(self->io.fir_base, self->io.fir_ext, driver_name); ret = request_region(self->io.fir_base, self->io.fir_ext, driver_name);
if (!ret) { if (!ret) {
IRDA_WARNING("%s(), can't get iobase of 0x%03x\n", net_warn_ratelimited("%s(), can't get iobase of 0x%03x\n",
__func__, self->io.fir_base); __func__, self->io.fir_base);
err = -ENODEV; err = -ENODEV;
goto out1; goto out1;
} }
...@@ -460,21 +463,22 @@ static int __init nsc_ircc_open(chipio_t *info) ...@@ -460,21 +463,22 @@ static int __init nsc_ircc_open(chipio_t *info)
err = register_netdev(dev); err = register_netdev(dev);
if (err) { if (err) {
IRDA_ERROR("%s(), register_netdev() failed!\n", __func__); net_err_ratelimited("%s(), register_netdev() failed!\n",
__func__);
goto out4; goto out4;
} }
IRDA_MESSAGE("IrDA: Registered device %s\n", dev->name); net_info_ratelimited("IrDA: Registered device %s\n", dev->name);
/* Check if user has supplied a valid dongle id or not */ /* Check if user has supplied a valid dongle id or not */
if ((dongle_id <= 0) || if ((dongle_id <= 0) ||
(dongle_id >= ARRAY_SIZE(dongle_types))) { (dongle_id >= ARRAY_SIZE(dongle_types))) {
dongle_id = nsc_ircc_read_dongle_id(self->io.fir_base); dongle_id = nsc_ircc_read_dongle_id(self->io.fir_base);
IRDA_MESSAGE("%s, Found dongle: %s\n", driver_name, net_info_ratelimited("%s, Found dongle: %s\n",
dongle_types[dongle_id]); driver_name, dongle_types[dongle_id]);
} else { } else {
IRDA_MESSAGE("%s, Using dongle: %s\n", driver_name, net_info_ratelimited("%s, Using dongle: %s\n",
dongle_types[dongle_id]); driver_name, dongle_types[dongle_id]);
} }
self->io.dongle_id = dongle_id; self->io.dongle_id = dongle_id;
...@@ -567,7 +571,7 @@ static int nsc_ircc_init_108(nsc_chip_t *chip, chipio_t *info) ...@@ -567,7 +571,7 @@ static int nsc_ircc_init_108(nsc_chip_t *chip, chipio_t *info)
case 0x2e8: outb(0x15, cfg_base+1); break; case 0x2e8: outb(0x15, cfg_base+1); break;
case 0x3f8: outb(0x16, cfg_base+1); break; case 0x3f8: outb(0x16, cfg_base+1); break;
case 0x2f8: outb(0x17, cfg_base+1); break; case 0x2f8: outb(0x17, cfg_base+1); break;
default: IRDA_ERROR("%s(), invalid base_address", __func__); default: net_err_ratelimited("%s(), invalid base_address\n", __func__);
} }
/* Control Signal Routing Register (CSRT) */ /* Control Signal Routing Register (CSRT) */
...@@ -579,7 +583,7 @@ static int nsc_ircc_init_108(nsc_chip_t *chip, chipio_t *info) ...@@ -579,7 +583,7 @@ static int nsc_ircc_init_108(nsc_chip_t *chip, chipio_t *info)
case 9: temp = 0x05; break; case 9: temp = 0x05; break;
case 11: temp = 0x06; break; case 11: temp = 0x06; break;
case 15: temp = 0x07; break; case 15: temp = 0x07; break;
default: IRDA_ERROR("%s(), invalid irq", __func__); default: net_err_ratelimited("%s(), invalid irq\n", __func__);
} }
outb(CFG_108_CSRT, cfg_base); outb(CFG_108_CSRT, cfg_base);
...@@ -587,7 +591,7 @@ static int nsc_ircc_init_108(nsc_chip_t *chip, chipio_t *info) ...@@ -587,7 +591,7 @@ static int nsc_ircc_init_108(nsc_chip_t *chip, chipio_t *info)
case 0: outb(0x08+temp, cfg_base+1); break; case 0: outb(0x08+temp, cfg_base+1); break;
case 1: outb(0x10+temp, cfg_base+1); break; case 1: outb(0x10+temp, cfg_base+1); break;
case 3: outb(0x18+temp, cfg_base+1); break; case 3: outb(0x18+temp, cfg_base+1); break;
default: IRDA_ERROR("%s(), invalid dma", __func__); default: net_err_ratelimited("%s(), invalid dma\n", __func__);
} }
outb(CFG_108_MCTL, cfg_base); /* Mode Control Register (MCTL) */ outb(CFG_108_MCTL, cfg_base); /* Mode Control Register (MCTL) */
...@@ -993,8 +997,8 @@ static int nsc_ircc_setup(chipio_t *info) ...@@ -993,8 +997,8 @@ static int nsc_ircc_setup(chipio_t *info)
/* Should be 0x2? */ /* Should be 0x2? */
if (0x20 != (version & 0xf0)) { if (0x20 != (version & 0xf0)) {
IRDA_ERROR("%s, Wrong chip version %02x\n", net_err_ratelimited("%s, Wrong chip version %02x\n",
driver_name, version); driver_name, version);
return -1; return -1;
} }
...@@ -1872,9 +1876,6 @@ static int nsc_ircc_dma_receive_complete(struct nsc_ircc_cb *self, int iobase) ...@@ -1872,9 +1876,6 @@ static int nsc_ircc_dma_receive_complete(struct nsc_ircc_cb *self, int iobase)
skb = dev_alloc_skb(len+1); skb = dev_alloc_skb(len+1);
if (skb == NULL) { if (skb == NULL) {
IRDA_WARNING("%s(), memory squeeze, "
"dropping frame.\n",
__func__);
self->netdev->stats.rx_dropped++; self->netdev->stats.rx_dropped++;
/* Restore bank register */ /* Restore bank register */
...@@ -2063,9 +2064,8 @@ static void nsc_ircc_fir_interrupt(struct nsc_ircc_cb *self, int iobase, ...@@ -2063,9 +2064,8 @@ static void nsc_ircc_fir_interrupt(struct nsc_ircc_cb *self, int iobase,
nsc_ircc_dma_receive(self); nsc_ircc_dma_receive(self);
self->ier = IER_SFIF_IE; self->ier = IER_SFIF_IE;
} else } else
IRDA_WARNING("%s(), potential " net_warn_ratelimited("%s(), potential Tx queue lockup !\n",
"Tx queue lockup !\n", __func__);
__func__);
} }
} else { } else {
/* Not finished yet, so interrupt on DMA again */ /* Not finished yet, so interrupt on DMA again */
...@@ -2184,8 +2184,8 @@ static int nsc_ircc_net_open(struct net_device *dev) ...@@ -2184,8 +2184,8 @@ static int nsc_ircc_net_open(struct net_device *dev)
iobase = self->io.fir_base; iobase = self->io.fir_base;
if (request_irq(self->io.irq, nsc_ircc_interrupt, 0, dev->name, dev)) { if (request_irq(self->io.irq, nsc_ircc_interrupt, 0, dev->name, dev)) {
IRDA_WARNING("%s, unable to allocate irq=%d\n", net_warn_ratelimited("%s, unable to allocate irq=%d\n",
driver_name, self->io.irq); driver_name, self->io.irq);
return -EAGAIN; return -EAGAIN;
} }
/* /*
...@@ -2193,8 +2193,8 @@ static int nsc_ircc_net_open(struct net_device *dev) ...@@ -2193,8 +2193,8 @@ static int nsc_ircc_net_open(struct net_device *dev)
* failure. * failure.
*/ */
if (request_dma(self->io.dma, dev->name)) { if (request_dma(self->io.dma, dev->name)) {
IRDA_WARNING("%s, unable to allocate dma=%d\n", net_warn_ratelimited("%s, unable to allocate dma=%d\n",
driver_name, self->io.dma); driver_name, self->io.dma);
free_irq(self->io.irq, dev); free_irq(self->io.irq, dev);
return -EAGAIN; return -EAGAIN;
} }
...@@ -2372,8 +2372,8 @@ static int nsc_ircc_resume(struct platform_device *dev) ...@@ -2372,8 +2372,8 @@ static int nsc_ircc_resume(struct platform_device *dev)
if (netif_running(self->netdev)) { if (netif_running(self->netdev)) {
if (request_irq(self->io.irq, nsc_ircc_interrupt, 0, if (request_irq(self->io.irq, nsc_ircc_interrupt, 0,
self->netdev->name, self->netdev)) { self->netdev->name, self->netdev)) {
IRDA_WARNING("%s, unable to allocate irq=%d\n", net_warn_ratelimited("%s, unable to allocate irq=%d\n",
driver_name, self->io.irq); driver_name, self->io.irq);
/* /*
* Don't fail resume process, just kill this * Don't fail resume process, just kill this
......
...@@ -82,7 +82,7 @@ static int sirdev_tx_complete_fsm(struct sir_dev *dev) ...@@ -82,7 +82,7 @@ static int sirdev_tx_complete_fsm(struct sir_dev *dev)
return 0; return 0;
default: default:
IRDA_ERROR("%s - undefined state\n", __func__); net_err_ratelimited("%s - undefined state\n", __func__);
return -EINVAL; return -EINVAL;
} }
fsm->substate = next_state; fsm->substate = next_state;
...@@ -251,12 +251,13 @@ static void sirdev_config_fsm(struct work_struct *work) ...@@ -251,12 +251,13 @@ static void sirdev_config_fsm(struct work_struct *work)
break; break;
default: default:
IRDA_ERROR("%s - undefined state\n", __func__); net_err_ratelimited("%s - undefined state\n", __func__);
fsm->result = -EINVAL; fsm->result = -EINVAL;
/* fall thru */ /* fall thru */
case SIRDEV_STATE_ERROR: case SIRDEV_STATE_ERROR:
IRDA_ERROR("%s - error: %d\n", __func__, fsm->result); net_err_ratelimited("%s - error: %d\n",
__func__, fsm->result);
#if 0 /* don't enable this before we have netdev->tx_timeout to recover */ #if 0 /* don't enable this before we have netdev->tx_timeout to recover */
netif_stop_queue(dev->netdev); netif_stop_queue(dev->netdev);
...@@ -299,7 +300,7 @@ int sirdev_schedule_request(struct sir_dev *dev, int initial_state, unsigned par ...@@ -299,7 +300,7 @@ int sirdev_schedule_request(struct sir_dev *dev, int initial_state, unsigned par
if (fsm->state == SIRDEV_STATE_DEAD) { if (fsm->state == SIRDEV_STATE_DEAD) {
/* race with sirdev_close should never happen */ /* race with sirdev_close should never happen */
IRDA_ERROR("%s(), instance staled!\n", __func__); net_err_ratelimited("%s(), instance staled!\n", __func__);
up(&fsm->sem); up(&fsm->sem);
return -ESTALE; /* or better EPIPE? */ return -ESTALE; /* or better EPIPE? */
} }
...@@ -452,8 +453,8 @@ void sirdev_write_complete(struct sir_dev *dev) ...@@ -452,8 +453,8 @@ void sirdev_write_complete(struct sir_dev *dev)
} }
else if (unlikely(actual<0)) { else if (unlikely(actual<0)) {
/* could be dropped later when we have tx_timeout to recover */ /* could be dropped later when we have tx_timeout to recover */
IRDA_ERROR("%s: drv->do_write failed (%d)\n", net_err_ratelimited("%s: drv->do_write failed (%d)\n",
__func__, actual); __func__, actual);
if ((skb=dev->tx_skb) != NULL) { if ((skb=dev->tx_skb) != NULL) {
dev->tx_skb = NULL; dev->tx_skb = NULL;
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
...@@ -507,8 +508,8 @@ void sirdev_write_complete(struct sir_dev *dev) ...@@ -507,8 +508,8 @@ void sirdev_write_complete(struct sir_dev *dev)
/* should never happen /* should never happen
* forget the speed change and hope the stack recovers * forget the speed change and hope the stack recovers
*/ */
IRDA_ERROR("%s - schedule speed change failed: %d\n", net_err_ratelimited("%s - schedule speed change failed: %d\n",
__func__, err); __func__, err);
netif_wake_queue(dev->netdev); netif_wake_queue(dev->netdev);
} }
/* else: success /* else: success
...@@ -535,13 +536,13 @@ EXPORT_SYMBOL(sirdev_write_complete); ...@@ -535,13 +536,13 @@ EXPORT_SYMBOL(sirdev_write_complete);
int sirdev_receive(struct sir_dev *dev, const unsigned char *cp, size_t count) int sirdev_receive(struct sir_dev *dev, const unsigned char *cp, size_t count)
{ {
if (!dev || !dev->netdev) { if (!dev || !dev->netdev) {
IRDA_WARNING("%s(), not ready yet!\n", __func__); net_warn_ratelimited("%s(), not ready yet!\n", __func__);
return -1; return -1;
} }
if (!dev->irlap) { if (!dev->irlap) {
IRDA_WARNING("%s - too early: %p / %zd!\n", net_warn_ratelimited("%s - too early: %p / %zd!\n",
__func__, cp, count); __func__, cp, count);
return -1; return -1;
} }
...@@ -661,8 +662,8 @@ static netdev_tx_t sirdev_hard_xmit(struct sk_buff *skb, ...@@ -661,8 +662,8 @@ static netdev_tx_t sirdev_hard_xmit(struct sk_buff *skb,
} }
else if (unlikely(actual < 0)) { else if (unlikely(actual < 0)) {
/* could be dropped later when we have tx_timeout to recover */ /* could be dropped later when we have tx_timeout to recover */
IRDA_ERROR("%s: drv->do_write failed (%d)\n", net_err_ratelimited("%s: drv->do_write failed (%d)\n",
__func__, actual); __func__, actual);
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
dev->netdev->stats.tx_errors++; dev->netdev->stats.tx_errors++;
dev->netdev->stats.tx_dropped++; dev->netdev->stats.tx_dropped++;
...@@ -894,7 +895,8 @@ struct sir_dev * sirdev_get_instance(const struct sir_driver *drv, const char *n ...@@ -894,7 +895,8 @@ struct sir_dev * sirdev_get_instance(const struct sir_driver *drv, const char *n
*/ */
ndev = alloc_irdadev(sizeof(*dev)); ndev = alloc_irdadev(sizeof(*dev));
if (ndev == NULL) { if (ndev == NULL) {
IRDA_ERROR("%s - Can't allocate memory for IrDA control block!\n", __func__); net_err_ratelimited("%s - Can't allocate memory for IrDA control block!\n",
__func__);
goto out; goto out;
} }
dev = netdev_priv(ndev); dev = netdev_priv(ndev);
...@@ -919,7 +921,8 @@ struct sir_dev * sirdev_get_instance(const struct sir_driver *drv, const char *n ...@@ -919,7 +921,8 @@ struct sir_dev * sirdev_get_instance(const struct sir_driver *drv, const char *n
ndev->netdev_ops = &sirdev_ops; ndev->netdev_ops = &sirdev_ops;
if (register_netdev(ndev)) { if (register_netdev(ndev)) {
IRDA_ERROR("%s(), register_netdev() failed!\n", __func__); net_err_ratelimited("%s(), register_netdev() failed!\n",
__func__);
goto out_freenetdev; goto out_freenetdev;
} }
...@@ -946,7 +949,7 @@ int sirdev_put_instance(struct sir_dev *dev) ...@@ -946,7 +949,7 @@ int sirdev_put_instance(struct sir_dev *dev)
if (dev->dongle_drv) if (dev->dongle_drv)
err = sirdev_schedule_dongle_close(dev); err = sirdev_schedule_dongle_close(dev);
if (err) if (err)
IRDA_ERROR("%s - error %d\n", __func__, err); net_err_ratelimited("%s - error %d\n", __func__, err);
sirdev_close(dev->netdev); sirdev_close(dev->netdev);
......
This diff is collapsed.
...@@ -179,7 +179,8 @@ static int tekram_change_speed(struct sir_dev *dev, unsigned speed) ...@@ -179,7 +179,8 @@ static int tekram_change_speed(struct sir_dev *dev, unsigned speed)
break; break;
default: default:
IRDA_ERROR("%s - undefined state %d\n", __func__, state); net_err_ratelimited("%s - undefined state %d\n",
__func__, state);
ret = -EINVAL; ret = -EINVAL;
break; break;
} }
......
...@@ -391,7 +391,8 @@ static int via_ircc_open(struct pci_dev *pdev, chipio_t *info, unsigned int id) ...@@ -391,7 +391,8 @@ static int via_ircc_open(struct pci_dev *pdev, chipio_t *info, unsigned int id)
if (err) if (err)
goto err_out4; goto err_out4;
IRDA_MESSAGE("IrDA: Registered device %s (via-ircc)\n", dev->name); net_info_ratelimited("IrDA: Registered device %s (via-ircc)\n",
dev->name);
/* Initialise the hardware.. /* Initialise the hardware..
*/ */
...@@ -510,7 +511,7 @@ static void via_hw_init(struct via_ircc_cb *self) ...@@ -510,7 +511,7 @@ static void via_hw_init(struct via_ircc_cb *self)
*/ */
static int via_ircc_read_dongle_id(int iobase) static int via_ircc_read_dongle_id(int iobase)
{ {
IRDA_ERROR("via-ircc: dongle probing not supported, please specify dongle_id module parameter.\n"); net_err_ratelimited("via-ircc: dongle probing not supported, please specify dongle_id module parameter\n");
return 9; /* Default to IBM */ return 9; /* Default to IBM */
} }
...@@ -652,8 +653,8 @@ static void via_ircc_change_dongle_speed(int iobase, int speed, ...@@ -652,8 +653,8 @@ static void via_ircc_change_dongle_speed(int iobase, int speed,
break; break;
default: default:
IRDA_ERROR("%s: Error: dongle_id %d unsupported !\n", net_err_ratelimited("%s: Error: dongle_id %d unsupported !\n",
__func__, dongle_id); __func__, dongle_id);
} }
} }
...@@ -1473,8 +1474,8 @@ static int via_ircc_net_open(struct net_device *dev) ...@@ -1473,8 +1474,8 @@ static int via_ircc_net_open(struct net_device *dev)
IRDA_ASSERT(self != NULL, return 0;); IRDA_ASSERT(self != NULL, return 0;);
iobase = self->io.fir_base; iobase = self->io.fir_base;
if (request_irq(self->io.irq, via_ircc_interrupt, 0, dev->name, dev)) { if (request_irq(self->io.irq, via_ircc_interrupt, 0, dev->name, dev)) {
IRDA_WARNING("%s, unable to allocate irq=%d\n", driver_name, net_warn_ratelimited("%s, unable to allocate irq=%d\n",
self->io.irq); driver_name, self->io.irq);
return -EAGAIN; return -EAGAIN;
} }
/* /*
...@@ -1482,15 +1483,15 @@ static int via_ircc_net_open(struct net_device *dev) ...@@ -1482,15 +1483,15 @@ static int via_ircc_net_open(struct net_device *dev)
* failure. * failure.
*/ */
if (request_dma(self->io.dma, dev->name)) { if (request_dma(self->io.dma, dev->name)) {
IRDA_WARNING("%s, unable to allocate dma=%d\n", driver_name, net_warn_ratelimited("%s, unable to allocate dma=%d\n",
self->io.dma); driver_name, self->io.dma);
free_irq(self->io.irq, dev); free_irq(self->io.irq, dev);
return -EAGAIN; return -EAGAIN;
} }
if (self->io.dma2 != self->io.dma) { if (self->io.dma2 != self->io.dma) {
if (request_dma(self->io.dma2, dev->name)) { if (request_dma(self->io.dma2, dev->name)) {
IRDA_WARNING("%s, unable to allocate dma2=%d\n", net_warn_ratelimited("%s, unable to allocate dma2=%d\n",
driver_name, self->io.dma2); driver_name, self->io.dma2);
free_irq(self->io.irq, dev); free_irq(self->io.irq, dev);
free_dma(self->io.dma); free_dma(self->io.dma);
return -EAGAIN; return -EAGAIN;
......
This diff is collapsed.
...@@ -615,7 +615,8 @@ static inline void rd_set_addr_status(struct ring_descr *rd, dma_addr_t a, u8 s) ...@@ -615,7 +615,8 @@ static inline void rd_set_addr_status(struct ring_descr *rd, dma_addr_t a, u8 s)
*/ */
if ((a & ~DMA_MASK_MSTRPAGE)>>24 != MSTRPAGE_VALUE) { if ((a & ~DMA_MASK_MSTRPAGE)>>24 != MSTRPAGE_VALUE) {
IRDA_ERROR("%s: pci busaddr inconsistency!\n", __func__); net_err_ratelimited("%s: pci busaddr inconsistency!\n",
__func__);
dump_stack(); dump_stack();
return; return;
} }
......
...@@ -236,10 +236,11 @@ static int w83977af_open(int i, unsigned int iobase, unsigned int irq, ...@@ -236,10 +236,11 @@ static int w83977af_open(int i, unsigned int iobase, unsigned int irq,
err = register_netdev(dev); err = register_netdev(dev);
if (err) { if (err) {
IRDA_ERROR("%s(), register_netdevice() failed!\n", __func__); net_err_ratelimited("%s(), register_netdevice() failed!\n",
__func__);
goto err_out3; goto err_out3;
} }
IRDA_MESSAGE("IrDA: Registered device %s\n", dev->name); net_info_ratelimited("IrDA: Registered device %s\n", dev->name);
/* Need to store self somewhere */ /* Need to store self somewhere */
dev_self[i] = self; dev_self[i] = self;
...@@ -392,8 +393,8 @@ static int w83977af_probe(int iobase, int irq, int dma) ...@@ -392,8 +393,8 @@ static int w83977af_probe(int iobase, int irq, int dma)
switch_bank(iobase, SET7); switch_bank(iobase, SET7);
outb(0x40, iobase+7); outb(0x40, iobase+7);
IRDA_MESSAGE("W83977AF (IR) driver loaded. " net_info_ratelimited("W83977AF (IR) driver loaded. Version: 0x%02x\n",
"Version: 0x%02x\n", version); version);
return 0; return 0;
} else { } else {
......
...@@ -77,10 +77,6 @@ do { if(!(expr)) { \ ...@@ -77,10 +77,6 @@ do { if(!(expr)) { \
#define IRDA_ASSERT_LABEL(label) #define IRDA_ASSERT_LABEL(label)
#endif /* CONFIG_IRDA_DEBUG */ #endif /* CONFIG_IRDA_DEBUG */
#define IRDA_ERROR net_err_ratelimited
#define IRDA_WARNING net_warn_ratelimited
#define IRDA_MESSAGE net_info_ratelimited
/* /*
* Magic numbers used by Linux-IrDA. Random numbers which must be unique to * Magic numbers used by Linux-IrDA. Random numbers which must be unique to
* give the best protection * give the best protection
......
...@@ -201,16 +201,16 @@ static void irda_connect_confirm(void *instance, void *sap, ...@@ -201,16 +201,16 @@ static void irda_connect_confirm(void *instance, void *sap,
switch (sk->sk_type) { switch (sk->sk_type) {
case SOCK_STREAM: case SOCK_STREAM:
if (max_sdu_size != 0) { if (max_sdu_size != 0) {
IRDA_ERROR("%s: max_sdu_size must be 0\n", net_err_ratelimited("%s: max_sdu_size must be 0\n",
__func__); __func__);
return; return;
} }
self->max_data_size = irttp_get_max_seg_size(self->tsap); self->max_data_size = irttp_get_max_seg_size(self->tsap);
break; break;
case SOCK_SEQPACKET: case SOCK_SEQPACKET:
if (max_sdu_size == 0) { if (max_sdu_size == 0) {
IRDA_ERROR("%s: max_sdu_size cannot be 0\n", net_err_ratelimited("%s: max_sdu_size cannot be 0\n",
__func__); __func__);
return; return;
} }
self->max_data_size = max_sdu_size; self->max_data_size = max_sdu_size;
...@@ -262,8 +262,8 @@ static void irda_connect_indication(void *instance, void *sap, ...@@ -262,8 +262,8 @@ static void irda_connect_indication(void *instance, void *sap,
switch (sk->sk_type) { switch (sk->sk_type) {
case SOCK_STREAM: case SOCK_STREAM:
if (max_sdu_size != 0) { if (max_sdu_size != 0) {
IRDA_ERROR("%s: max_sdu_size must be 0\n", net_err_ratelimited("%s: max_sdu_size must be 0\n",
__func__); __func__);
kfree_skb(skb); kfree_skb(skb);
return; return;
} }
...@@ -271,8 +271,8 @@ static void irda_connect_indication(void *instance, void *sap, ...@@ -271,8 +271,8 @@ static void irda_connect_indication(void *instance, void *sap,
break; break;
case SOCK_SEQPACKET: case SOCK_SEQPACKET:
if (max_sdu_size == 0) { if (max_sdu_size == 0) {
IRDA_ERROR("%s: max_sdu_size cannot be 0\n", net_err_ratelimited("%s: max_sdu_size cannot be 0\n",
__func__); __func__);
kfree_skb(skb); kfree_skb(skb);
return; return;
} }
...@@ -368,7 +368,7 @@ static void irda_getvalue_confirm(int result, __u16 obj_id, ...@@ -368,7 +368,7 @@ static void irda_getvalue_confirm(int result, __u16 obj_id,
self = priv; self = priv;
if (!self) { if (!self) {
IRDA_WARNING("%s: lost myself!\n", __func__); net_warn_ratelimited("%s: lost myself!\n", __func__);
return; return;
} }
...@@ -417,7 +417,7 @@ static void irda_selective_discovery_indication(discinfo_t *discovery, ...@@ -417,7 +417,7 @@ static void irda_selective_discovery_indication(discinfo_t *discovery,
self = priv; self = priv;
if (!self) { if (!self) {
IRDA_WARNING("%s: lost myself!\n", __func__); net_warn_ratelimited("%s: lost myself!\n", __func__);
return; return;
} }
...@@ -505,7 +505,7 @@ static int irda_open_lsap(struct irda_sock *self, int pid) ...@@ -505,7 +505,7 @@ static int irda_open_lsap(struct irda_sock *self, int pid)
notify_t notify; notify_t notify;
if (self->lsap) { if (self->lsap) {
IRDA_WARNING("%s(), busy!\n", __func__); net_warn_ratelimited("%s(), busy!\n", __func__);
return -EBUSY; return -EBUSY;
} }
...@@ -541,8 +541,8 @@ static int irda_find_lsap_sel(struct irda_sock *self, char *name) ...@@ -541,8 +541,8 @@ static int irda_find_lsap_sel(struct irda_sock *self, char *name)
IRDA_DEBUG(2, "%s(%p, %s)\n", __func__, self, name); IRDA_DEBUG(2, "%s(%p, %s)\n", __func__, self, name);
if (self->iriap) { if (self->iriap) {
IRDA_WARNING("%s(): busy with a previous query\n", net_warn_ratelimited("%s(): busy with a previous query\n",
__func__); __func__);
return -EBUSY; return -EBUSY;
} }
...@@ -2129,8 +2129,8 @@ static int irda_setsockopt(struct socket *sock, int level, int optname, ...@@ -2129,8 +2129,8 @@ static int irda_setsockopt(struct socket *sock, int level, int optname,
__func__, opt); __func__, opt);
self->max_sdu_size_rx = opt; self->max_sdu_size_rx = opt;
} else { } else {
IRDA_WARNING("%s: not allowed to set MAXSDUSIZE for this socket type!\n", net_warn_ratelimited("%s: not allowed to set MAXSDUSIZE for this socket type!\n",
__func__); __func__);
err = -ENOPROTOOPT; err = -ENOPROTOOPT;
goto out; goto out;
} }
...@@ -2441,8 +2441,8 @@ static int irda_getsockopt(struct socket *sock, int level, int optname, ...@@ -2441,8 +2441,8 @@ static int irda_getsockopt(struct socket *sock, int level, int optname,
/* Check that we can proceed with IAP */ /* Check that we can proceed with IAP */
if (self->iriap) { if (self->iriap) {
IRDA_WARNING("%s: busy with a previous query\n", net_warn_ratelimited("%s: busy with a previous query\n",
__func__); __func__);
kfree(ias_opt); kfree(ias_opt);
err = -EBUSY; err = -EBUSY;
goto out; goto out;
......
...@@ -69,7 +69,8 @@ static int __init ircomm_init(void) ...@@ -69,7 +69,8 @@ static int __init ircomm_init(void)
{ {
ircomm = hashbin_new(HB_LOCK); ircomm = hashbin_new(HB_LOCK);
if (ircomm == NULL) { if (ircomm == NULL) {
IRDA_ERROR("%s(), can't allocate hashbin!\n", __func__); net_err_ratelimited("%s(), can't allocate hashbin!\n",
__func__);
return -ENOMEM; return -ENOMEM;
} }
...@@ -83,7 +84,7 @@ static int __init ircomm_init(void) ...@@ -83,7 +84,7 @@ static int __init ircomm_init(void)
} }
#endif /* CONFIG_PROC_FS */ #endif /* CONFIG_PROC_FS */
IRDA_MESSAGE("IrCOMM protocol (Dag Brattli)\n"); net_info_ratelimited("IrCOMM protocol (Dag Brattli)\n");
return 0; return 0;
} }
......
...@@ -204,7 +204,7 @@ static int ircomm_lmp_data_request(struct ircomm_cb *self, ...@@ -204,7 +204,7 @@ static int ircomm_lmp_data_request(struct ircomm_cb *self,
} }
ret = irlmp_data_request(self->lsap, skb); ret = irlmp_data_request(self->lsap, skb);
if (ret) { if (ret) {
IRDA_ERROR("%s(), failed\n", __func__); net_err_ratelimited("%s(), failed\n", __func__);
/* irlmp_data_request already free the packet */ /* irlmp_data_request already free the packet */
} }
......
...@@ -130,7 +130,8 @@ int ircomm_param_request(struct ircomm_tty_cb *self, __u8 pi, int flush) ...@@ -130,7 +130,8 @@ int ircomm_param_request(struct ircomm_tty_cb *self, __u8 pi, int flush)
count = irda_param_insert(self, pi, skb_tail_pointer(skb), count = irda_param_insert(self, pi, skb_tail_pointer(skb),
skb_tailroom(skb), &ircomm_param_info); skb_tailroom(skb), &ircomm_param_info);
if (count < 0) { if (count < 0) {
IRDA_WARNING("%s(), no room for parameter!\n", __func__); net_warn_ratelimited("%s(), no room for parameter!\n",
__func__);
spin_unlock_irqrestore(&self->spinlock, flags); spin_unlock_irqrestore(&self->spinlock, flags);
return -1; return -1;
} }
......
...@@ -188,7 +188,7 @@ static int ircomm_ttp_data_request(struct ircomm_cb *self, ...@@ -188,7 +188,7 @@ static int ircomm_ttp_data_request(struct ircomm_cb *self,
ret = irttp_data_request(self->tsap, skb); ret = irttp_data_request(self->tsap, skb);
if (ret) { if (ret) {
IRDA_ERROR("%s(), failed\n", __func__); net_err_ratelimited("%s(), failed\n", __func__);
/* irttp_data_request already free the packet */ /* irttp_data_request already free the packet */
} }
...@@ -237,8 +237,8 @@ static void ircomm_ttp_connect_confirm(void *instance, void *sap, ...@@ -237,8 +237,8 @@ static void ircomm_ttp_connect_confirm(void *instance, void *sap,
IRDA_ASSERT(qos != NULL, goto out;); IRDA_ASSERT(qos != NULL, goto out;);
if (max_sdu_size != TTP_SAR_DISABLE) { if (max_sdu_size != TTP_SAR_DISABLE) {
IRDA_ERROR("%s(), SAR not allowed for IrCOMM!\n", net_err_ratelimited("%s(), SAR not allowed for IrCOMM!\n",
__func__); __func__);
goto out; goto out;
} }
...@@ -278,8 +278,8 @@ static void ircomm_ttp_connect_indication(void *instance, void *sap, ...@@ -278,8 +278,8 @@ static void ircomm_ttp_connect_indication(void *instance, void *sap,
IRDA_ASSERT(qos != NULL, goto out;); IRDA_ASSERT(qos != NULL, goto out;);
if (max_sdu_size != TTP_SAR_DISABLE) { if (max_sdu_size != TTP_SAR_DISABLE) {
IRDA_ERROR("%s(), SAR not allowed for IrCOMM!\n", net_err_ratelimited("%s(), SAR not allowed for IrCOMM!\n",
__func__); __func__);
goto out; goto out;
} }
......
...@@ -147,7 +147,8 @@ static int __init ircomm_tty_init(void) ...@@ -147,7 +147,8 @@ static int __init ircomm_tty_init(void)
return -ENOMEM; return -ENOMEM;
ircomm_tty = hashbin_new(HB_LOCK); ircomm_tty = hashbin_new(HB_LOCK);
if (ircomm_tty == NULL) { if (ircomm_tty == NULL) {
IRDA_ERROR("%s(), can't allocate hashbin!\n", __func__); net_err_ratelimited("%s(), can't allocate hashbin!\n",
__func__);
put_tty_driver(driver); put_tty_driver(driver);
return -ENOMEM; return -ENOMEM;
} }
...@@ -163,8 +164,8 @@ static int __init ircomm_tty_init(void) ...@@ -163,8 +164,8 @@ static int __init ircomm_tty_init(void)
driver->flags = TTY_DRIVER_REAL_RAW; driver->flags = TTY_DRIVER_REAL_RAW;
tty_set_operations(driver, &ops); tty_set_operations(driver, &ops);
if (tty_register_driver(driver)) { if (tty_register_driver(driver)) {
IRDA_ERROR("%s(): Couldn't register serial driver\n", net_err_ratelimited("%s(): Couldn't register serial driver\n",
__func__); __func__);
put_tty_driver(driver); put_tty_driver(driver);
return -1; return -1;
} }
...@@ -199,8 +200,8 @@ static void __exit ircomm_tty_cleanup(void) ...@@ -199,8 +200,8 @@ static void __exit ircomm_tty_cleanup(void)
ret = tty_unregister_driver(driver); ret = tty_unregister_driver(driver);
if (ret) { if (ret) {
IRDA_ERROR("%s(), failed to unregister driver\n", net_err_ratelimited("%s(), failed to unregister driver\n",
__func__); __func__);
return; return;
} }
...@@ -256,7 +257,7 @@ static int ircomm_tty_startup(struct ircomm_tty_cb *self) ...@@ -256,7 +257,7 @@ static int ircomm_tty_startup(struct ircomm_tty_cb *self)
/* Connect IrCOMM link with remote device */ /* Connect IrCOMM link with remote device */
ret = ircomm_tty_attach_cable(self); ret = ircomm_tty_attach_cable(self);
if (ret < 0) { if (ret < 0) {
IRDA_ERROR("%s(), error attaching cable!\n", __func__); net_err_ratelimited("%s(), error attaching cable!\n", __func__);
goto err; goto err;
} }
...@@ -389,10 +390,8 @@ static int ircomm_tty_install(struct tty_driver *driver, struct tty_struct *tty) ...@@ -389,10 +390,8 @@ static int ircomm_tty_install(struct tty_driver *driver, struct tty_struct *tty)
if (!self) { if (!self) {
/* No, so make new instance */ /* No, so make new instance */
self = kzalloc(sizeof(struct ircomm_tty_cb), GFP_KERNEL); self = kzalloc(sizeof(struct ircomm_tty_cb), GFP_KERNEL);
if (self == NULL) { if (self == NULL)
IRDA_ERROR("%s(), kmalloc failed!\n", __func__);
return -ENOMEM; return -ENOMEM;
}
tty_port_init(&self->port); tty_port_init(&self->port);
self->port.ops = &ircomm_port_ops; self->port.ops = &ircomm_port_ops;
...@@ -469,8 +468,8 @@ static int ircomm_tty_open(struct tty_struct *tty, struct file *filp) ...@@ -469,8 +468,8 @@ static int ircomm_tty_open(struct tty_struct *tty, struct file *filp)
if (wait_event_interruptible(self->port.close_wait, if (wait_event_interruptible(self->port.close_wait,
!test_bit(ASYNCB_CLOSING, &self->port.flags))) { !test_bit(ASYNCB_CLOSING, &self->port.flags))) {
IRDA_WARNING("%s - got signal while blocking on ASYNC_CLOSING!\n", net_warn_ratelimited("%s - got signal while blocking on ASYNC_CLOSING!\n",
__func__); __func__);
return -ERESTARTSYS; return -ERESTARTSYS;
} }
......
...@@ -694,8 +694,8 @@ static int ircomm_tty_state_idle(struct ircomm_tty_cb *self, ...@@ -694,8 +694,8 @@ static int ircomm_tty_state_idle(struct ircomm_tty_cb *self,
self->saddr = info->saddr; self->saddr = info->saddr;
if (self->iriap) { if (self->iriap) {
IRDA_WARNING("%s(), busy with a previous query\n", net_warn_ratelimited("%s(), busy with a previous query\n",
__func__); __func__);
return -EBUSY; return -EBUSY;
} }
...@@ -752,8 +752,8 @@ static int ircomm_tty_state_search(struct ircomm_tty_cb *self, ...@@ -752,8 +752,8 @@ static int ircomm_tty_state_search(struct ircomm_tty_cb *self,
self->saddr = info->saddr; self->saddr = info->saddr;
if (self->iriap) { if (self->iriap) {
IRDA_WARNING("%s(), busy with a previous query\n", net_warn_ratelimited("%s(), busy with a previous query\n",
__func__); __func__);
return -EBUSY; return -EBUSY;
} }
...@@ -822,8 +822,8 @@ static int ircomm_tty_state_query_parameters(struct ircomm_tty_cb *self, ...@@ -822,8 +822,8 @@ static int ircomm_tty_state_query_parameters(struct ircomm_tty_cb *self,
switch (event) { switch (event) {
case IRCOMM_TTY_GOT_PARAMETERS: case IRCOMM_TTY_GOT_PARAMETERS:
if (self->iriap) { if (self->iriap) {
IRDA_WARNING("%s(), busy with a previous query\n", net_warn_ratelimited("%s(), busy with a previous query\n",
__func__); __func__);
return -EBUSY; return -EBUSY;
} }
......
...@@ -93,7 +93,8 @@ static void ircomm_tty_change_speed(struct ircomm_tty_cb *self, ...@@ -93,7 +93,8 @@ static void ircomm_tty_change_speed(struct ircomm_tty_cb *self,
self->settings.flow_control |= IRCOMM_RTS_CTS_IN; self->settings.flow_control |= IRCOMM_RTS_CTS_IN;
/* This got me. Bummer. Jean II */ /* This got me. Bummer. Jean II */
if (self->service_type == IRCOMM_3_WIRE_RAW) if (self->service_type == IRCOMM_3_WIRE_RAW)
IRDA_WARNING("%s(), enabling RTS/CTS on link that doesn't support it (3-wire-raw)\n", __func__); net_warn_ratelimited("%s(), enabling RTS/CTS on link that doesn't support it (3-wire-raw)\n",
__func__);
} else { } else {
self->port.flags &= ~ASYNC_CTS_FLOW; self->port.flags &= ~ASYNC_CTS_FLOW;
self->settings.flow_control &= ~IRCOMM_RTS_CTS_IN; self->settings.flow_control &= ~IRCOMM_RTS_CTS_IN;
......
...@@ -63,14 +63,14 @@ int __init irda_device_init( void) ...@@ -63,14 +63,14 @@ int __init irda_device_init( void)
{ {
dongles = hashbin_new(HB_NOLOCK); dongles = hashbin_new(HB_NOLOCK);
if (dongles == NULL) { if (dongles == NULL) {
IRDA_WARNING("IrDA: Can't allocate dongles hashbin!\n"); net_warn_ratelimited("IrDA: Can't allocate dongles hashbin!\n");
return -ENOMEM; return -ENOMEM;
} }
spin_lock_init(&dongles->hb_spinlock); spin_lock_init(&dongles->hb_spinlock);
tasks = hashbin_new(HB_LOCK); tasks = hashbin_new(HB_LOCK);
if (tasks == NULL) { if (tasks == NULL) {
IRDA_WARNING("IrDA: Can't allocate tasks hashbin!\n"); net_warn_ratelimited("IrDA: Can't allocate tasks hashbin!\n");
hashbin_delete(dongles, NULL); hashbin_delete(dongles, NULL);
return -ENOMEM; return -ENOMEM;
} }
...@@ -84,8 +84,8 @@ int __init irda_device_init( void) ...@@ -84,8 +84,8 @@ int __init irda_device_init( void)
static void leftover_dongle(void *arg) static void leftover_dongle(void *arg)
{ {
struct dongle_reg *reg = arg; struct dongle_reg *reg = arg;
IRDA_WARNING("IrDA: Dongle type %x not unregistered\n", net_warn_ratelimited("IrDA: Dongle type %x not unregistered\n",
reg->type); reg->type);
} }
void irda_device_cleanup(void) void irda_device_cleanup(void)
...@@ -150,8 +150,8 @@ int irda_device_is_receiving(struct net_device *dev) ...@@ -150,8 +150,8 @@ int irda_device_is_receiving(struct net_device *dev)
IRDA_DEBUG(2, "%s()\n", __func__); IRDA_DEBUG(2, "%s()\n", __func__);
if (!dev->netdev_ops->ndo_do_ioctl) { if (!dev->netdev_ops->ndo_do_ioctl) {
IRDA_ERROR("%s: do_ioctl not impl. by device driver\n", net_err_ratelimited("%s: do_ioctl not impl. by device driver\n",
__func__); __func__);
return -1; return -1;
} }
...@@ -201,15 +201,15 @@ static int irda_task_kick(struct irda_task *task) ...@@ -201,15 +201,15 @@ static int irda_task_kick(struct irda_task *task)
do { do {
timeout = task->function(task); timeout = task->function(task);
if (count++ > 100) { if (count++ > 100) {
IRDA_ERROR("%s: error in task handler!\n", net_err_ratelimited("%s: error in task handler!\n",
__func__); __func__);
irda_task_delete(task); irda_task_delete(task);
return TRUE; return TRUE;
} }
} while ((timeout == 0) && (task->state != IRDA_TASK_DONE)); } while ((timeout == 0) && (task->state != IRDA_TASK_DONE));
if (timeout < 0) { if (timeout < 0) {
IRDA_ERROR("%s: Error executing task!\n", __func__); net_err_ratelimited("%s: Error executing task!\n", __func__);
irda_task_delete(task); irda_task_delete(task);
return TRUE; return TRUE;
} }
......
...@@ -110,8 +110,8 @@ int __init iriap_init(void) ...@@ -110,8 +110,8 @@ int __init iriap_init(void)
/* Object repository - defined in irias_object.c */ /* Object repository - defined in irias_object.c */
irias_objects = hashbin_new(HB_LOCK); irias_objects = hashbin_new(HB_LOCK);
if (!irias_objects) { if (!irias_objects) {
IRDA_WARNING("%s: Can't allocate irias_objects hashbin!\n", net_warn_ratelimited("%s: Can't allocate irias_objects hashbin!\n",
__func__); __func__);
hashbin_delete(iriap, NULL); hashbin_delete(iriap, NULL);
return -ENOMEM; return -ENOMEM;
} }
...@@ -180,10 +180,8 @@ struct iriap_cb *iriap_open(__u8 slsap_sel, int mode, void *priv, ...@@ -180,10 +180,8 @@ struct iriap_cb *iriap_open(__u8 slsap_sel, int mode, void *priv,
IRDA_DEBUG(2, "%s()\n", __func__); IRDA_DEBUG(2, "%s()\n", __func__);
self = kzalloc(sizeof(*self), GFP_ATOMIC); self = kzalloc(sizeof(*self), GFP_ATOMIC);
if (!self) { if (!self)
IRDA_WARNING("%s: Unable to kmalloc!\n", __func__);
return NULL; return NULL;
}
/* /*
* Initialize instance * Initialize instance
...@@ -283,7 +281,8 @@ static int iriap_register_lsap(struct iriap_cb *self, __u8 slsap_sel, int mode) ...@@ -283,7 +281,8 @@ static int iriap_register_lsap(struct iriap_cb *self, __u8 slsap_sel, int mode)
self->lsap = irlmp_open_lsap(slsap_sel, &notify, 0); self->lsap = irlmp_open_lsap(slsap_sel, &notify, 0);
if (self->lsap == NULL) { if (self->lsap == NULL) {
IRDA_ERROR("%s: Unable to allocated LSAP!\n", __func__); net_err_ratelimited("%s: Unable to allocated LSAP!\n",
__func__);
return -1; return -1;
} }
self->slsap_sel = self->lsap->slsap_sel; self->slsap_sel = self->lsap->slsap_sel;
...@@ -859,9 +858,8 @@ static int iriap_data_indication(void *instance, void *sap, ...@@ -859,9 +858,8 @@ static int iriap_data_indication(void *instance, void *sap,
} }
opcode = frame[0]; opcode = frame[0];
if (~opcode & IAP_LST) { if (~opcode & IAP_LST) {
IRDA_WARNING("%s:, IrIAS multiframe commands or " net_warn_ratelimited("%s:, IrIAS multiframe commands or results is not implemented yet!\n",
"results is not implemented yet!\n", __func__);
__func__);
goto out; goto out;
} }
...@@ -945,16 +943,16 @@ void iriap_call_indication(struct iriap_cb *self, struct sk_buff *skb) ...@@ -945,16 +943,16 @@ void iriap_call_indication(struct iriap_cb *self, struct sk_buff *skb)
opcode = fp[0]; opcode = fp[0];
if (~opcode & 0x80) { if (~opcode & 0x80) {
IRDA_WARNING("%s: IrIAS multiframe commands or results " net_warn_ratelimited("%s: IrIAS multiframe commands or results is not implemented yet!\n",
"is not implemented yet!\n", __func__); __func__);
return; return;
} }
opcode &= 0x7f; /* Mask away LST bit */ opcode &= 0x7f; /* Mask away LST bit */
switch (opcode) { switch (opcode) {
case GET_INFO_BASE: case GET_INFO_BASE:
IRDA_WARNING("%s: GetInfoBaseDetails not implemented yet!\n", net_warn_ratelimited("%s: GetInfoBaseDetails not implemented yet!\n",
__func__); __func__);
break; break;
case GET_VALUE_BY_CLASS: case GET_VALUE_BY_CLASS:
iriap_getvaluebyclass_indication(self, skb); iriap_getvaluebyclass_indication(self, skb);
......
...@@ -368,10 +368,8 @@ static void state_r_disconnect(struct iriap_cb *self, IRIAP_EVENT event, ...@@ -368,10 +368,8 @@ static void state_r_disconnect(struct iriap_cb *self, IRIAP_EVENT event,
switch (event) { switch (event) {
case IAP_LM_CONNECT_INDICATION: case IAP_LM_CONNECT_INDICATION:
tx_skb = alloc_skb(LMP_MAX_HEADER, GFP_ATOMIC); tx_skb = alloc_skb(LMP_MAX_HEADER, GFP_ATOMIC);
if (tx_skb == NULL) { if (tx_skb == NULL)
IRDA_WARNING("%s: unable to malloc!\n", __func__);
return; return;
}
/* Reserve space for MUX_CONTROL and LAP header */ /* Reserve space for MUX_CONTROL and LAP header */
skb_reserve(tx_skb, LMP_MAX_HEADER); skb_reserve(tx_skb, LMP_MAX_HEADER);
......
...@@ -52,16 +52,16 @@ struct ias_object *irias_new_object( char *name, int id) ...@@ -52,16 +52,16 @@ struct ias_object *irias_new_object( char *name, int id)
obj = kzalloc(sizeof(struct ias_object), GFP_ATOMIC); obj = kzalloc(sizeof(struct ias_object), GFP_ATOMIC);
if (obj == NULL) { if (obj == NULL) {
IRDA_WARNING("%s(), Unable to allocate object!\n", net_warn_ratelimited("%s(), Unable to allocate object!\n",
__func__); __func__);
return NULL; return NULL;
} }
obj->magic = IAS_OBJECT_MAGIC; obj->magic = IAS_OBJECT_MAGIC;
obj->name = kstrndup(name, IAS_MAX_CLASSNAME, GFP_ATOMIC); obj->name = kstrndup(name, IAS_MAX_CLASSNAME, GFP_ATOMIC);
if (!obj->name) { if (!obj->name) {
IRDA_WARNING("%s(), Unable to allocate name!\n", net_warn_ratelimited("%s(), Unable to allocate name!\n",
__func__); __func__);
kfree(obj); kfree(obj);
return NULL; return NULL;
} }
...@@ -73,8 +73,8 @@ struct ias_object *irias_new_object( char *name, int id) ...@@ -73,8 +73,8 @@ struct ias_object *irias_new_object( char *name, int id)
obj->attribs = hashbin_new(HB_LOCK); obj->attribs = hashbin_new(HB_LOCK);
if (obj->attribs == NULL) { if (obj->attribs == NULL) {
IRDA_WARNING("%s(), Unable to allocate attribs!\n", net_warn_ratelimited("%s(), Unable to allocate attribs!\n",
__func__); __func__);
kfree(obj->name); kfree(obj->name);
kfree(obj); kfree(obj);
return NULL; return NULL;
...@@ -269,8 +269,8 @@ int irias_object_change_attribute(char *obj_name, char *attrib_name, ...@@ -269,8 +269,8 @@ int irias_object_change_attribute(char *obj_name, char *attrib_name,
/* Find object */ /* Find object */
obj = hashbin_lock_find(irias_objects, 0, obj_name); obj = hashbin_lock_find(irias_objects, 0, obj_name);
if (obj == NULL) { if (obj == NULL) {
IRDA_WARNING("%s: Unable to find object: %s\n", __func__, net_warn_ratelimited("%s: Unable to find object: %s\n",
obj_name); __func__, obj_name);
return -1; return -1;
} }
...@@ -280,8 +280,8 @@ int irias_object_change_attribute(char *obj_name, char *attrib_name, ...@@ -280,8 +280,8 @@ int irias_object_change_attribute(char *obj_name, char *attrib_name,
/* Find attribute */ /* Find attribute */
attrib = hashbin_find(obj->attribs, 0, attrib_name); attrib = hashbin_find(obj->attribs, 0, attrib_name);
if (attrib == NULL) { if (attrib == NULL) {
IRDA_WARNING("%s: Unable to find attribute: %s\n", net_warn_ratelimited("%s: Unable to find attribute: %s\n",
__func__, attrib_name); __func__, attrib_name);
spin_unlock_irqrestore(&obj->attribs->hb_spinlock, flags); spin_unlock_irqrestore(&obj->attribs->hb_spinlock, flags);
return -1; return -1;
} }
...@@ -322,8 +322,8 @@ void irias_add_integer_attrib(struct ias_object *obj, char *name, int value, ...@@ -322,8 +322,8 @@ void irias_add_integer_attrib(struct ias_object *obj, char *name, int value,
attrib = kzalloc(sizeof(struct ias_attrib), GFP_ATOMIC); attrib = kzalloc(sizeof(struct ias_attrib), GFP_ATOMIC);
if (attrib == NULL) { if (attrib == NULL) {
IRDA_WARNING("%s: Unable to allocate attribute!\n", net_warn_ratelimited("%s: Unable to allocate attribute!\n",
__func__); __func__);
return; return;
} }
...@@ -333,8 +333,8 @@ void irias_add_integer_attrib(struct ias_object *obj, char *name, int value, ...@@ -333,8 +333,8 @@ void irias_add_integer_attrib(struct ias_object *obj, char *name, int value,
/* Insert value */ /* Insert value */
attrib->value = irias_new_integer_value(value); attrib->value = irias_new_integer_value(value);
if (!attrib->name || !attrib->value) { if (!attrib->name || !attrib->value) {
IRDA_WARNING("%s: Unable to allocate attribute!\n", net_warn_ratelimited("%s: Unable to allocate attribute!\n",
__func__); __func__);
if (attrib->value) if (attrib->value)
irias_delete_value(attrib->value); irias_delete_value(attrib->value);
kfree(attrib->name); kfree(attrib->name);
...@@ -366,8 +366,8 @@ void irias_add_octseq_attrib(struct ias_object *obj, char *name, __u8 *octets, ...@@ -366,8 +366,8 @@ void irias_add_octseq_attrib(struct ias_object *obj, char *name, __u8 *octets,
attrib = kzalloc(sizeof(struct ias_attrib), GFP_ATOMIC); attrib = kzalloc(sizeof(struct ias_attrib), GFP_ATOMIC);
if (attrib == NULL) { if (attrib == NULL) {
IRDA_WARNING("%s: Unable to allocate attribute!\n", net_warn_ratelimited("%s: Unable to allocate attribute!\n",
__func__); __func__);
return; return;
} }
...@@ -376,8 +376,8 @@ void irias_add_octseq_attrib(struct ias_object *obj, char *name, __u8 *octets, ...@@ -376,8 +376,8 @@ void irias_add_octseq_attrib(struct ias_object *obj, char *name, __u8 *octets,
attrib->value = irias_new_octseq_value( octets, len); attrib->value = irias_new_octseq_value( octets, len);
if (!attrib->name || !attrib->value) { if (!attrib->name || !attrib->value) {
IRDA_WARNING("%s: Unable to allocate attribute!\n", net_warn_ratelimited("%s: Unable to allocate attribute!\n",
__func__); __func__);
if (attrib->value) if (attrib->value)
irias_delete_value(attrib->value); irias_delete_value(attrib->value);
kfree(attrib->name); kfree(attrib->name);
...@@ -408,8 +408,8 @@ void irias_add_string_attrib(struct ias_object *obj, char *name, char *value, ...@@ -408,8 +408,8 @@ void irias_add_string_attrib(struct ias_object *obj, char *name, char *value,
attrib = kzalloc(sizeof( struct ias_attrib), GFP_ATOMIC); attrib = kzalloc(sizeof( struct ias_attrib), GFP_ATOMIC);
if (attrib == NULL) { if (attrib == NULL) {
IRDA_WARNING("%s: Unable to allocate attribute!\n", net_warn_ratelimited("%s: Unable to allocate attribute!\n",
__func__); __func__);
return; return;
} }
...@@ -418,8 +418,8 @@ void irias_add_string_attrib(struct ias_object *obj, char *name, char *value, ...@@ -418,8 +418,8 @@ void irias_add_string_attrib(struct ias_object *obj, char *name, char *value,
attrib->value = irias_new_string_value(value); attrib->value = irias_new_string_value(value);
if (!attrib->name || !attrib->value) { if (!attrib->name || !attrib->value) {
IRDA_WARNING("%s: Unable to allocate attribute!\n", net_warn_ratelimited("%s: Unable to allocate attribute!\n",
__func__); __func__);
if (attrib->value) if (attrib->value)
irias_delete_value(attrib->value); irias_delete_value(attrib->value);
kfree(attrib->name); kfree(attrib->name);
...@@ -442,10 +442,8 @@ struct ias_value *irias_new_integer_value(int integer) ...@@ -442,10 +442,8 @@ struct ias_value *irias_new_integer_value(int integer)
struct ias_value *value; struct ias_value *value;
value = kzalloc(sizeof(struct ias_value), GFP_ATOMIC); value = kzalloc(sizeof(struct ias_value), GFP_ATOMIC);
if (value == NULL) { if (value == NULL)
IRDA_WARNING("%s: Unable to kmalloc!\n", __func__);
return NULL; return NULL;
}
value->type = IAS_INTEGER; value->type = IAS_INTEGER;
value->len = 4; value->len = 4;
...@@ -467,16 +465,14 @@ struct ias_value *irias_new_string_value(char *string) ...@@ -467,16 +465,14 @@ struct ias_value *irias_new_string_value(char *string)
struct ias_value *value; struct ias_value *value;
value = kzalloc(sizeof(struct ias_value), GFP_ATOMIC); value = kzalloc(sizeof(struct ias_value), GFP_ATOMIC);
if (value == NULL) { if (value == NULL)
IRDA_WARNING("%s: Unable to kmalloc!\n", __func__);
return NULL; return NULL;
}
value->type = IAS_STRING; value->type = IAS_STRING;
value->charset = CS_ASCII; value->charset = CS_ASCII;
value->t.string = kstrndup(string, IAS_MAX_STRING, GFP_ATOMIC); value->t.string = kstrndup(string, IAS_MAX_STRING, GFP_ATOMIC);
if (!value->t.string) { if (!value->t.string) {
IRDA_WARNING("%s: Unable to kmalloc!\n", __func__); net_warn_ratelimited("%s: Unable to kmalloc!\n", __func__);
kfree(value); kfree(value);
return NULL; return NULL;
} }
...@@ -498,10 +494,8 @@ struct ias_value *irias_new_octseq_value(__u8 *octseq , int len) ...@@ -498,10 +494,8 @@ struct ias_value *irias_new_octseq_value(__u8 *octseq , int len)
struct ias_value *value; struct ias_value *value;
value = kzalloc(sizeof(struct ias_value), GFP_ATOMIC); value = kzalloc(sizeof(struct ias_value), GFP_ATOMIC);
if (value == NULL) { if (value == NULL)
IRDA_WARNING("%s: Unable to kmalloc!\n", __func__);
return NULL; return NULL;
}
value->type = IAS_OCT_SEQ; value->type = IAS_OCT_SEQ;
/* Check length */ /* Check length */
...@@ -511,7 +505,7 @@ struct ias_value *irias_new_octseq_value(__u8 *octseq , int len) ...@@ -511,7 +505,7 @@ struct ias_value *irias_new_octseq_value(__u8 *octseq , int len)
value->t.oct_seq = kmemdup(octseq, len, GFP_ATOMIC); value->t.oct_seq = kmemdup(octseq, len, GFP_ATOMIC);
if (value->t.oct_seq == NULL){ if (value->t.oct_seq == NULL){
IRDA_WARNING("%s: Unable to kmalloc!\n", __func__); net_warn_ratelimited("%s: Unable to kmalloc!\n", __func__);
kfree(value); kfree(value);
return NULL; return NULL;
} }
...@@ -523,10 +517,8 @@ struct ias_value *irias_new_missing_value(void) ...@@ -523,10 +517,8 @@ struct ias_value *irias_new_missing_value(void)
struct ias_value *value; struct ias_value *value;
value = kzalloc(sizeof(struct ias_value), GFP_ATOMIC); value = kzalloc(sizeof(struct ias_value), GFP_ATOMIC);
if (value == NULL) { if (value == NULL)
IRDA_WARNING("%s: Unable to kmalloc!\n", __func__);
return NULL; return NULL;
}
value->type = IAS_MISSING; value->type = IAS_MISSING;
......
...@@ -323,34 +323,34 @@ static void print_ret_code(__u8 code) ...@@ -323,34 +323,34 @@ static void print_ret_code(__u8 code)
printk(KERN_INFO "Success\n"); printk(KERN_INFO "Success\n");
break; break;
case 1: case 1:
IRDA_WARNING("IrLAN: Insufficient resources\n"); net_warn_ratelimited("IrLAN: Insufficient resources\n");
break; break;
case 2: case 2:
IRDA_WARNING("IrLAN: Invalid command format\n"); net_warn_ratelimited("IrLAN: Invalid command format\n");
break; break;
case 3: case 3:
IRDA_WARNING("IrLAN: Command not supported\n"); net_warn_ratelimited("IrLAN: Command not supported\n");
break; break;
case 4: case 4:
IRDA_WARNING("IrLAN: Parameter not supported\n"); net_warn_ratelimited("IrLAN: Parameter not supported\n");
break; break;
case 5: case 5:
IRDA_WARNING("IrLAN: Value not supported\n"); net_warn_ratelimited("IrLAN: Value not supported\n");
break; break;
case 6: case 6:
IRDA_WARNING("IrLAN: Not open\n"); net_warn_ratelimited("IrLAN: Not open\n");
break; break;
case 7: case 7:
IRDA_WARNING("IrLAN: Authentication required\n"); net_warn_ratelimited("IrLAN: Authentication required\n");
break; break;
case 8: case 8:
IRDA_WARNING("IrLAN: Invalid password\n"); net_warn_ratelimited("IrLAN: Invalid password\n");
break; break;
case 9: case 9:
IRDA_WARNING("IrLAN: Protocol error\n"); net_warn_ratelimited("IrLAN: Protocol error\n");
break; break;
case 255: case 255:
IRDA_WARNING("IrLAN: Asynchronous status\n"); net_warn_ratelimited("IrLAN: Asynchronous status\n");
break; break;
} }
} }
...@@ -380,7 +380,7 @@ void irlan_client_parse_response(struct irlan_cb *self, struct sk_buff *skb) ...@@ -380,7 +380,7 @@ void irlan_client_parse_response(struct irlan_cb *self, struct sk_buff *skb)
IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;);
if (!skb) { if (!skb) {
IRDA_ERROR("%s(), Got NULL skb!\n", __func__); net_err_ratelimited("%s(), Got NULL skb!\n", __func__);
return; return;
} }
frame = skb->data; frame = skb->data;
......
...@@ -100,8 +100,8 @@ static int irlan_client_state_idle(struct irlan_cb *self, IRLAN_EVENT event, ...@@ -100,8 +100,8 @@ static int irlan_client_state_idle(struct irlan_cb *self, IRLAN_EVENT event,
switch (event) { switch (event) {
case IRLAN_DISCOVERY_INDICATION: case IRLAN_DISCOVERY_INDICATION:
if (self->client.iriap) { if (self->client.iriap) {
IRDA_WARNING("%s(), busy with a previous query\n", net_warn_ratelimited("%s(), busy with a previous query\n",
__func__); __func__);
return -EBUSY; return -EBUSY;
} }
......
...@@ -437,7 +437,8 @@ static void irlan_disconnect_indication(void *instance, ...@@ -437,7 +437,8 @@ static void irlan_disconnect_indication(void *instance,
IRDA_DEBUG(2, "%s(), IrLMP connect failed\n", __func__ ); IRDA_DEBUG(2, "%s(), IrLMP connect failed\n", __func__ );
break; break;
default: default:
IRDA_ERROR("%s(), Unknown disconnect reason\n", __func__); net_err_ratelimited("%s(), Unknown disconnect reason\n",
__func__);
break; break;
} }
......
...@@ -320,7 +320,7 @@ static void irlan_eth_set_multicast_list(struct net_device *dev) ...@@ -320,7 +320,7 @@ static void irlan_eth_set_multicast_list(struct net_device *dev)
if (dev->flags & IFF_PROMISC) { if (dev->flags & IFF_PROMISC) {
/* Enable promiscuous mode */ /* Enable promiscuous mode */
IRDA_WARNING("Promiscuous mode not implemented by IrLAN!\n"); net_warn_ratelimited("Promiscuous mode not implemented by IrLAN!\n");
} else if ((dev->flags & IFF_ALLMULTI) || } else if ((dev->flags & IFF_ALLMULTI) ||
netdev_mc_count(dev) > HW_MAX_ADDRS) { netdev_mc_count(dev) > HW_MAX_ADDRS) {
/* Disable promiscuous mode, use normal mode. */ /* Disable promiscuous mode, use normal mode. */
......
...@@ -85,8 +85,8 @@ int __init irlap_init(void) ...@@ -85,8 +85,8 @@ int __init irlap_init(void)
/* Allocate master array */ /* Allocate master array */
irlap = hashbin_new(HB_LOCK); irlap = hashbin_new(HB_LOCK);
if (irlap == NULL) { if (irlap == NULL) {
IRDA_ERROR("%s: can't allocate irlap hashbin!\n", net_err_ratelimited("%s: can't allocate irlap hashbin!\n",
__func__); __func__);
return -ENOMEM; return -ENOMEM;
} }
...@@ -491,7 +491,8 @@ void irlap_disconnect_indication(struct irlap_cb *self, LAP_REASON reason) ...@@ -491,7 +491,8 @@ void irlap_disconnect_indication(struct irlap_cb *self, LAP_REASON reason)
reason, NULL); reason, NULL);
break; break;
default: default:
IRDA_ERROR("%s: Unknown reason %d\n", __func__, reason); net_err_ratelimited("%s: Unknown reason %d\n",
__func__, reason);
} }
} }
...@@ -540,8 +541,8 @@ void irlap_discovery_request(struct irlap_cb *self, discovery_t *discovery) ...@@ -540,8 +541,8 @@ void irlap_discovery_request(struct irlap_cb *self, discovery_t *discovery)
self->discovery_log = hashbin_new(HB_NOLOCK); self->discovery_log = hashbin_new(HB_NOLOCK);
if (self->discovery_log == NULL) { if (self->discovery_log == NULL) {
IRDA_WARNING("%s(), Unable to allocate discovery log!\n", net_warn_ratelimited("%s(), Unable to allocate discovery log!\n",
__func__); __func__);
return; return;
} }
...@@ -625,10 +626,10 @@ void irlap_status_indication(struct irlap_cb *self, int quality_of_link) ...@@ -625,10 +626,10 @@ void irlap_status_indication(struct irlap_cb *self, int quality_of_link)
{ {
switch (quality_of_link) { switch (quality_of_link) {
case STATUS_NO_ACTIVITY: case STATUS_NO_ACTIVITY:
IRDA_MESSAGE("IrLAP, no activity on link!\n"); net_info_ratelimited("IrLAP, no activity on link!\n");
break; break;
case STATUS_NOISY: case STATUS_NOISY:
IRDA_MESSAGE("IrLAP, noisy link!\n"); net_info_ratelimited("IrLAP, noisy link!\n");
break; break;
default: default:
break; break;
......
...@@ -572,9 +572,8 @@ static int irlap_state_query(struct irlap_cb *self, IRLAP_EVENT event, ...@@ -572,9 +572,8 @@ static int irlap_state_query(struct irlap_cb *self, IRLAP_EVENT event,
info->discovery->data.daddr); info->discovery->data.daddr);
if (!self->discovery_log) { if (!self->discovery_log) {
IRDA_WARNING("%s: discovery log is gone! " net_warn_ratelimited("%s: discovery log is gone! maybe the discovery timeout has been set too short?\n",
"maybe the discovery timeout has been set" __func__);
" too short?\n", __func__);
break; break;
} }
hashbin_insert(self->discovery_log, hashbin_insert(self->discovery_log,
......
...@@ -421,7 +421,7 @@ static void irlap_recv_discovery_xid_rsp(struct irlap_cb *self, ...@@ -421,7 +421,7 @@ static void irlap_recv_discovery_xid_rsp(struct irlap_cb *self,
IRDA_ASSERT(self->magic == LAP_MAGIC, return;); IRDA_ASSERT(self->magic == LAP_MAGIC, return;);
if (!pskb_may_pull(skb, sizeof(struct xid_frame))) { if (!pskb_may_pull(skb, sizeof(struct xid_frame))) {
IRDA_ERROR("%s: frame too short!\n", __func__); net_err_ratelimited("%s: frame too short!\n", __func__);
return; return;
} }
...@@ -438,7 +438,7 @@ static void irlap_recv_discovery_xid_rsp(struct irlap_cb *self, ...@@ -438,7 +438,7 @@ static void irlap_recv_discovery_xid_rsp(struct irlap_cb *self,
} }
if ((discovery = kzalloc(sizeof(discovery_t), GFP_ATOMIC)) == NULL) { if ((discovery = kzalloc(sizeof(discovery_t), GFP_ATOMIC)) == NULL) {
IRDA_WARNING("%s: kmalloc failed!\n", __func__); net_warn_ratelimited("%s: kmalloc failed!\n", __func__);
return; return;
} }
...@@ -492,7 +492,7 @@ static void irlap_recv_discovery_xid_cmd(struct irlap_cb *self, ...@@ -492,7 +492,7 @@ static void irlap_recv_discovery_xid_cmd(struct irlap_cb *self,
char *text; char *text;
if (!pskb_may_pull(skb, sizeof(struct xid_frame))) { if (!pskb_may_pull(skb, sizeof(struct xid_frame))) {
IRDA_ERROR("%s: frame too short!\n", __func__); net_err_ratelimited("%s: frame too short!\n", __func__);
return; return;
} }
...@@ -536,8 +536,8 @@ static void irlap_recv_discovery_xid_cmd(struct irlap_cb *self, ...@@ -536,8 +536,8 @@ static void irlap_recv_discovery_xid_cmd(struct irlap_cb *self,
/* Check if things are sane at this point... */ /* Check if things are sane at this point... */
if((discovery_info == NULL) || if((discovery_info == NULL) ||
!pskb_may_pull(skb, 3)) { !pskb_may_pull(skb, 3)) {
IRDA_ERROR("%s: discovery frame too short!\n", net_err_ratelimited("%s: discovery frame too short!\n",
__func__); __func__);
return; return;
} }
...@@ -545,10 +545,8 @@ static void irlap_recv_discovery_xid_cmd(struct irlap_cb *self, ...@@ -545,10 +545,8 @@ static void irlap_recv_discovery_xid_cmd(struct irlap_cb *self,
* We now have some discovery info to deliver! * We now have some discovery info to deliver!
*/ */
discovery = kzalloc(sizeof(discovery_t), GFP_ATOMIC); discovery = kzalloc(sizeof(discovery_t), GFP_ATOMIC);
if (!discovery) { if (!discovery)
IRDA_WARNING("%s: unable to malloc!\n", __func__);
return; return;
}
discovery->data.daddr = info->daddr; discovery->data.daddr = info->daddr;
discovery->data.saddr = self->saddr; discovery->data.saddr = self->saddr;
...@@ -1170,7 +1168,7 @@ static void irlap_recv_frmr_frame(struct irlap_cb *self, struct sk_buff *skb, ...@@ -1170,7 +1168,7 @@ static void irlap_recv_frmr_frame(struct irlap_cb *self, struct sk_buff *skb,
IRDA_ASSERT(info != NULL, return;); IRDA_ASSERT(info != NULL, return;);
if (!pskb_may_pull(skb, 4)) { if (!pskb_may_pull(skb, 4)) {
IRDA_ERROR("%s: frame too short!\n", __func__); net_err_ratelimited("%s: frame too short!\n", __func__);
return; return;
} }
...@@ -1259,7 +1257,7 @@ static void irlap_recv_test_frame(struct irlap_cb *self, struct sk_buff *skb, ...@@ -1259,7 +1257,7 @@ static void irlap_recv_test_frame(struct irlap_cb *self, struct sk_buff *skb,
IRDA_DEBUG(2, "%s()\n", __func__); IRDA_DEBUG(2, "%s()\n", __func__);
if (!pskb_may_pull(skb, sizeof(*frame))) { if (!pskb_may_pull(skb, sizeof(*frame))) {
IRDA_ERROR("%s: frame too short!\n", __func__); net_err_ratelimited("%s: frame too short!\n", __func__);
return; return;
} }
frame = (struct test_frame *) skb->data; frame = (struct test_frame *) skb->data;
...@@ -1328,13 +1326,13 @@ int irlap_driver_rcv(struct sk_buff *skb, struct net_device *dev, ...@@ -1328,13 +1326,13 @@ int irlap_driver_rcv(struct sk_buff *skb, struct net_device *dev,
* share and non linear skbs. This should never happen, so * share and non linear skbs. This should never happen, so
* we don't need to be clever about it. Jean II */ * we don't need to be clever about it. Jean II */
if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL) { if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL) {
IRDA_ERROR("%s: can't clone shared skb!\n", __func__); net_err_ratelimited("%s: can't clone shared skb!\n", __func__);
goto err; goto err;
} }
/* Check if frame is large enough for parsing */ /* Check if frame is large enough for parsing */
if (!pskb_may_pull(skb, 2)) { if (!pskb_may_pull(skb, 2)) {
IRDA_ERROR("%s: frame too short!\n", __func__); net_err_ratelimited("%s: frame too short!\n", __func__);
goto err; goto err;
} }
...@@ -1383,8 +1381,8 @@ int irlap_driver_rcv(struct sk_buff *skb, struct net_device *dev, ...@@ -1383,8 +1381,8 @@ int irlap_driver_rcv(struct sk_buff *skb, struct net_device *dev,
irlap_recv_srej_frame(self, skb, &info, command); irlap_recv_srej_frame(self, skb, &info, command);
break; break;
default: default:
IRDA_WARNING("%s: Unknown S-frame %02x received!\n", net_warn_ratelimited("%s: Unknown S-frame %02x received!\n",
__func__, info.control); __func__, info.control);
break; break;
} }
goto out; goto out;
...@@ -1421,8 +1419,8 @@ int irlap_driver_rcv(struct sk_buff *skb, struct net_device *dev, ...@@ -1421,8 +1419,8 @@ int irlap_driver_rcv(struct sk_buff *skb, struct net_device *dev,
irlap_recv_ui_frame(self, skb, &info); irlap_recv_ui_frame(self, skb, &info);
break; break;
default: default:
IRDA_WARNING("%s: Unknown frame %02x received!\n", net_warn_ratelimited("%s: Unknown frame %02x received!\n",
__func__, info.control); __func__, info.control);
break; break;
} }
out: out:
......
...@@ -170,10 +170,8 @@ struct lsap_cb *irlmp_open_lsap(__u8 slsap_sel, notify_t *notify, __u8 pid) ...@@ -170,10 +170,8 @@ struct lsap_cb *irlmp_open_lsap(__u8 slsap_sel, notify_t *notify, __u8 pid)
/* Allocate new instance of a LSAP connection */ /* Allocate new instance of a LSAP connection */
self = kzalloc(sizeof(struct lsap_cb), GFP_ATOMIC); self = kzalloc(sizeof(struct lsap_cb), GFP_ATOMIC);
if (self == NULL) { if (self == NULL)
IRDA_ERROR("%s: can't allocate memory\n", __func__);
return NULL; return NULL;
}
self->magic = LMP_LSAP_MAGIC; self->magic = LMP_LSAP_MAGIC;
self->slsap_sel = slsap_sel; self->slsap_sel = slsap_sel;
...@@ -297,10 +295,8 @@ void irlmp_register_link(struct irlap_cb *irlap, __u32 saddr, notify_t *notify) ...@@ -297,10 +295,8 @@ void irlmp_register_link(struct irlap_cb *irlap, __u32 saddr, notify_t *notify)
* Allocate new instance of a LSAP connection * Allocate new instance of a LSAP connection
*/ */
lap = kzalloc(sizeof(struct lap_cb), GFP_KERNEL); lap = kzalloc(sizeof(struct lap_cb), GFP_KERNEL);
if (lap == NULL) { if (lap == NULL)
IRDA_ERROR("%s: unable to kmalloc\n", __func__);
return; return;
}
lap->irlap = irlap; lap->irlap = irlap;
lap->magic = LMP_LAP_MAGIC; lap->magic = LMP_LAP_MAGIC;
...@@ -311,7 +307,8 @@ void irlmp_register_link(struct irlap_cb *irlap, __u32 saddr, notify_t *notify) ...@@ -311,7 +307,8 @@ void irlmp_register_link(struct irlap_cb *irlap, __u32 saddr, notify_t *notify)
#endif #endif
lap->lsaps = hashbin_new(HB_LOCK); lap->lsaps = hashbin_new(HB_LOCK);
if (lap->lsaps == NULL) { if (lap->lsaps == NULL) {
IRDA_WARNING("%s(), unable to kmalloc lsaps\n", __func__); net_warn_ratelimited("%s(), unable to kmalloc lsaps\n",
__func__);
kfree(lap); kfree(lap);
return; return;
} }
...@@ -852,8 +849,8 @@ void irlmp_do_discovery(int nslots) ...@@ -852,8 +849,8 @@ void irlmp_do_discovery(int nslots)
/* Make sure the value is sane */ /* Make sure the value is sane */
if ((nslots != 1) && (nslots != 6) && (nslots != 8) && (nslots != 16)){ if ((nslots != 1) && (nslots != 6) && (nslots != 8) && (nslots != 16)){
IRDA_WARNING("%s: invalid value for number of slots!\n", net_warn_ratelimited("%s: invalid value for number of slots!\n",
__func__); __func__);
nslots = sysctl_discovery_slots = 8; nslots = sysctl_discovery_slots = 8;
} }
...@@ -1799,8 +1796,8 @@ static __u8 irlmp_find_free_slsap(void) ...@@ -1799,8 +1796,8 @@ static __u8 irlmp_find_free_slsap(void)
/* Make sure we terminate the loop */ /* Make sure we terminate the loop */
if (wrapped++) { if (wrapped++) {
IRDA_ERROR("%s: no more free LSAPs !\n", net_err_ratelimited("%s: no more free LSAPs !\n",
__func__); __func__);
return 0; return 0;
} }
} }
......
...@@ -508,8 +508,8 @@ static int irlmp_state_disconnected(struct lsap_cb *self, IRLMP_EVENT event, ...@@ -508,8 +508,8 @@ static int irlmp_state_disconnected(struct lsap_cb *self, IRLMP_EVENT event,
IRDA_DEBUG(4, "%s(), LM_CONNECT_REQUEST\n", __func__); IRDA_DEBUG(4, "%s(), LM_CONNECT_REQUEST\n", __func__);
if (self->conn_skb) { if (self->conn_skb) {
IRDA_WARNING("%s: busy with another request!\n", net_warn_ratelimited("%s: busy with another request!\n",
__func__); __func__);
return -EBUSY; return -EBUSY;
} }
/* Don't forget to refcount it (see irlmp_connect_request()) */ /* Don't forget to refcount it (see irlmp_connect_request()) */
...@@ -525,8 +525,8 @@ static int irlmp_state_disconnected(struct lsap_cb *self, IRLMP_EVENT event, ...@@ -525,8 +525,8 @@ static int irlmp_state_disconnected(struct lsap_cb *self, IRLMP_EVENT event,
break; break;
case LM_CONNECT_INDICATION: case LM_CONNECT_INDICATION:
if (self->conn_skb) { if (self->conn_skb) {
IRDA_WARNING("%s: busy with another request!\n", net_warn_ratelimited("%s: busy with another request!\n",
__func__); __func__);
return -EBUSY; return -EBUSY;
} }
/* Don't forget to refcount it (see irlap_driver_rcv()) */ /* Don't forget to refcount it (see irlap_driver_rcv()) */
......
...@@ -96,8 +96,8 @@ int __init irttp_init(void) ...@@ -96,8 +96,8 @@ int __init irttp_init(void)
irttp->tsaps = hashbin_new(HB_LOCK); irttp->tsaps = hashbin_new(HB_LOCK);
if (!irttp->tsaps) { if (!irttp->tsaps) {
IRDA_ERROR("%s: can't allocate IrTTP hashbin!\n", net_err_ratelimited("%s: can't allocate IrTTP hashbin!\n",
__func__); __func__);
kfree(irttp); kfree(irttp);
return -ENOMEM; return -ENOMEM;
} }
...@@ -518,8 +518,8 @@ int irttp_close_tsap(struct tsap_cb *self) ...@@ -518,8 +518,8 @@ int irttp_close_tsap(struct tsap_cb *self)
if (self->connected) { if (self->connected) {
/* Check if disconnect is not pending */ /* Check if disconnect is not pending */
if (!test_bit(0, &self->disconnect_pend)) { if (!test_bit(0, &self->disconnect_pend)) {
IRDA_WARNING("%s: TSAP still connected!\n", net_warn_ratelimited("%s: TSAP still connected!\n",
__func__); __func__);
irttp_disconnect_request(self, NULL, P_NORMAL); irttp_disconnect_request(self, NULL, P_NORMAL);
} }
self->close_pend = TRUE; self->close_pend = TRUE;
...@@ -568,13 +568,14 @@ int irttp_udata_request(struct tsap_cb *self, struct sk_buff *skb) ...@@ -568,13 +568,14 @@ int irttp_udata_request(struct tsap_cb *self, struct sk_buff *skb)
/* Check that nothing bad happens */ /* Check that nothing bad happens */
if (!self->connected) { if (!self->connected) {
IRDA_WARNING("%s(), Not connected\n", __func__); net_warn_ratelimited("%s(), Not connected\n", __func__);
ret = -ENOTCONN; ret = -ENOTCONN;
goto err; goto err;
} }
if (skb->len > self->max_seg_size) { if (skb->len > self->max_seg_size) {
IRDA_ERROR("%s(), UData is too large for IrLAP!\n", __func__); net_err_ratelimited("%s(), UData is too large for IrLAP!\n",
__func__);
ret = -EMSGSIZE; ret = -EMSGSIZE;
goto err; goto err;
} }
...@@ -617,7 +618,7 @@ int irttp_data_request(struct tsap_cb *self, struct sk_buff *skb) ...@@ -617,7 +618,7 @@ int irttp_data_request(struct tsap_cb *self, struct sk_buff *skb)
/* Check that nothing bad happens */ /* Check that nothing bad happens */
if (!self->connected) { if (!self->connected) {
IRDA_WARNING("%s: Not connected\n", __func__); net_warn_ratelimited("%s: Not connected\n", __func__);
ret = -ENOTCONN; ret = -ENOTCONN;
goto err; goto err;
} }
...@@ -627,8 +628,8 @@ int irttp_data_request(struct tsap_cb *self, struct sk_buff *skb) ...@@ -627,8 +628,8 @@ int irttp_data_request(struct tsap_cb *self, struct sk_buff *skb)
* inside an IrLAP frame * inside an IrLAP frame
*/ */
if ((self->tx_max_sdu_size == 0) && (skb->len > self->max_seg_size)) { if ((self->tx_max_sdu_size == 0) && (skb->len > self->max_seg_size)) {
IRDA_ERROR("%s: SAR disabled, and data is too large for IrLAP!\n", net_err_ratelimited("%s: SAR disabled, and data is too large for IrLAP!\n",
__func__); __func__);
ret = -EMSGSIZE; ret = -EMSGSIZE;
goto err; goto err;
} }
...@@ -640,8 +641,8 @@ int irttp_data_request(struct tsap_cb *self, struct sk_buff *skb) ...@@ -640,8 +641,8 @@ int irttp_data_request(struct tsap_cb *self, struct sk_buff *skb)
if ((self->tx_max_sdu_size != 0) && if ((self->tx_max_sdu_size != 0) &&
(self->tx_max_sdu_size != TTP_SAR_UNBOUND) && (self->tx_max_sdu_size != TTP_SAR_UNBOUND) &&
(skb->len > self->tx_max_sdu_size)) { (skb->len > self->tx_max_sdu_size)) {
IRDA_ERROR("%s: SAR enabled, but data is larger than TxMaxSduSize!\n", net_err_ratelimited("%s: SAR enabled, but data is larger than TxMaxSduSize!\n",
__func__); __func__);
ret = -EMSGSIZE; ret = -EMSGSIZE;
goto err; goto err;
} }
...@@ -1249,8 +1250,8 @@ static void irttp_connect_confirm(void *instance, void *sap, ...@@ -1249,8 +1250,8 @@ static void irttp_connect_confirm(void *instance, void *sap,
/* Any errors in the parameter list? */ /* Any errors in the parameter list? */
if (ret < 0) { if (ret < 0) {
IRDA_WARNING("%s: error extracting parameters\n", net_warn_ratelimited("%s: error extracting parameters\n",
__func__); __func__);
dev_kfree_skb(skb); dev_kfree_skb(skb);
/* Do not accept this connection attempt */ /* Do not accept this connection attempt */
...@@ -1326,8 +1327,8 @@ static void irttp_connect_indication(void *instance, void *sap, ...@@ -1326,8 +1327,8 @@ static void irttp_connect_indication(void *instance, void *sap,
/* Any errors in the parameter list? */ /* Any errors in the parameter list? */
if (ret < 0) { if (ret < 0) {
IRDA_WARNING("%s: error extracting parameters\n", net_warn_ratelimited("%s: error extracting parameters\n",
__func__); __func__);
dev_kfree_skb(skb); dev_kfree_skb(skb);
/* Do not accept this connection attempt */ /* Do not accept this connection attempt */
......
...@@ -158,8 +158,8 @@ static int irda_insert_integer(void *self, __u8 *buf, int len, __u8 pi, ...@@ -158,8 +158,8 @@ static int irda_insert_integer(void *self, __u8 *buf, int len, __u8 pi,
} }
/* Check if buffer is long enough for insertion */ /* Check if buffer is long enough for insertion */
if (len < (2+p.pl)) { if (len < (2+p.pl)) {
IRDA_WARNING("%s: buffer too short for insertion!\n", net_warn_ratelimited("%s: buffer too short for insertion!\n",
__func__); __func__);
return -1; return -1;
} }
IRDA_DEBUG(2, "%s(), pi=%#x, pl=%d, pi=%d\n", __func__, IRDA_DEBUG(2, "%s(), pi=%#x, pl=%d, pi=%d\n", __func__,
...@@ -184,8 +184,8 @@ static int irda_insert_integer(void *self, __u8 *buf, int len, __u8 pi, ...@@ -184,8 +184,8 @@ static int irda_insert_integer(void *self, __u8 *buf, int len, __u8 pi,
break; break;
default: default:
IRDA_WARNING("%s: length %d not supported\n", net_warn_ratelimited("%s: length %d not supported\n",
__func__, p.pl); __func__, p.pl);
/* Skip parameter */ /* Skip parameter */
return -1; return -1;
} }
...@@ -214,9 +214,8 @@ static int irda_extract_integer(void *self, __u8 *buf, int len, __u8 pi, ...@@ -214,9 +214,8 @@ static int irda_extract_integer(void *self, __u8 *buf, int len, __u8 pi,
/* Check if buffer is long enough for parsing */ /* Check if buffer is long enough for parsing */
if (len < (2+p.pl)) { if (len < (2+p.pl)) {
IRDA_WARNING("%s: buffer too short for parsing! " net_warn_ratelimited("%s: buffer too short for parsing! Need %d bytes, but len is only %d\n",
"Need %d bytes, but len is only %d\n", __func__, p.pl, len);
__func__, p.pl, len);
return -1; return -1;
} }
...@@ -226,9 +225,8 @@ static int irda_extract_integer(void *self, __u8 *buf, int len, __u8 pi, ...@@ -226,9 +225,8 @@ static int irda_extract_integer(void *self, __u8 *buf, int len, __u8 pi,
* PV_INTEGER means that the handler is flexible. * PV_INTEGER means that the handler is flexible.
*/ */
if (((type & PV_MASK) != PV_INTEGER) && ((type & PV_MASK) != p.pl)) { if (((type & PV_MASK) != PV_INTEGER) && ((type & PV_MASK) != p.pl)) {
IRDA_ERROR("%s: invalid parameter length! " net_err_ratelimited("%s: invalid parameter length! Expected %d bytes, but value had %d bytes!\n",
"Expected %d bytes, but value had %d bytes!\n", __func__, type & PV_MASK, p.pl);
__func__, type & PV_MASK, p.pl);
/* Most parameters are bit/byte fields or little endian, /* Most parameters are bit/byte fields or little endian,
* so it's ok to only extract a subset of it (the subset * so it's ok to only extract a subset of it (the subset
...@@ -265,8 +263,8 @@ static int irda_extract_integer(void *self, __u8 *buf, int len, __u8 pi, ...@@ -265,8 +263,8 @@ static int irda_extract_integer(void *self, __u8 *buf, int len, __u8 pi,
le32_to_cpus(&p.pv.i); le32_to_cpus(&p.pv.i);
break; break;
default: default:
IRDA_WARNING("%s: length %d not supported\n", net_warn_ratelimited("%s: length %d not supported\n",
__func__, p.pl); __func__, p.pl);
/* Skip parameter */ /* Skip parameter */
return p.pl+2; return p.pl+2;
...@@ -304,9 +302,8 @@ static int irda_extract_string(void *self, __u8 *buf, int len, __u8 pi, ...@@ -304,9 +302,8 @@ static int irda_extract_string(void *self, __u8 *buf, int len, __u8 pi,
/* Check if buffer is long enough for parsing */ /* Check if buffer is long enough for parsing */
if (len < (2+p.pl)) { if (len < (2+p.pl)) {
IRDA_WARNING("%s: buffer too short for parsing! " net_warn_ratelimited("%s: buffer too short for parsing! Need %d bytes, but len is only %d\n",
"Need %d bytes, but len is only %d\n", __func__, p.pl, len);
__func__, p.pl, len);
return -1; return -1;
} }
...@@ -343,9 +340,8 @@ static int irda_extract_octseq(void *self, __u8 *buf, int len, __u8 pi, ...@@ -343,9 +340,8 @@ static int irda_extract_octseq(void *self, __u8 *buf, int len, __u8 pi,
/* Check if buffer is long enough for parsing */ /* Check if buffer is long enough for parsing */
if (len < (2+p.pl)) { if (len < (2+p.pl)) {
IRDA_WARNING("%s: buffer too short for parsing! " net_warn_ratelimited("%s: buffer too short for parsing! Need %d bytes, but len is only %d\n",
"Need %d bytes, but len is only %d\n", __func__, p.pl, len);
__func__, p.pl, len);
return -1; return -1;
} }
...@@ -487,7 +483,8 @@ int irda_param_insert(void *self, __u8 pi, __u8 *buf, int len, ...@@ -487,7 +483,8 @@ int irda_param_insert(void *self, __u8 pi, __u8 *buf, int len,
/* Check if handler has been implemented */ /* Check if handler has been implemented */
if (!pi_minor_info->func) { if (!pi_minor_info->func) {
IRDA_MESSAGE("%s: no handler for pi=%#x\n", __func__, pi); net_info_ratelimited("%s: no handler for pi=%#x\n",
__func__, pi);
/* Skip this parameter */ /* Skip this parameter */
return -1; return -1;
} }
...@@ -544,8 +541,8 @@ static int irda_param_extract(void *self, __u8 *buf, int len, ...@@ -544,8 +541,8 @@ static int irda_param_extract(void *self, __u8 *buf, int len,
/* Check if handler has been implemented */ /* Check if handler has been implemented */
if (!pi_minor_info->func) { if (!pi_minor_info->func) {
IRDA_MESSAGE("%s: no handler for pi=%#x\n", net_info_ratelimited("%s: no handler for pi=%#x\n",
__func__, buf[n]); __func__, buf[n]);
/* Skip this parameter */ /* Skip this parameter */
return 2 + buf[n + 1]; /* Continue */ return 2 + buf[n + 1]; /* Continue */
} }
......
...@@ -200,8 +200,8 @@ static int msb_index (__u16 word) ...@@ -200,8 +200,8 @@ static int msb_index (__u16 word)
* able to check precisely what's going on. If a end user sees this, * able to check precisely what's going on. If a end user sees this,
* it's very likely the peer. - Jean II */ * it's very likely the peer. - Jean II */
if (word == 0) { if (word == 0) {
IRDA_WARNING("%s(), Detected buggy peer, adjust null PV to 0x1!\n", net_warn_ratelimited("%s(), Detected buggy peer, adjust null PV to 0x1!\n",
__func__); __func__);
/* The only safe choice (we don't know the array size) */ /* The only safe choice (we don't know the array size) */
word = 0x1; word = 0x1;
} }
...@@ -351,8 +351,8 @@ static void irlap_adjust_qos_settings(struct qos_info *qos) ...@@ -351,8 +351,8 @@ static void irlap_adjust_qos_settings(struct qos_info *qos)
if (sysctl_min_tx_turn_time > qos->min_turn_time.value) { if (sysctl_min_tx_turn_time > qos->min_turn_time.value) {
int i; int i;
IRDA_WARNING("%s(), Detected buggy peer, adjust mtt to %dus!\n", net_warn_ratelimited("%s(), Detected buggy peer, adjust mtt to %dus!\n",
__func__, sysctl_min_tx_turn_time); __func__, sysctl_min_tx_turn_time);
/* We don't really need bits, but easier this way */ /* We don't really need bits, but easier this way */
i = value_highest_bit(sysctl_min_tx_turn_time, min_turn_times, i = value_highest_bit(sysctl_min_tx_turn_time, min_turn_times,
...@@ -402,8 +402,8 @@ static void irlap_adjust_qos_settings(struct qos_info *qos) ...@@ -402,8 +402,8 @@ static void irlap_adjust_qos_settings(struct qos_info *qos)
IRDA_DEBUG(2, "%s(), reducing data size to %d\n", IRDA_DEBUG(2, "%s(), reducing data size to %d\n",
__func__, qos->data_size.value); __func__, qos->data_size.value);
} else { } else {
IRDA_WARNING("%s(), nothing more we can do!\n", net_warn_ratelimited("%s(), nothing more we can do!\n",
__func__); __func__);
} }
} }
#endif /* CONFIG_IRDA_DYNAMIC_WINDOW */ #endif /* CONFIG_IRDA_DYNAMIC_WINDOW */
......
...@@ -134,8 +134,8 @@ int async_wrap_skb(struct sk_buff *skb, __u8 *tx_buff, int buffsize) ...@@ -134,8 +134,8 @@ int async_wrap_skb(struct sk_buff *skb, __u8 *tx_buff, int buffsize)
* transmitted after this point is 5. * transmitted after this point is 5.
*/ */
if(n >= (buffsize-5)) { if(n >= (buffsize-5)) {
IRDA_ERROR("%s(), tx buffer overflow (n=%d)\n", net_err_ratelimited("%s(), tx buffer overflow (n=%d)\n",
__func__, n); __func__, n);
return n; return n;
} }
...@@ -386,7 +386,7 @@ async_unwrap_ce(struct net_device *dev, ...@@ -386,7 +386,7 @@ async_unwrap_ce(struct net_device *dev,
break; break;
case LINK_ESCAPE: case LINK_ESCAPE:
IRDA_WARNING("%s: state not defined\n", __func__); net_warn_ratelimited("%s: state not defined\n", __func__);
break; break;
case BEGIN_FRAME: case BEGIN_FRAME:
......
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