irda: Simplify IRDA logging macros
Subsystems (2)
PATCH 1/1 irda: Simplify IRDA logging macros
These are the same as net_<level>_ratelimited, so use the more common style in the macro definition.
---
I wonder if the IRDA_ macro uses should be converted directly instead but that diffstat is quite a bit longer than this one
42 files changed, 486 insertions(+), 479 deletions(-) vs include/net/irda/irda.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
include/net/irda/irda.h +3 -3
@@ -77,9 +77,9 @@ do { if(!(expr)) { \#define IRDA_ASSERT_LABEL (label)#endif /* CONFIG_IRDA_DEBUG */ -#define IRDA_WARNING(args...) do { if (net_ratelimit()) printk(KERN_WARNING args); } while (0) -#define IRDA_MESSAGE(args...) do { if (net_ratelimit()) printk(KERN_INFO args); } while (0) -#define IRDA_ERROR(args...) do { if (net_ratelimit()) printk(KERN_ERR args); } while (0) +#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
From: Joe Perches <[email protected]>
Date: Tue, 11 Nov 2014 13:13:41 -0800
Quoted 4 lines
These are the same as net_<level>_ratelimited, so use the more common style in the macro definition.
Signed-off-by Joe Perches <[email protected]>
Applied, thanks Joe.
Quoted 3 lines
I wonder if the
IRDA_macro uses should be converted directly instead but that diffstat is quite a bit longer than this one
You can do that as a follow-on patch if you want. Macros that just provide another name for a well understood generic facility are really something to get rid of.
PATCH 1/1 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.
---
Some long line warnings still exist for individual variables. switch/case style was also not changed.
drivers/net/irda/act200l-sir.c | 3 +- drivers/net/irda/ali-ircc.c | 57 ++++++++-------- drivers/net/irda/girbil-sir.c | 6 +- drivers/net/irda/irda-usb.c | 47 +++++++------ drivers/net/irda/irtty-sir.c | 10 +-- drivers/net/irda/ma600-sir.c | 6 +- drivers/net/irda/mcp2120-sir.c | 6 +- drivers/net/irda/mcs7780.c | 45 +++++++------ drivers/net/irda/nsc-ircc.c | 66 +++++++++--------- drivers/net/irda/sir_dev.c | 35 +++++----- drivers/net/irda/smsc-ircc2.c | 130 +++++++++++++++++++----------------- drivers/net/irda/tekram-sir.c | 3 +- drivers/net/irda/via-ircc.c | 21 +++--- drivers/net/irda/vlsi_ir.c | 118 +++++++++++++++++--------------- drivers/net/irda/vlsi_ir.h | 3 +- drivers/net/irda/w83977af_ir.c | 9 +-- include/net/irda/irda.h | 4 -- net/irda/af_irda.c | 34 +++++----- net/irda/ircomm/ircomm_core.c | 5 +- net/irda/ircomm/ircomm_lmp.c | 2 +- net/irda/ircomm/ircomm_param.c | 3 +- net/irda/ircomm/ircomm_ttp.c | 10 +-- net/irda/ircomm/ircomm_tty.c | 21 +++--- net/irda/ircomm/ircomm_tty_attach.c | 12 ++-- net/irda/ircomm/ircomm_tty_ioctl.c | 3 +- net/irda/irda_device.c | 18 ++--- net/irda/iriap.c | 24 +++---- net/irda/iriap_event.c | 4 +- net/irda/irias_object.c | 64 ++++++++---------- net/irda/irlan/irlan_client.c | 22 +++--- net/irda/irlan/irlan_client_event.c | 4 +- net/irda/irlan/irlan_common.c | 3 +- net/irda/irlan/irlan_eth.c | 2 +- net/irda/irlap.c | 15 +++-- net/irda/irlap_event.c | 5 +- net/irda/irlap_frame.c | 30 ++++----- net/irda/irlmp.c | 19 +++--- net/irda/irlmp_event.c | 8 +-- net/irda/irttp.c | 31 ++++----- net/irda/parameters.c | 39 +++++------ net/irda/qos.c | 12 ++-- net/irda/wrapper.c | 6 +- 42 files changed, 486 insertions(+), 479 deletions(-)
drivers/net/irda/act200l-sir.c +2 -1
@@ -240,7 +240,8 @@ static int act200l_reset(struct sir_dev *dev) dev->speed =9600 ;break ;default : -IRDA_ERROR ("%s(), unknown state %d\n" , __func__, state); +net_err_ratelimited ("%s(), unknown state %d\n" , + __func__, state); ret =-1 ;break ; }
drivers/net/irda/ali-ircc.c +28 -29
146 lines not on this page · raw message
drivers/net/irda/girbil-sir.c +4 -2
@@ -179,7 +179,8 @@ static int girbil_change_speed(struct sir_dev *dev, unsigned speed)break ;default : -IRDA_ERROR ("%s - undefined state %d\n" , __func__, state); +net_err_ratelimited ("%s - undefined state %d\n" , + __func__, state); ret = -EINVAL ;break ; }
@@ -241,7 +242,8 @@ static int girbil_reset(struct sir_dev *dev)break ;default : -IRDA_ERROR ("%s(), undefined state %d\n" , __func__, state); +net_err_ratelimited ("%s(), undefined state %d\n" , + __func__, state); ret =-1 ;break ; }
drivers/net/irda/irda-usb.c +23 -24
150 lines not on this page · raw message
drivers/net/irda/irtty-sir.c +5 -5
@@ -231,7 +231,7 @@ static void irtty_receive_buf(struct tty_struct *tty, const unsigned char *cp, dev = priv->dev;if (!dev) { -IRDA_WARNING ("%s(), not ready yet!\n" , __func__); +net_warn_ratelimited ("%s(), not ready yet!\n" , __func__);return ; }
@@ -555,8 +555,8 @@ static int __init irtty_sir_init(void)int err;if ((err =tty_register_ldisc (N_IRDA , &irda_ldisc)) !=0 ) -IRDA_ERROR ("IrDA: can't register line discipline (err = %d)\n" , - err); +net_err_ratelimited ("IrDA: can't register line discipline (err = %d)\n" , + err);return err; }
@@ -565,8 +565,8 @@ static void __exit irtty_sir_cleanup(void)int err;if ((err =tty_unregister_ldisc (N_IRDA ))) { -IRDA_ERROR ("%s(), can't unregister line discipline (err = %d)\n" , - __func__, err); +net_err_ratelimited ("%s(), can't unregister line discipline (err = %d)\n" , + __func__, err); } }
drivers/net/irda/ma600-sir.c +3 -3
@@ -198,9 +198,9 @@ static int ma600_change_speed(struct sir_dev *dev, unsigned speed)sirdev_raw_read (dev, &byte,sizeof (byte));if (byte !=get_control_byte (speed)) { -IRDA_WARNING ("%s(): bad control byte read-back %02x != %02x\n" , - __func__, (unsigned ) byte, - (unsigned )get_control_byte (speed)); +net_warn_ratelimited ("%s(): bad control byte read-back %02x != %02x\n" , + __func__, (unsigned )byte, + (unsigned )get_control_byte (speed));return -1 ; }else
drivers/net/irda/mcp2120-sir.c +4 -2
@@ -155,7 +155,8 @@ static int mcp2120_change_speed(struct sir_dev *dev, unsigned speed)break ;default : -IRDA_ERROR ("%s(), undefine state %d\n" , __func__, state); +net_err_ratelimited ("%s(), undefine state %d\n" , + __func__, state); ret = -EINVAL ;break ; }
@@ -213,7 +214,8 @@ static int mcp2120_reset(struct sir_dev *dev)break ;default : -IRDA_ERROR ("%s(), undefined state %d\n" , __func__, state); +net_err_ratelimited ("%s(), undefined state %d\n" , + __func__, state); ret = -EINVAL ;break ; }
drivers/net/irda/mcs7780.c +23 -22
142 lines not on this page · raw message
drivers/net/irda/nsc-ircc.c +33 -33
169 lines not on this page · raw message
drivers/net/irda/sir_dev.c +19 -16
@@ -82,7 +82,7 @@ static int sirdev_tx_complete_fsm(struct sir_dev *dev)return 0 ;default : -IRDA_ERROR ("%s - undefined state\n" , __func__); +net_err_ratelimited ("%s - undefined state\n" , __func__);return -EINVAL ; } fsm->substate = next_state;
@@ -251,12 +251,13 @@ static void sirdev_config_fsm(struct work_struct *work)break ;default : -IRDA_ERROR ("%s - undefined state\n" , __func__); +net_err_ratelimited ("%s - undefined state\n" , __func__); fsm->result = -EINVAL ;/* fall thru */ 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 */ netif_stop_queue (dev->netdev);
@@ -299,7 +300,7 @@ int sirdev_schedule_request(struct sir_dev *dev, int initial_state, unsigned parif (fsm->state ==SIRDEV_STATE_DEAD ) {/* 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);return -ESTALE ;/* or better EPIPE? */ }
@@ -452,8 +453,8 @@ void sirdev_write_complete(struct sir_dev *dev) }else if (unlikely (actual<0 )) {/* could be dropped later when we have tx_timeout to recover */ -IRDA_ERROR ("%s: drv->do_write failed (%d)\n" , - __func__, actual); +net_err_ratelimited ("%s: drv->do_write failed (%d)\n" , + __func__, actual);if ((skb=dev->tx_skb) !=NULL ) { dev->tx_skb =NULL ;dev_kfree_skb_any (skb);
@@ -507,8 +508,8 @@ void sirdev_write_complete(struct sir_dev *dev)/* should never happen * forget the speed change and hope the stack recovers */ -IRDA_ERROR ("%s - schedule speed change failed: %d\n" , - __func__, err); +net_err_ratelimited ("%s - schedule speed change failed: %d\n" , + __func__, err);netif_wake_queue (dev->netdev); }/* else: success
@@ -535,13 +536,13 @@ EXPORT_SYMBOL(sirdev_write_complete);int sirdev_receive (struct sir_dev *dev,const unsigned char *cp,size_t count) {if (!dev || !dev->netdev) { -IRDA_WARNING ("%s(), not ready yet!\n" , __func__); +net_warn_ratelimited ("%s(), not ready yet!\n" , __func__);return -1 ; }if (!dev->irlap) { -IRDA_WARNING ("%s - too early: %p / %zd!\n" , - __func__, cp, count); +net_warn_ratelimited ("%s - too early: %p / %zd!\n" , + __func__, cp, count);return -1 ; }
@@ -661,8 +662,8 @@ static netdev_tx_t sirdev_hard_xmit(struct sk_buff *skb, }else if (unlikely (actual <0 )) {/* could be dropped later when we have tx_timeout to recover */ -IRDA_ERROR ("%s: drv->do_write failed (%d)\n" , - __func__, actual); +net_err_ratelimited ("%s: drv->do_write failed (%d)\n" , + __func__, actual);dev_kfree_skb_any (skb); dev->netdev->stats.tx_errors++; dev->netdev->stats.tx_dropped++;
@@ -894,7 +895,8 @@ struct sir_dev * sirdev_get_instance(const struct sir_driver *drv, const char *n*/ ndev =alloc_irdadev (sizeof (*dev));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; } dev =netdev_priv (ndev);
@@ -919,7 +921,8 @@ struct sir_dev * sirdev_get_instance(const struct sir_driver *drv, const char *n ndev->netdev_ops = &sirdev_ops;if (register_netdev (ndev)) { -IRDA_ERROR ("%s(), register_netdev() failed!\n" , __func__); +net_err_ratelimited ("%s(), register_netdev() failed!\n" , + __func__); goto out_freenetdev; }
@@ -946,7 +949,7 @@ int sirdev_put_instance(struct sir_dev *dev)if (dev->dongle_drv) err =sirdev_schedule_dongle_close (dev);if (err) -IRDA_ERROR ("%s - error %d\n" , __func__, err); +net_err_ratelimited ("%s - error %d\n" , __func__, err);sirdev_close (dev->netdev);
drivers/net/irda/smsc-ircc2.c +69 -61
343 lines not on this page · raw message
drivers/net/irda/tekram-sir.c +2 -1
@@ -179,7 +179,8 @@ static int tekram_change_speed(struct sir_dev *dev, unsigned speed)break ;default : -IRDA_ERROR ("%s - undefined state %d\n" , __func__, state); +net_err_ratelimited ("%s - undefined state %d\n" , + __func__, state); ret = -EINVAL ;break ; }
drivers/net/irda/via-ircc.c +11 -10
@@ -391,7 +391,8 @@ static int via_ircc_open(struct pci_dev *pdev, chipio_t *info, unsigned int id)if (err) 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.. */
@@ -510,7 +511,7 @@ static void via_hw_init(struct via_ircc_cb *self)*/ 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 */ }
@@ -652,8 +653,8 @@ static void via_ircc_change_dongle_speed(int iobase, int speed,break ;default : -IRDA_ERROR ("%s: Error: dongle_id %d unsupported !\n" , - __func__, dongle_id); +net_err_ratelimited ("%s: Error: dongle_id %d unsupported !\n" , + __func__, dongle_id); } }
@@ -1473,8 +1474,8 @@ static int via_ircc_net_open(struct net_device *dev) IRDA_ASSERT(self != NULL, return 0;); iobase = self->io.fir_base;if (request_irq (self->io.irq, via_ircc_interrupt,0 , dev->name, dev)) { -IRDA_WARNING ("%s, unable to allocate irq=%d\n" , driver_name, - self->io.irq); +net_warn_ratelimited ("%s, unable to allocate irq=%d\n" , + driver_name, self->io.irq);return -EAGAIN ; }/*
@@ -1482,15 +1483,15 @@ static int via_ircc_net_open(struct net_device *dev)* failure. */ if (request_dma (self->io.dma, dev->name)) { -IRDA_WARNING ("%s, unable to allocate dma=%d\n" , driver_name, - self->io.dma); +net_warn_ratelimited ("%s, unable to allocate dma=%d\n" , + driver_name, self->io.dma);free_irq (self->io.irq, dev);return -EAGAIN ; }if (self->io.dma2 != self->io.dma) {if (request_dma (self->io.dma2, dev->name)) { -IRDA_WARNING ("%s, unable to allocate dma2=%d\n" , - driver_name, self->io.dma2); +net_warn_ratelimited ("%s, unable to allocate dma2=%d\n" , + driver_name, self->io.dma2);free_irq (self->io.irq, dev);free_dma (self->io.dma);return -EAGAIN ;
drivers/net/irda/vlsi_ir.c +63 -55
322 lines not on this page · raw message
drivers/net/irda/vlsi_ir.h +2 -1
@@ -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 ) { -IRDA_ERROR ("%s: pci busaddr inconsistency!\n" , __func__); +net_err_ratelimited ("%s: pci busaddr inconsistency!\n" , + __func__);dump_stack ();return ; }
drivers/net/irda/w83977af_ir.c +5 -4
@@ -236,10 +236,11 @@ static int w83977af_open(int i, unsigned int iobase, unsigned int irq, err =register_netdev (dev);if (err) { -IRDA_ERROR ("%s(), register_netdevice() failed!\n" , __func__); +net_err_ratelimited ("%s(), register_netdevice() failed!\n" , + __func__); 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 */ dev_self[i] = self;
@@ -392,8 +393,8 @@ static int w83977af_probe(int iobase, int irq, int dma)switch_bank (iobase,SET7 );outb (0x40 , iobase+7 ); -IRDA_MESSAGE ("W83977AF (IR) driver loaded. " -"Version: 0x%02x\n" , version); +net_info_ratelimited ("W83977AF (IR) driver loaded. Version: 0x%02x\n" , + version);return 0 ; }else {
include/net/irda/irda.h +0 -4
@@ -77,10 +77,6 @@ do { if(!(expr)) { \#define IRDA_ASSERT_LABEL (label)#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 * give the best protection
net/irda/af_irda.c +17 -17
@@ -201,16 +201,16 @@ static void irda_connect_confirm(void *instance, void *sap,switch (sk->sk_type) {case SOCK_STREAM :if (max_sdu_size !=0 ) { -IRDA_ERROR ("%s: max_sdu_size must be 0\n" , - __func__); +net_err_ratelimited ("%s: max_sdu_size must be 0\n" , + __func__);return ; } self->max_data_size =irttp_get_max_seg_size (self->tsap);break ;case SOCK_SEQPACKET :if (max_sdu_size ==0 ) { -IRDA_ERROR ("%s: max_sdu_size cannot be 0\n" , - __func__); +net_err_ratelimited ("%s: max_sdu_size cannot be 0\n" , + __func__);return ; } self->max_data_size = max_sdu_size;
@@ -262,8 +262,8 @@ static void irda_connect_indication(void *instance, void *sap,switch (sk->sk_type) {case SOCK_STREAM :if (max_sdu_size !=0 ) { -IRDA_ERROR ("%s: max_sdu_size must be 0\n" , - __func__); +net_err_ratelimited ("%s: max_sdu_size must be 0\n" , + __func__);kfree_skb (skb);return ; }
@@ -271,8 +271,8 @@ static void irda_connect_indication(void *instance, void *sap,break ;case SOCK_SEQPACKET :if (max_sdu_size ==0 ) { -IRDA_ERROR ("%s: max_sdu_size cannot be 0\n" , - __func__); +net_err_ratelimited ("%s: max_sdu_size cannot be 0\n" , + __func__);kfree_skb (skb);return ; }
@@ -368,7 +368,7 @@ static void irda_getvalue_confirm(int result, __u16 obj_id, self = priv;if (!self) { -IRDA_WARNING ("%s: lost myself!\n" , __func__); +net_warn_ratelimited ("%s: lost myself!\n" , __func__);return ; }
@@ -417,7 +417,7 @@ static void irda_selective_discovery_indication(discinfo_t *discovery, self = priv;if (!self) { -IRDA_WARNING ("%s: lost myself!\n" , __func__); +net_warn_ratelimited ("%s: lost myself!\n" , __func__);return ; }
@@ -505,7 +505,7 @@ static int irda_open_lsap(struct irda_sock *self, int pid)notify_t notify;if (self->lsap) { -IRDA_WARNING ("%s(), busy!\n" , __func__); +net_warn_ratelimited ("%s(), busy!\n" , __func__);return -EBUSY ; }
@@ -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);if (self->iriap) { -IRDA_WARNING ("%s(): busy with a previous query\n" , - __func__); +net_warn_ratelimited ("%s(): busy with a previous query\n" , + __func__);return -EBUSY ; }
@@ -2129,8 +2129,8 @@ static int irda_setsockopt(struct socket *sock, int level, int optname, __func__, opt); self->max_sdu_size_rx = opt; }else { -IRDA_WARNING ("%s: not allowed to set MAXSDUSIZE for this socket type!\n" , - __func__); +net_warn_ratelimited ("%s: not allowed to set MAXSDUSIZE for this socket type!\n" , + __func__); err = -ENOPROTOOPT ; goto out; }
@@ -2441,8 +2441,8 @@ bed:/* Check that we can proceed with IAP */ if (self->iriap) { -IRDA_WARNING ("%s: busy with a previous query\n" , - __func__); +net_warn_ratelimited ("%s: busy with a previous query\n" , + __func__);kfree (ias_opt); err = -EBUSY ; goto out;
net/irda/ircomm/ircomm_core.c +3 -2
@@ -69,7 +69,8 @@ static int __init ircomm_init(void) { ircomm =hashbin_new (HB_LOCK );if (ircomm ==NULL ) { -IRDA_ERROR ("%s(), can't allocate hashbin!\n" , __func__); +net_err_ratelimited ("%s(), can't allocate hashbin!\n" , + __func__);return -ENOMEM ; }
@@ -83,7 +84,7 @@ static int __init ircomm_init(void) }#endif /* CONFIG_PROC_FS */ -IRDA_MESSAGE ("IrCOMM protocol (Dag Brattli)\n" ); +net_info_ratelimited ("IrCOMM protocol (Dag Brattli)\n" );return 0 ; }
net/irda/ircomm/ircomm_lmp.c +1 -1
@@ -204,7 +204,7 @@ static int ircomm_lmp_data_request(struct ircomm_cb *self, } ret =irlmp_data_request (self->lsap, skb);if (ret) { -IRDA_ERROR ("%s(), failed\n" , __func__); +net_err_ratelimited ("%s(), failed\n" , __func__);/* irlmp_data_request already free the packet */ }
net/irda/ircomm/ircomm_param.c +2 -1
@@ -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),skb_tailroom (skb), &ircomm_param_info);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);return -1 ; }
net/irda/ircomm/ircomm_ttp.c +5 -5
@@ -188,7 +188,7 @@ static int ircomm_ttp_data_request(struct ircomm_cb *self, ret =irttp_data_request (self->tsap, skb);if (ret) { -IRDA_ERROR ("%s(), failed\n" , __func__); +net_err_ratelimited ("%s(), failed\n" , __func__);/* irttp_data_request already free the packet */ }
@@ -237,8 +237,8 @@ static void ircomm_ttp_connect_confirm(void *instance, void *sap, IRDA_ASSERT(qos != NULL, goto out;);if (max_sdu_size !=TTP_SAR_DISABLE ) { -IRDA_ERROR ("%s(), SAR not allowed for IrCOMM!\n" , - __func__); +net_err_ratelimited ("%s(), SAR not allowed for IrCOMM!\n" , + __func__); goto out; }
@@ -278,8 +278,8 @@ static void ircomm_ttp_connect_indication(void *instance, void *sap, IRDA_ASSERT(qos != NULL, goto out;);if (max_sdu_size !=TTP_SAR_DISABLE ) { -IRDA_ERROR ("%s(), SAR not allowed for IrCOMM!\n" , - __func__); +net_err_ratelimited ("%s(), SAR not allowed for IrCOMM!\n" , + __func__); goto out; }
net/irda/ircomm/ircomm_tty.c +10 -11
@@ -147,7 +147,8 @@ static int __init ircomm_tty_init(void)return -ENOMEM ; ircomm_tty =hashbin_new (HB_LOCK );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);return -ENOMEM ; }
@@ -163,8 +164,8 @@ static int __init ircomm_tty_init(void) driver->flags =TTY_DRIVER_REAL_RAW ;tty_set_operations (driver, &ops);if (tty_register_driver (driver)) { -IRDA_ERROR ("%s(): Couldn't register serial driver\n" , - __func__); +net_err_ratelimited ("%s(): Couldn't register serial driver\n" , + __func__);put_tty_driver (driver);return -1 ; }
@@ -199,8 +200,8 @@ static void __exit ircomm_tty_cleanup(void) ret =tty_unregister_driver (driver);if (ret) { -IRDA_ERROR ("%s(), failed to unregister driver\n" , - __func__); +net_err_ratelimited ("%s(), failed to unregister driver\n" , + __func__);return ; }
@@ -256,7 +257,7 @@ static int ircomm_tty_startup(struct ircomm_tty_cb *self)/* Connect IrCOMM link with remote device */ ret =ircomm_tty_attach_cable (self);if (ret <0 ) { -IRDA_ERROR ("%s(), error attaching cable!\n" , __func__); +net_err_ratelimited ("%s(), error attaching cable!\n" , __func__); goto err; }
@@ -389,10 +390,8 @@ static int ircomm_tty_install(struct tty_driver *driver, struct tty_struct *tty)if (!self) {/* No, so make new instance */ self =kzalloc (sizeof (struct ircomm_tty_cb ),GFP_KERNEL ); -if (self ==NULL ) { -IRDA_ERROR ("%s(), kmalloc failed!\n" , __func__); +if (self ==NULL )return -ENOMEM ; - }tty_port_init (&self->port); self->port.ops = &ircomm_port_ops;
@@ -469,8 +468,8 @@ static int ircomm_tty_open(struct tty_struct *tty, struct file *filp)if (wait_event_interruptible (self->port.close_wait, !test_bit (ASYNCB_CLOSING , &self->port.flags))) { -IRDA_WARNING ("%s - got signal while blocking on ASYNC_CLOSING!\n" , - __func__); +net_warn_ratelimited ("%s - got signal while blocking on ASYNC_CLOSING!\n" , + __func__);return -ERESTARTSYS ; }
net/irda/ircomm/ircomm_tty_attach.c +6 -6
@@ -694,8 +694,8 @@ static int ircomm_tty_state_idle(struct ircomm_tty_cb *self, self->saddr = info->saddr;if (self->iriap) { -IRDA_WARNING ("%s(), busy with a previous query\n" , - __func__); +net_warn_ratelimited ("%s(), busy with a previous query\n" , + __func__);return -EBUSY ; }
@@ -752,8 +752,8 @@ static int ircomm_tty_state_search(struct ircomm_tty_cb *self, self->saddr = info->saddr;if (self->iriap) { -IRDA_WARNING ("%s(), busy with a previous query\n" , - __func__); +net_warn_ratelimited ("%s(), busy with a previous query\n" , + __func__);return -EBUSY ; }
@@ -822,8 +822,8 @@ static int ircomm_tty_state_query_parameters(struct ircomm_tty_cb *self,switch (event) {case IRCOMM_TTY_GOT_PARAMETERS :if (self->iriap) { -IRDA_WARNING ("%s(), busy with a previous query\n" , - __func__); +net_warn_ratelimited ("%s(), busy with a previous query\n" , + __func__);return -EBUSY ; }
net/irda/ircomm/ircomm_tty_ioctl.c +2 -1
@@ -93,7 +93,8 @@ static void ircomm_tty_change_speed(struct ircomm_tty_cb *self, self->settings.flow_control |=IRCOMM_RTS_CTS_IN ;/* This got me. Bummer. Jean II */ 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 { self->port.flags &= ~ASYNC_CTS_FLOW ; self->settings.flow_control &= ~IRCOMM_RTS_CTS_IN ;
net/irda/irda_device.c +9 -9
@@ -63,14 +63,14 @@ int __init irda_device_init( void) { dongles =hashbin_new (HB_NOLOCK );if (dongles ==NULL ) { -IRDA_WARNING ("IrDA: Can't allocate dongles hashbin!\n" ); +net_warn_ratelimited ("IrDA: Can't allocate dongles hashbin!\n" );return -ENOMEM ; }spin_lock_init (&dongles->hb_spinlock); tasks =hashbin_new (HB_LOCK );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 );return -ENOMEM ; }
@@ -84,8 +84,8 @@ int __init irda_device_init( void)static void leftover_dongle (void *arg) {struct dongle_reg *reg = arg; -IRDA_WARNING ("IrDA: Dongle type %x not unregistered\n" , - reg->type); +net_warn_ratelimited ("IrDA: Dongle type %x not unregistered\n" , + reg->type); }void irda_device_cleanup (void )
@@ -150,8 +150,8 @@ int irda_device_is_receiving(struct net_device *dev)IRDA_DEBUG (2 ,"%s()\n" , __func__);if (!dev->netdev_ops->ndo_do_ioctl) { -IRDA_ERROR ("%s: do_ioctl not impl. by device driver\n" , - __func__); +net_err_ratelimited ("%s: do_ioctl not impl. by device driver\n" , + __func__);return -1 ; }
@@ -201,15 +201,15 @@ static int irda_task_kick(struct irda_task *task)do { timeout = task->function (task);if (count++ >100 ) { -IRDA_ERROR ("%s: error in task handler!\n" , - __func__); +net_err_ratelimited ("%s: error in task handler!\n" , + __func__);irda_task_delete (task);return TRUE; } }while ((timeout ==0 ) && (task->state !=IRDA_TASK_DONE ));if (timeout <0 ) { -IRDA_ERROR ("%s: Error executing task!\n" , __func__); +net_err_ratelimited ("%s: Error executing task!\n" , __func__);irda_task_delete (task);return TRUE; }
net/irda/iriap.c +11 -13
@@ -110,8 +110,8 @@ int __init iriap_init(void)/* Object repository - defined in irias_object.c */ irias_objects =hashbin_new (HB_LOCK );if (!irias_objects) { -IRDA_WARNING ("%s: Can't allocate irias_objects hashbin!\n" , - __func__); +net_warn_ratelimited ("%s: Can't allocate irias_objects hashbin!\n" , + __func__);hashbin_delete (iriap,NULL );return -ENOMEM ; }
@@ -180,10 +180,8 @@ struct iriap_cb *iriap_open(__u8 slsap_sel, int mode, void *priv,IRDA_DEBUG (2 ,"%s()\n" , __func__); self =kzalloc (sizeof (*self),GFP_ATOMIC ); -if (!self) { -IRDA_WARNING ("%s: Unable to kmalloc!\n" , __func__); +if (!self)return NULL ; - }/* * Initialize instance
@@ -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, ¬ify,0 );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 ; } self->slsap_sel = self->lsap->slsap_sel;
@@ -859,9 +858,8 @@ static int iriap_data_indication(void *instance, void *sap, } opcode = frame[0 ];if (~opcode &IAP_LST ) { -IRDA_WARNING ("%s:, IrIAS multiframe commands or " -"results is not implemented yet!\n" , - __func__); +net_warn_ratelimited ("%s:, IrIAS multiframe commands or results is not implemented yet!\n" , + __func__); goto out; }
@@ -945,16 +943,16 @@ void iriap_call_indication(struct iriap_cb *self, struct sk_buff *skb) opcode = fp[0 ];if (~opcode &0x80 ) { -IRDA_WARNING ("%s: IrIAS multiframe commands or results " -"is not implemented yet!\n" , __func__); +net_warn_ratelimited ("%s: IrIAS multiframe commands or results is not implemented yet!\n" , + __func__);return ; } opcode &=0x7f ;/* Mask away LST bit */ switch (opcode) {case GET_INFO_BASE : -IRDA_WARNING ("%s: GetInfoBaseDetails not implemented yet!\n" , - __func__); +net_warn_ratelimited ("%s: GetInfoBaseDetails not implemented yet!\n" , + __func__);break ;case GET_VALUE_BY_CLASS :iriap_getvaluebyclass_indication (self, skb);
net/irda/iriap_event.c +1 -3
@@ -368,10 +368,8 @@ static void state_r_disconnect(struct iriap_cb *self, IRIAP_EVENT event,switch (event) {case IAP_LM_CONNECT_INDICATION : tx_skb =alloc_skb (LMP_MAX_HEADER ,GFP_ATOMIC ); -if (tx_skb ==NULL ) { -IRDA_WARNING ("%s: unable to malloc!\n" , __func__); +if (tx_skb ==NULL )return ; - }/* Reserve space for MUX_CONTROL and LAP header */ skb_reserve (tx_skb,LMP_MAX_HEADER );
net/irda/irias_object.c +28 -36
169 lines not on this page · raw message
net/irda/irlan/irlan_client.c +11 -11
@@ -323,34 +323,34 @@ static void print_ret_code(__u8 code)printk (KERN_INFO "Success\n" );break ;case 1 : -IRDA_WARNING ("IrLAN: Insufficient resources\n" ); +net_warn_ratelimited ("IrLAN: Insufficient resources\n" );break ;case 2 : -IRDA_WARNING ("IrLAN: Invalid command format\n" ); +net_warn_ratelimited ("IrLAN: Invalid command format\n" );break ;case 3 : -IRDA_WARNING ("IrLAN: Command not supported\n" ); +net_warn_ratelimited ("IrLAN: Command not supported\n" );break ;case 4 : -IRDA_WARNING ("IrLAN: Parameter not supported\n" ); +net_warn_ratelimited ("IrLAN: Parameter not supported\n" );break ;case 5 : -IRDA_WARNING ("IrLAN: Value not supported\n" ); +net_warn_ratelimited ("IrLAN: Value not supported\n" );break ;case 6 : -IRDA_WARNING ("IrLAN: Not open\n" ); +net_warn_ratelimited ("IrLAN: Not open\n" );break ;case 7 : -IRDA_WARNING ("IrLAN: Authentication required\n" ); +net_warn_ratelimited ("IrLAN: Authentication required\n" );break ;case 8 : -IRDA_WARNING ("IrLAN: Invalid password\n" ); +net_warn_ratelimited ("IrLAN: Invalid password\n" );break ;case 9 : -IRDA_WARNING ("IrLAN: Protocol error\n" ); +net_warn_ratelimited ("IrLAN: Protocol error\n" );break ;case 255 : -IRDA_WARNING ("IrLAN: Asynchronous status\n" ); +net_warn_ratelimited ("IrLAN: Asynchronous status\n" );break ; } }
@@ -380,7 +380,7 @@ void irlan_client_parse_response(struct irlan_cb *self, struct sk_buff *skb) IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;);if (!skb) { -IRDA_ERROR ("%s(), Got NULL skb!\n" , __func__); +net_err_ratelimited ("%s(), Got NULL skb!\n" , __func__);return ; } frame = skb->data;
net/irda/irlan/irlan_client_event.c +2 -2
@@ -100,8 +100,8 @@ static int irlan_client_state_idle(struct irlan_cb *self, IRLAN_EVENT event,switch (event) {case IRLAN_DISCOVERY_INDICATION :if (self->client.iriap) { -IRDA_WARNING ("%s(), busy with a previous query\n" , - __func__); +net_warn_ratelimited ("%s(), busy with a previous query\n" , + __func__);return -EBUSY ; }
net/irda/irlan/irlan_common.c +2 -1
@@ -437,7 +437,8 @@ static void irlan_disconnect_indication(void *instance,IRDA_DEBUG (2 ,"%s(), IrLMP connect failed\n" , __func__ );break ;default : -IRDA_ERROR ("%s(), Unknown disconnect reason\n" , __func__); +net_err_ratelimited ("%s(), Unknown disconnect reason\n" , + __func__);break ; }
net/irda/irlan/irlan_eth.c +1 -1
@@ -320,7 +320,7 @@ static void irlan_eth_set_multicast_list(struct net_device *dev)if (dev->flags &IFF_PROMISC ) {/* 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 ) ||netdev_mc_count (dev) >HW_MAX_ADDRS ) {/* Disable promiscuous mode, use normal mode. */
net/irda/irlap.c +8 -7
@@ -85,8 +85,8 @@ int __init irlap_init(void)/* Allocate master array */ irlap =hashbin_new (HB_LOCK );if (irlap ==NULL ) { -IRDA_ERROR ("%s: can't allocate irlap hashbin!\n" , - __func__); +net_err_ratelimited ("%s: can't allocate irlap hashbin!\n" , + __func__);return -ENOMEM ; }
@@ -491,7 +491,8 @@ void irlap_disconnect_indication(struct irlap_cb *self, LAP_REASON reason) reason, NULL);break ;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) self->discovery_log =hashbin_new (HB_NOLOCK );if (self->discovery_log ==NULL ) { -IRDA_WARNING ("%s(), Unable to allocate discovery log!\n" , - __func__); +net_warn_ratelimited ("%s(), Unable to allocate discovery log!\n" , + __func__);return ; }
@@ -625,10 +626,10 @@ void irlap_status_indication(struct irlap_cb *self, int quality_of_link) {switch (quality_of_link) {case STATUS_NO_ACTIVITY : -IRDA_MESSAGE ("IrLAP, no activity on link!\n" ); +net_info_ratelimited ("IrLAP, no activity on link!\n" );break ;case STATUS_NOISY : -IRDA_MESSAGE ("IrLAP, noisy link!\n" ); +net_info_ratelimited ("IrLAP, noisy link!\n" );break ;default :break ;
net/irda/irlap_event.c +2 -3
@@ -572,9 +572,8 @@ static int irlap_state_query(struct irlap_cb *self, IRLAP_EVENT event, info->discovery->data.daddr);if (!self->discovery_log) { -IRDA_WARNING ("%s: discovery log is gone! " -"maybe the discovery timeout has been set" -" too short?\n" , __func__); +net_warn_ratelimited ("%s: discovery log is gone! maybe the discovery timeout has been set too short?\n" , + __func__);break ; } hashbin_insert(self->discovery_log,
net/irda/irlap_frame.c +14 -16
@@ -421,7 +421,7 @@ static void irlap_recv_discovery_xid_rsp(struct irlap_cb *self, IRDA_ASSERT(self->magic == LAP_MAGIC, return;);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 ; }
@@ -438,7 +438,7 @@ static void irlap_recv_discovery_xid_rsp(struct irlap_cb *self, }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 ; }
@@ -492,7 +492,7 @@ static void irlap_recv_discovery_xid_cmd(struct irlap_cb *self,char *text;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 ; }
@@ -536,8 +536,8 @@ static void irlap_recv_discovery_xid_cmd(struct irlap_cb *self,/* Check if things are sane at this point... */ if ((discovery_info ==NULL ) || !pskb_may_pull (skb,3 )) { -IRDA_ERROR ("%s: discovery frame too short!\n" , - __func__); +net_err_ratelimited ("%s: discovery frame too short!\n" , + __func__);return ; }
@@ -545,10 +545,8 @@ static void irlap_recv_discovery_xid_cmd(struct irlap_cb *self,* We now have some discovery info to deliver! */ discovery =kzalloc (sizeof (discovery_t),GFP_ATOMIC ); -if (!discovery) { -IRDA_WARNING ("%s: unable to malloc!\n" , __func__); +if (!discovery)return ; - } discovery->data.daddr = info->daddr; discovery->data.saddr = self->saddr;
@@ -1170,7 +1168,7 @@ static void irlap_recv_frmr_frame(struct irlap_cb *self, struct sk_buff *skb, IRDA_ASSERT(info != NULL, return;);if (!pskb_may_pull (skb,4 )) { -IRDA_ERROR ("%s: frame too short!\n" , __func__); +net_err_ratelimited ("%s: frame too short!\n" , __func__);return ; }
@@ -1259,7 +1257,7 @@ static void irlap_recv_test_frame(struct irlap_cb *self, struct sk_buff *skb,IRDA_DEBUG (2 ,"%s()\n" , __func__);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 ; } frame = (struct test_frame *) skb->data;
@@ -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 * we don't need to be clever about it. Jean II */ 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; }/* Check if frame is large enough for parsing */ 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; }
@@ -1383,8 +1381,8 @@ int irlap_driver_rcv(struct sk_buff *skb, struct net_device *dev,irlap_recv_srej_frame (self, skb, &info, command);break ;default : -IRDA_WARNING ("%s: Unknown S-frame %02x received!\n" , - __func__, info.control); +net_warn_ratelimited ("%s: Unknown S-frame %02x received!\n" , + __func__, info.control);break ; } goto out;
@@ -1421,8 +1419,8 @@ int irlap_driver_rcv(struct sk_buff *skb, struct net_device *dev,irlap_recv_ui_frame (self, skb, &info);break ;default : -IRDA_WARNING ("%s: Unknown frame %02x received!\n" , - __func__, info.control); +net_warn_ratelimited ("%s: Unknown frame %02x received!\n" , + __func__, info.control);break ; } out:
net/irda/irlmp.c +8 -11
@@ -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 */ self =kzalloc (sizeof (struct lsap_cb ),GFP_ATOMIC ); -if (self ==NULL ) { -IRDA_ERROR ("%s: can't allocate memory\n" , __func__); +if (self ==NULL )return NULL ; - } self->magic =LMP_LSAP_MAGIC ; self->slsap_sel = slsap_sel;
@@ -297,10 +295,8 @@ void irlmp_register_link(struct irlap_cb *irlap, __u32 saddr, notify_t *notify)* Allocate new instance of a LSAP connection */ lap =kzalloc (sizeof (struct lap_cb ),GFP_KERNEL ); -if (lap ==NULL ) { -IRDA_ERROR ("%s: unable to kmalloc\n" , __func__); +if (lap ==NULL )return ; - } lap->irlap = irlap; lap->magic =LMP_LAP_MAGIC ;
@@ -311,7 +307,8 @@ void irlmp_register_link(struct irlap_cb *irlap, __u32 saddr, notify_t *notify)#endif lap->lsaps =hashbin_new (HB_LOCK );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);return ; }
@@ -852,8 +849,8 @@ void irlmp_do_discovery(int nslots)/* Make sure the value is sane */ if ((nslots !=1 ) && (nslots !=6 ) && (nslots !=8 ) && (nslots !=16 )){ -IRDA_WARNING ("%s: invalid value for number of slots!\n" , - __func__); +net_warn_ratelimited ("%s: invalid value for number of slots!\n" , + __func__); nslots = sysctl_discovery_slots =8 ; }
@@ -1799,8 +1796,8 @@ static __u8 irlmp_find_free_slsap(void)/* Make sure we terminate the loop */ if (wrapped++) { -IRDA_ERROR ("%s: no more free LSAPs !\n" , - __func__); +net_err_ratelimited ("%s: no more free LSAPs !\n" , + __func__);return 0 ; } }
net/irda/irlmp_event.c +4 -4
@@ -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__);if (self->conn_skb) { -IRDA_WARNING ("%s: busy with another request!\n" , - __func__); +net_warn_ratelimited ("%s: busy with another request!\n" , + __func__);return -EBUSY ; }/* 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,break ;case LM_CONNECT_INDICATION :if (self->conn_skb) { -IRDA_WARNING ("%s: busy with another request!\n" , - __func__); +net_warn_ratelimited ("%s: busy with another request!\n" , + __func__);return -EBUSY ; }/* Don't forget to refcount it (see irlap_driver_rcv()) */
net/irda/irttp.c +16 -15
@@ -96,8 +96,8 @@ int __init irttp_init(void) irttp->tsaps =hashbin_new (HB_LOCK );if (!irttp->tsaps) { -IRDA_ERROR ("%s: can't allocate IrTTP hashbin!\n" , - __func__); +net_err_ratelimited ("%s: can't allocate IrTTP hashbin!\n" , + __func__);kfree (irttp);return -ENOMEM ; }
@@ -518,8 +518,8 @@ int irttp_close_tsap(struct tsap_cb *self)if (self->connected) {/* Check if disconnect is not pending */ if (!test_bit (0 , &self->disconnect_pend)) { -IRDA_WARNING ("%s: TSAP still connected!\n" , - __func__); +net_warn_ratelimited ("%s: TSAP still connected!\n" , + __func__);irttp_disconnect_request (self,NULL ,P_NORMAL ); } self->close_pend = TRUE;
@@ -568,13 +568,14 @@ int irttp_udata_request(struct tsap_cb *self, struct sk_buff *skb)/* Check that nothing bad happens */ if (!self->connected) { -IRDA_WARNING ("%s(), Not connected\n" , __func__); +net_warn_ratelimited ("%s(), Not connected\n" , __func__); ret = -ENOTCONN ; goto err; }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 ; goto err; }
@@ -617,7 +618,7 @@ int irttp_data_request(struct tsap_cb *self, struct sk_buff *skb)/* Check that nothing bad happens */ if (!self->connected) { -IRDA_WARNING ("%s: Not connected\n" , __func__); +net_warn_ratelimited ("%s: Not connected\n" , __func__); ret = -ENOTCONN ; goto err; }
@@ -627,8 +628,8 @@ int irttp_data_request(struct tsap_cb *self, struct sk_buff *skb)* inside an IrLAP frame */ 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" , - __func__); +net_err_ratelimited ("%s: SAR disabled, and data is too large for IrLAP!\n" , + __func__); ret = -EMSGSIZE ; goto err; }
@@ -640,8 +641,8 @@ int irttp_data_request(struct tsap_cb *self, struct sk_buff *skb)if ((self->tx_max_sdu_size !=0 ) && (self->tx_max_sdu_size !=TTP_SAR_UNBOUND ) && (skb->len > self->tx_max_sdu_size)) { -IRDA_ERROR ("%s: SAR enabled, but data is larger than TxMaxSduSize!\n" , - __func__); +net_err_ratelimited ("%s: SAR enabled, but data is larger than TxMaxSduSize!\n" , + __func__); ret = -EMSGSIZE ; goto err; }
@@ -1249,8 +1250,8 @@ static void irttp_connect_confirm(void *instance, void *sap,/* Any errors in the parameter list? */ if (ret <0 ) { -IRDA_WARNING ("%s: error extracting parameters\n" , - __func__); +net_warn_ratelimited ("%s: error extracting parameters\n" , + __func__);dev_kfree_skb (skb);/* Do not accept this connection attempt */
@@ -1326,8 +1327,8 @@ static void irttp_connect_indication(void *instance, void *sap,/* Any errors in the parameter list? */ if (ret <0 ) { -IRDA_WARNING ("%s: error extracting parameters\n" , - __func__); +net_warn_ratelimited ("%s: error extracting parameters\n" , + __func__);dev_kfree_skb (skb);/* Do not accept this connection attempt */
net/irda/parameters.c +18 -21
@@ -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 */ if (len < (2 +p.pl)) { -IRDA_WARNING ("%s: buffer too short for insertion!\n" , - __func__); +net_warn_ratelimited ("%s: buffer too short for insertion!\n" , + __func__);return -1 ; } 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,break ;default : -IRDA_WARNING ("%s: length %d not supported\n" , - __func__, p.pl); +net_warn_ratelimited ("%s: length %d not supported\n" , + __func__, p.pl);/* Skip parameter */ return -1 ; }
@@ -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 */ if (len < (2 +p.pl)) { -IRDA_WARNING ("%s: buffer too short for parsing! " -"Need %d bytes, but len is only %d\n" , - __func__, p.pl, len); +net_warn_ratelimited ("%s: buffer too short for parsing! Need %d bytes, but len is only %d\n" , + __func__, p.pl, len);return -1 ; }
@@ -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. */ if (((type &PV_MASK ) !=PV_INTEGER ) && ((type &PV_MASK ) != p.pl)) { -IRDA_ERROR ("%s: invalid parameter length! " -"Expected %d bytes, but value had %d bytes!\n" , - __func__, type &PV_MASK , p.pl); +net_err_ratelimited ("%s: invalid parameter length! Expected %d bytes, but value had %d bytes!\n" , + __func__, type &PV_MASK , p.pl);/* Most parameters are bit/byte fields or little endian, * 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,le32_to_cpus (&p.pv.i);break ;default : -IRDA_WARNING ("%s: length %d not supported\n" , - __func__, p.pl); +net_warn_ratelimited ("%s: length %d not supported\n" , + __func__, p.pl);/* Skip parameter */ return p.pl+2 ;
@@ -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 */ if (len < (2 +p.pl)) { -IRDA_WARNING ("%s: buffer too short for parsing! " -"Need %d bytes, but len is only %d\n" , - __func__, p.pl, len); +net_warn_ratelimited ("%s: buffer too short for parsing! Need %d bytes, but len is only %d\n" , + __func__, p.pl, len);return -1 ; }
@@ -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 */ if (len < (2 +p.pl)) { -IRDA_WARNING ("%s: buffer too short for parsing! " -"Need %d bytes, but len is only %d\n" , - __func__, p.pl, len); +net_warn_ratelimited ("%s: buffer too short for parsing! Need %d bytes, but len is only %d\n" , + __func__, p.pl, len);return -1 ; }
@@ -487,7 +483,8 @@ int irda_param_insert(void *self, __u8 pi, __u8 *buf, int len,/* Check if handler has been implemented */ 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 */ return -1 ; }
@@ -544,8 +541,8 @@ static int irda_param_extract(void *self, __u8 *buf, int len,/* Check if handler has been implemented */ if (!pi_minor_info->func) { -IRDA_MESSAGE ("%s: no handler for pi=%#x\n" , - __func__, buf[n]); +net_info_ratelimited ("%s: no handler for pi=%#x\n" , + __func__, buf[n]);/* Skip this parameter */ return 2 + buf[n +1 ];/* Continue */ }
net/irda/qos.c +6 -6
@@ -200,8 +200,8 @@ static int msb_index (__u16 word)* able to check precisely what's going on. If a end user sees this, * it's very likely the peer. - Jean II */ if (word ==0 ) { -IRDA_WARNING ("%s(), Detected buggy peer, adjust null PV to 0x1!\n" , - __func__); +net_warn_ratelimited ("%s(), Detected buggy peer, adjust null PV to 0x1!\n" , + __func__);/* The only safe choice (we don't know the array size) */ word =0x1 ; }
@@ -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) {int i; -IRDA_WARNING ("%s(), Detected buggy peer, adjust mtt to %dus!\n" , - __func__, sysctl_min_tx_turn_time); +net_warn_ratelimited ("%s(), Detected buggy peer, adjust mtt to %dus!\n" , + __func__, sysctl_min_tx_turn_time);/* We don't really need bits, but easier this way */ 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)IRDA_DEBUG (2 ,"%s(), reducing data size to %d\n" , __func__, qos->data_size.value); }else { -IRDA_WARNING ("%s(), nothing more we can do!\n" , - __func__); +net_warn_ratelimited ("%s(), nothing more we can do!\n" , + __func__); } }#endif /* CONFIG_IRDA_DYNAMIC_WINDOW */
net/irda/wrapper.c +3 -3
@@ -134,8 +134,8 @@ int async_wrap_skb(struct sk_buff *skb, __u8 *tx_buff, int buffsize)* transmitted after this point is 5. */ if (n >= (buffsize-5 )) { -IRDA_ERROR ("%s(), tx buffer overflow (n=%d)\n" , - __func__, n); +net_err_ratelimited ("%s(), tx buffer overflow (n=%d)\n" , + __func__, n);return n; }
@@ -386,7 +386,7 @@ async_unwrap_ce(struct net_device *dev,break ;case LINK_ESCAPE : -IRDA_WARNING ("%s: state not defined\n" , __func__); +net_warn_ratelimited ("%s: state not defined\n" , __func__);break ;case BEGIN_FRAME :
PATCH 1/1 irda: Convert IRDA_DEBUG to pr_debug
Use the normal kernel debugging mechanism which also enables dynamic_debug at the same time.
Other miscellanea:
o Remove sysctl for irda_debug
o Remove function tracing like uses (use ftrace instead)
o Coalesce formats
o Realign arguments
o Remove unnecessary OOM messages
---
donauboe does not have normal indentation, unchanged.
drivers/net/irda/act200l-sir.c | 8 -- drivers/net/irda/actisys-sir.c | 3 +- drivers/net/irda/ali-ircc.c | 206 +++++++++++++------------------ drivers/net/irda/donauboe.c | 96 ++++++--------- drivers/net/irda/girbil-sir.c | 8 -- drivers/net/irda/irda-usb.c | 95 +++++++------- drivers/net/irda/irtty-sir.c | 8 +- drivers/net/irda/litelink-sir.c | 8 -- drivers/net/irda/ma600-sir.c | 14 +-- drivers/net/irda/mcp2120-sir.c | 8 -- drivers/net/irda/mcs7780.c | 8 +- drivers/net/irda/nsc-ircc.c | 163 ++++++++++++------------ drivers/net/irda/old_belkin-sir.c | 8 -- drivers/net/irda/sir_dev.c | 44 ++++--- drivers/net/irda/sir_dongle.c | 4 +- drivers/net/irda/smsc-ircc2.c | 125 ++++++++++--------- drivers/net/irda/tekram-sir.c | 12 +- drivers/net/irda/toim3232-sir.c | 12 +- drivers/net/irda/via-ircc.c | 154 ++++++++++------------- drivers/net/irda/vlsi_ir.c | 27 ++-- drivers/net/irda/w83977af_ir.c | 68 ++++------ include/net/irda/irda.h | 11 -- include/net/irda/irlap.h | 2 +- net/irda/af_irda.c | 209 ++++++++++++++----------------- net/irda/discovery.c | 12 +- net/irda/ircomm/ircomm_core.c | 50 ++------ net/irda/ircomm/ircomm_event.c | 24 ++-- net/irda/ircomm/ircomm_lmp.c | 28 +---- net/irda/ircomm/ircomm_param.c | 41 +++---- net/irda/ircomm/ircomm_ttp.c | 20 +-- net/irda/ircomm/ircomm_tty.c | 95 +++++--------- net/irda/ircomm/ircomm_tty_attach.c | 106 +++++++--------- net/irda/ircomm/ircomm_tty_ioctl.c | 18 +-- net/irda/irda_device.c | 16 +-- net/irda/iriap.c | 91 +++++--------- net/irda/iriap_event.c | 38 +++--- net/irda/irias_object.c | 14 +-- net/irda/irlan/irlan_client.c | 64 ++++------ net/irda/irlan/irlan_client_event.c | 62 +++------- net/irda/irlan/irlan_common.c | 77 +++--------- net/irda/irlan/irlan_eth.c | 24 ++-- net/irda/irlan/irlan_event.c | 4 +- net/irda/irlan/irlan_filter.c | 23 ++-- net/irda/irlan/irlan_provider.c | 42 +++---- net/irda/irlan/irlan_provider_event.c | 16 +-- net/irda/irlap.c | 55 ++------- net/irda/irlap_event.c | 225 ++++++++++++++++------------------ net/irda/irlap_frame.c | 87 +++++-------- net/irda/irlmp.c | 167 ++++++++++--------------- net/irda/irlmp_event.c | 121 ++++++++---------- net/irda/irlmp_frame.c | 56 ++++----- net/irda/irmod.c | 12 -- net/irda/irnetlink.c | 4 +- net/irda/irqueue.c | 14 +-- net/irda/irsysctl.c | 9 -- net/irda/irttp.c | 127 ++++++++----------- net/irda/parameters.c | 38 +++--- net/irda/qos.c | 71 +++++------ net/irda/wrapper.c | 22 ++-- 59 files changed, 1244 insertions(+), 1930 deletions(-)
drivers/net/irda/act200l-sir.c +0 -8
@@ -107,8 +107,6 @@ static int act200l_open(struct sir_dev *dev) {struct qos_info *qos = &dev->qos; -IRDA_DEBUG (2 ,"%s()\n" , __func__ ); -/* Power on the dongle */ sirdev_set_dtr_rts (dev, TRUE, TRUE);
@@ -124,8 +122,6 @@ static int act200l_open(struct sir_dev *dev)static int act200l_close (struct sir_dev *dev) { -IRDA_DEBUG (2 ,"%s()\n" , __func__ ); -/* Power off the dongle */ sirdev_set_dtr_rts (dev, FALSE, FALSE);
@@ -143,8 +139,6 @@ static int act200l_change_speed(struct sir_dev *dev, unsigned speed)u8 control[3 ];int ret =0 ; -IRDA_DEBUG (2 ,"%s()\n" , __func__ ); -/* Clear DTR and set RTS to enter command mode */ sirdev_set_dtr_rts (dev, FALSE, TRUE);
@@ -212,8 +206,6 @@ static int act200l_reset(struct sir_dev *dev) };int ret =0 ; -IRDA_DEBUG (2 ,"%s()\n" , __func__ ); -switch (state) {case SIRDEV_STATE_DONGLE_RESET :/* Reset the dongle : set RTS low for 25 ms */
drivers/net/irda/actisys-sir.c +1 -2
@@ -165,8 +165,7 @@ static int actisys_change_speed(struct sir_dev *dev, unsigned speed)int ret =0 ;int i =0 ; -IRDA_DEBUG (4 ,"%s(), speed=%d (was %d)\n" , __func__, - speed, dev->speed); +pr_debug ("%s(), speed=%d (was %d)\n" , __func__, speed, dev->speed);/* dongle was already resetted from irda_request state machine, * we are in known state (dongle default)
drivers/net/irda/ali-ircc.c +83 -123
809 lines not on this page · raw message
drivers/net/irda/donauboe.c +35 -61
293 lines not on this page · raw message
drivers/net/irda/girbil-sir.c +0 -8
@@ -86,8 +86,6 @@ static int girbil_open(struct sir_dev *dev) {struct qos_info *qos = &dev->qos; -IRDA_DEBUG (2 ,"%s()\n" , __func__); -/* Power on dongle */ sirdev_set_dtr_rts (dev, TRUE, TRUE);
@@ -102,8 +100,6 @@ static int girbil_open(struct sir_dev *dev)static int girbil_close (struct sir_dev *dev) { -IRDA_DEBUG (2 ,"%s()\n" , __func__); -/* Power off dongle */ sirdev_set_dtr_rts (dev, FALSE, FALSE);
@@ -126,8 +122,6 @@ static int girbil_change_speed(struct sir_dev *dev, unsigned speed)u8 control[2 ];static int ret =0 ; -IRDA_DEBUG (2 ,"%s()\n" , __func__); -/* dongle alread reset - port and dongle at default speed */ switch (state) {
@@ -210,8 +204,6 @@ static int girbil_reset(struct sir_dev *dev)u8 control =GIRBIL_TXEN |GIRBIL_RXEN ;int ret =0 ; -IRDA_DEBUG (2 ,"%s()\n" , __func__); -switch (state) {case SIRDEV_STATE_DONGLE_RESET :/* Reset dongle */
drivers/net/irda/irda-usb.c +44 -51
311 lines not on this page · raw message
drivers/net/irda/irtty-sir.c +4 -4
@@ -240,7 +240,7 @@ static void irtty_receive_buf(struct tty_struct *tty, const unsigned char *cp,* Characters received with a parity error, etc? */ if (fp && *fp++) { -IRDA_DEBUG (0 ,"Framing or parity error!\n" ); +pr_debug ("Framing or parity error!\n" );sirdev_receive (dev,NULL ,0 );/* notify sir_dev (updating stats) */ return ; }
@@ -387,7 +387,7 @@ static int irtty_ioctl(struct tty_struct *tty, struct file *file, unsigned int c IRDA_ASSERT(priv != NULL, return -ENODEV;); IRDA_ASSERT(priv->magic == IRTTY_MAGIC, return -EBADR;); -IRDA_DEBUG (3 ,"%s(cmd=0x%X)\n" , __func__, cmd); +pr_debug ("%s(cmd=0x%X)\n" , __func__, cmd); dev = priv->dev; IRDA_ASSERT(dev != NULL, return -1;);
@@ -477,7 +477,7 @@ static int irtty_open(struct tty_struct *tty)mutex_unlock (&irtty_mutex); -IRDA_DEBUG (0 ,"%s - %s: irda line discipline opened\n" , __func__, tty->name); +pr_debug ("%s - %s: irda line discipline opened\n" , __func__, tty->name);return 0 ;
@@ -528,7 +528,7 @@ static void irtty_close(struct tty_struct *tty)kfree (priv); -IRDA_DEBUG (0 ,"%s - %s: irda line discipline closed\n" , __func__, tty->name); +pr_debug ("%s - %s: irda line discipline closed\n" , __func__, tty->name); }/* ------------------------------------------------------- */
drivers/net/irda/litelink-sir.c +0 -8
@@ -76,8 +76,6 @@ static int litelink_open(struct sir_dev *dev) {struct qos_info *qos = &dev->qos; -IRDA_DEBUG (2 ,"%s()\n" , __func__); -/* Power up dongle */ sirdev_set_dtr_rts (dev, TRUE, TRUE);
@@ -93,8 +91,6 @@ static int litelink_open(struct sir_dev *dev)static int litelink_close (struct sir_dev *dev) { -IRDA_DEBUG (2 ,"%s()\n" , __func__); -/* Power off dongle */ sirdev_set_dtr_rts (dev, FALSE, FALSE);
@@ -111,8 +107,6 @@ static int litelink_change_speed(struct sir_dev *dev, unsigned speed) {int i; -IRDA_DEBUG (2 ,"%s()\n" , __func__); -/* dongle already reset by irda-thread - current speed (dongle and * port) is the default speed (115200 for litelink!) */
@@ -154,8 +148,6 @@ static int litelink_change_speed(struct sir_dev *dev, unsigned speed)*/ static int litelink_reset (struct sir_dev *dev) { -IRDA_DEBUG (2 ,"%s()\n" , __func__); -/* probably the power-up can be dropped here, but with only * 15 usec delay it's not worth the risk unless somebody with * the hardware confirms it doesn't break anything...
drivers/net/irda/ma600-sir.c +3 -11
@@ -65,13 +65,11 @@ static struct dongle_driver ma600 = {static int __init ma600_sir_init (void ) { -IRDA_DEBUG (2 ,"%s()\n" , __func__);return irda_register_dongle (&ma600); } static void __exit ma600_sir_cleanup(void) { -IRDA_DEBUG (2 ,"%s()\n" , __func__);irda_unregister_dongle (&ma600); }
@@ -86,8 +84,6 @@ static int ma600_open(struct sir_dev *dev) {struct qos_info *qos = &dev->qos; -IRDA_DEBUG (2 ,"%s()\n" , __func__); -sirdev_set_dtr_rts (dev, TRUE, TRUE);/* Explicitly set the speeds we can accept */
@@ -104,8 +100,6 @@ static int ma600_open(struct sir_dev *dev)static int ma600_close (struct sir_dev *dev) { -IRDA_DEBUG (2 ,"%s()\n" , __func__); -/* Power off dongle */ sirdev_set_dtr_rts (dev, FALSE, FALSE);
@@ -174,8 +168,8 @@ static int ma600_change_speed(struct sir_dev *dev, unsigned speed) {u8 byte; -IRDA_DEBUG (2 ,"%s(), speed=%d (was %d)\n" , __func__, - speed, dev->speed); +pr_debug ("%s(), speed=%d (was %d)\n" , __func__, + speed, dev->speed);/* dongle already reset, dongle and port at default speed (9600) */
@@ -204,7 +198,7 @@ static int ma600_change_speed(struct sir_dev *dev, unsigned speed) return -1; }else -IRDA_DEBUG (2 ,"%s() control byte write read OK\n" , __func__); +pr_debug ("%s() control byte write read OK\n" , __func__);#endif /* Set DTR, Set RTS */
@@ -236,8 +230,6 @@ static int ma600_change_speed(struct sir_dev *dev, unsigned speed)static int ma600_reset (struct sir_dev *dev) { -IRDA_DEBUG (2 ,"%s()\n" , __func__); -/* Reset the dongle : set DTR low for 10 ms */ sirdev_set_dtr_rts (dev, FALSE, TRUE);msleep (10 );
drivers/net/irda/mcp2120-sir.c +0 -8
@@ -63,8 +63,6 @@ static int mcp2120_open(struct sir_dev *dev) {struct qos_info *qos = &dev->qos; -IRDA_DEBUG (2 ,"%s()\n" , __func__); -/* seems no explicit power-on required here and reset switching it on anyway */ qos->baud_rate.bits &=IR_9600 |IR_19200 |IR_38400 |IR_57600 |IR_115200 ;
@@ -76,8 +74,6 @@ static int mcp2120_open(struct sir_dev *dev)static int mcp2120_close (struct sir_dev *dev) { -IRDA_DEBUG (2 ,"%s()\n" , __func__); -/* Power off dongle */ /* reset and inhibit mcp2120 */ sirdev_set_dtr_rts (dev, TRUE, TRUE);
@@ -102,8 +98,6 @@ static int mcp2120_change_speed(struct sir_dev *dev, unsigned speed)u8 control[2 ];static int ret =0 ; -IRDA_DEBUG (2 ,"%s()\n" , __func__); -switch (state) {case SIRDEV_STATE_DONGLE_SPEED :/* Set DTR to enter command mode */
@@ -188,8 +182,6 @@ static int mcp2120_reset(struct sir_dev *dev)unsigned delay =0 ;int ret =0 ; -IRDA_DEBUG (2 ,"%s()\n" , __func__); -switch (state) {case SIRDEV_STATE_DONGLE_RESET ://printk("mcp2120_reset: dongle_reset\n");
drivers/net/irda/mcs7780.c +4 -4
@@ -894,7 +894,7 @@ static int mcs_probe(struct usb_interface *intf,if (!ndev) goto error1; -IRDA_DEBUG (1 ,"MCS7780 USB-IrDA bridge found at %d.\n" , udev->devnum); +pr_debug ("MCS7780 USB-IrDA bridge found at %d.\n" , udev->devnum);SET_NETDEV_DEV (ndev, &intf->dev);
@@ -942,8 +942,8 @@ static int mcs_probe(struct usb_interface *intf,if (ret !=0 ) goto error2; -IRDA_DEBUG (1 ,"IrDA: Registered MosChip MCS7780 device as %s\n" , - ndev->name); +pr_debug ("IrDA: Registered MosChip MCS7780 device as %s\n" , + ndev->name); mcs->transceiver_type = transceiver_type; mcs->sir_tweak = sir_tweak;
@@ -973,7 +973,7 @@ static void mcs_disconnect(struct usb_interface *intf)free_netdev (mcs->netdev);usb_set_intfdata (intf,NULL ); -IRDA_DEBUG (0 ,"MCS7780 now disconnected.\n" ); +pr_debug ("MCS7780 now disconnected.\n" ); }module_usb_driver (mcs_driver);
drivers/net/irda/nsc-ircc.c +78 -85
423 lines not on this page · raw message
drivers/net/irda/old_belkin-sir.c +0 -8
@@ -90,8 +90,6 @@ static int old_belkin_open(struct sir_dev *dev) {struct qos_info *qos = &dev->qos; -IRDA_DEBUG (2 ,"%s()\n" , __func__); -/* Power on dongle */ sirdev_set_dtr_rts (dev, TRUE, TRUE);
@@ -108,8 +106,6 @@ static int old_belkin_open(struct sir_dev *dev)static int old_belkin_close (struct sir_dev *dev) { -IRDA_DEBUG (2 ,"%s()\n" , __func__); -/* Power off dongle */ sirdev_set_dtr_rts (dev, FALSE, FALSE);
@@ -123,8 +119,6 @@ static int old_belkin_close(struct sir_dev *dev)*/ static int old_belkin_change_speed (struct sir_dev *dev,unsigned speed) { -IRDA_DEBUG (2 ,"%s()\n" , __func__); - dev->speed =9600 ;return (speed==dev->speed) ?0 : -EINVAL ; }
@@ -137,8 +131,6 @@ static int old_belkin_change_speed(struct sir_dev *dev, unsigned speed)*/ static int old_belkin_reset (struct sir_dev *dev) { -IRDA_DEBUG (2 ,"%s()\n" , __func__); -/* This dongles speed "defaults" to 9600 bps ;-) */ dev->speed =9600 ;
drivers/net/irda/sir_dev.c +21 -23
151 lines not on this page · raw message
drivers/net/irda/sir_dongle.c +2 -2
@@ -34,8 +34,8 @@ int irda_register_dongle(struct dongle_driver *new)struct list_head *entry;struct dongle_driver *drv; -IRDA_DEBUG (0 ,"%s : registering dongle \"%s\" (%d).\n" , - __func__, new->driver_name, new->type); +pr_debug ("%s : registering dongle \"%s\" (%d).\n" , + __func__, new->driver_name, new->type);mutex_lock (&dongle_list_lock);list_for_each (entry, &dongle_list) {
drivers/net/irda/smsc-ircc2.c +62 -63
413 lines not on this page · raw message
drivers/net/irda/tekram-sir.c +2 -10
@@ -63,8 +63,8 @@ static int __init tekram_sir_init(void) {if (tekram_delay <1 || tekram_delay >500 ) tekram_delay =200 ; -IRDA_DEBUG (1 ,"%s - using %d ms delay\n" , - tekram.driver_name, tekram_delay); +pr_debug ("%s - using %d ms delay\n" , + tekram.driver_name, tekram_delay);return irda_register_dongle (&tekram); }
@@ -77,8 +77,6 @@ static int tekram_open(struct sir_dev *dev) {struct qos_info *qos = &dev->qos; -IRDA_DEBUG (2 ,"%s()\n" , __func__); -sirdev_set_dtr_rts (dev, TRUE, TRUE); qos->baud_rate.bits &=IR_9600 |IR_19200 |IR_38400 |IR_57600 |IR_115200 ;
@@ -92,8 +90,6 @@ static int tekram_open(struct sir_dev *dev)static int tekram_close (struct sir_dev *dev) { -IRDA_DEBUG (2 ,"%s()\n" , __func__); -/* Power off dongle */ sirdev_set_dtr_rts (dev, FALSE, FALSE);
@@ -130,8 +126,6 @@ static int tekram_change_speed(struct sir_dev *dev, unsigned speed)u8 byte;static int ret =0 ; -IRDA_DEBUG (2 ,"%s()\n" , __func__); -switch (state) {case SIRDEV_STATE_DONGLE_SPEED :
@@ -205,8 +199,6 @@ static int tekram_change_speed(struct sir_dev *dev, unsigned speed)static int tekram_reset (struct sir_dev *dev) { -IRDA_DEBUG (2 ,"%s()\n" , __func__); -/* Clear DTR, Set RTS */ sirdev_set_dtr_rts (dev, FALSE, TRUE);
drivers/net/irda/toim3232-sir.c +2 -10
@@ -168,8 +168,8 @@ static int __init toim3232_sir_init(void) {if (toim3232delay <1 || toim3232delay >500 ) toim3232delay =200 ; -IRDA_DEBUG (1 ,"%s - using %d ms delay\n" , - toim3232.driver_name, toim3232delay); +pr_debug ("%s - using %d ms delay\n" , + toim3232.driver_name, toim3232delay);return irda_register_dongle (&toim3232); }
@@ -182,8 +182,6 @@ static int toim3232_open(struct sir_dev *dev) {struct qos_info *qos = &dev->qos; -IRDA_DEBUG (2 ,"%s()\n" , __func__); -/* Pull the lines high to start with. * * For the IR320ST-2, we need to charge the main supply capacitor to
@@ -210,8 +208,6 @@ static int toim3232_open(struct sir_dev *dev)static int toim3232_close (struct sir_dev *dev) { -IRDA_DEBUG (2 ,"%s()\n" , __func__); -/* Power off dongle */ sirdev_set_dtr_rts (dev, FALSE, FALSE);
@@ -242,8 +238,6 @@ static int toim3232_change_speed(struct sir_dev *dev, unsigned speed)u8 byte;static int ret =0 ; -IRDA_DEBUG (2 ,"%s()\n" , __func__); -switch (state) {case SIRDEV_STATE_DONGLE_SPEED :
@@ -345,8 +339,6 @@ static int toim3232_change_speed(struct sir_dev *dev, unsigned speed)static int toim3232_reset (struct sir_dev *dev) { -IRDA_DEBUG (2 ,"%s()\n" , __func__); -/* Switch off both DTR and RTS to switch off dongle */ sirdev_set_dtr_rts (dev, FALSE, FALSE);
drivers/net/irda/via-ircc.c +66 -88
224 lines not on this page · raw message
drivers/net/irda/w83977af_ir.c +25 -43
68 lines not on this page · raw message
net/irda/af_irda.c +94 -115
209 lines not on this page · raw message
net/irda/ircomm/ircomm_core.c +11 -39
50 lines not on this page · raw message
net/irda/ircomm/ircomm_param.c +19 -22
41 lines not on this page · raw message
net/irda/ircomm/ircomm_tty.c +30 -65
95 lines not on this page · raw message
net/irda/ircomm/ircomm_tty_attach.c +43 -63
106 lines not on this page · raw message
net/irda/iriap.c +34 -57
91 lines not on this page · raw message
net/irda/irlan/irlan_client.c +24 -40
64 lines not on this page · raw message
net/irda/irlan/irlan_client_event.c +20 -42
62 lines not on this page · raw message
net/irda/irlan/irlan_common.c +20 -57
77 lines not on this page · raw message
net/irda/irlan/irlan_provider.c +17 -25
42 lines not on this page · raw message
net/irda/irlap.c +13 -42
55 lines not on this page · raw message
net/irda/irlap_event.c +107 -118
225 lines not on this page · raw message
net/irda/irlap_frame.c +33 -54
87 lines not on this page · raw message
net/irda/irlmp.c +66 -101
167 lines not on this page · raw message
net/irda/irlmp_event.c +50 -71
121 lines not on this page · raw message
net/irda/irlmp_frame.c +21 -35
56 lines not on this page · raw message
net/irda/irttp.c +52 -75
127 lines not on this page · raw message
net/irda/qos.c +34 -37
71 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.
Re: [PATCH] irda: Convert IRDA_DEBUG to pr_debug
From: Joe Perches <[email protected]>
Date: Tue, 11 Nov 2014 14:44:57 -0800
Quoted 11 lines
Use the normal kernel debugging mechanism which also enables
dynamic_debugat the same time.Other miscellanea:
o Remove sysctl for
irda_debug
o Remove function tracing like uses (use ftrace instead)
o Coalesce formats
o Realign arguments
o Remove unnecessary OOM messages
Quoted 4 lines
Signed-off-by Joe Perches <[email protected]>---
donauboe does not have normal indentation, unchanged.
Applied to net-next, thanks Joe.
Re: [PATCH] irda: Convert IRDA_DEBUG to pr_debug
Quoted 5 lines · David Miller
From: Joe Perches <[email protected]>
Date: Tue, 11 Nov 2014 14:44:57 -0800Quoted 2 lines
Use the normal kernel debugging mechanism which also enables
dynamic_debugat the same time.Applied to net-next, thanks Joe.
Apologies.
There was obviously insufficient platform and config option testing on this patch.
David, can you lease revert and I'll work out the various platform options defects that have been reported by Fengguang's kbuild test robot.
PATCH 1/1 irda: Fix build failures after IRDA_DEBUG->pr_debug
Fix the build failures that result from the use of pr_debug without the referenced char * arrays being defined.
---
Quoted 6 lines · Joe Perches
Quoted 5 lines · David Miller
From: Joe Perches <[email protected]>
Date: Tue, 11 Nov 2014 14:44:57 -0800Quoted 2 lines
Use the normal kernel debugging mechanism which also enables
dynamic_debugat the same time.Applied to net-next, thanks Joe.
Quoted 8 lines
Apologies.
There was obviously insufficient platform and config option testing on this patch.
David, can you lease revert and I'll work out the various platform options defects that have been reported by Fengguang's kbuild test robot.
I believe this should fix all the build failures.
Let me know if you want this as a a patch or a
reversion followed by a consolidated new version.
net/irda/ircomm/ircomm_event.c | 4 +--- net/irda/ircomm/ircomm_tty_attach.c | 4 +--- net/irda/iriap.c | 4 +--- net/irda/irlap.c | 4 +--- net/irda/irlap_event.c | 4 +--- net/irda/irlmp_event.c | 4 +--- 6 files changed, 6 insertions(+), 18 deletions(-)
net/irda/ircomm/ircomm_event.c +1 -3
@@ -54,8 +54,7 @@ const char *const ircomm_state[] = { "IRCOMM_CONN", }; -#ifdef CONFIG_IRDA_DEBUG -static const char *const ircomm_event[] = { +static const char *const ircomm_event[]__maybe_unused = {"IRCOMM_CONNECT_REQUEST" ,"IRCOMM_CONNECT_RESPONSE" ,"IRCOMM_TTP_CONNECT_INDICATION" ,
@@ -73,7 +72,6 @@ static const char *const ircomm_event[] = {"IRCOMM_CONTROL_REQUEST" , "IRCOMM_CONTROL_INDICATION", }; -#endif /* CONFIG_IRDA_DEBUG */ static int (*state[])(struct ircomm_cb *self,IRCOMM_EVENT event, struct sk_buff *skb, struct ircomm_info *info) =
net/irda/ircomm/ircomm_tty_attach.c +1 -3
@@ -89,8 +89,7 @@ const char *const ircomm_tty_state[] = { "*** ERROR *** ", }; -#ifdef CONFIG_IRDA_DEBUG -static const char *const ircomm_tty_event[] = { +static const char *const ircomm_tty_event[]__maybe_unused = {"IRCOMM_TTY_ATTACH_CABLE" ,"IRCOMM_TTY_DETACH_CABLE" ,"IRCOMM_TTY_DATA_REQUEST" ,
@@ -106,7 +105,6 @@ static const char *const ircomm_tty_event[] = {"IRCOMM_TTY_GOT_LSAPSEL" , "*** ERROR ****", }; -#endif /* CONFIG_IRDA_DEBUG */ static int (*state[])(struct ircomm_tty_cb *self,IRCOMM_TTY_EVENT event, struct sk_buff *skb, struct ircomm_tty_info *info) =
net/irda/iriap.c +1 -3
@@ -43,9 +43,8 @@#include <net/irda/iriap_event.h> #include <net/irda/iriap.h> -#ifdef CONFIG_IRDA_DEBUG /* FIXME: This one should go in irlmp.c */ -static const char *const ias_charset_types[] = { +static const char *const ias_charset_types[]__maybe_unused = {"CS_ASCII" ,"CS_ISO_8859_1" ,"CS_ISO_8859_2" ,
@@ -58,7 +57,6 @@ static const char *const ias_charset_types[] = {"CS_ISO_8859_9" , "CS_UNICODE" }; -#endif /* CONFIG_IRDA_DEBUG */ static hashbin_t *iriap =NULL ;static void *service_handle;
net/irda/irlap.c +1 -3
@@ -60,8 +60,7 @@ static void __irlap_close(struct irlap_cb *self);static void irlap_init_qos_capabilities (struct irlap_cb *self,struct qos_info *qos_user); -#ifdef CONFIG_IRDA_DEBUG -static const char *const lap_reasons[] = { +static const char *const lap_reasons[]__maybe_unused = {"ERROR, NOT USED" ,"LAP_DISC_INDICATION" ,"LAP_NO_RESPONSE" ,
@@ -71,7 +70,6 @@ static const char *const lap_reasons[] = {"LAP_PRIMARY_CONFLICT" , "ERROR, NOT USED", }; -#endif /* CONFIG_IRDA_DEBUG */ int __init irlap_init (void ) {
net/irda/irlap_event.c +1 -3
@@ -78,8 +78,7 @@ static int irlap_state_sclose (struct irlap_cb *self, IRLAP_EVENT event,static int irlap_state_reset_check (struct irlap_cb *,IRLAP_EVENT event,struct sk_buff *,struct irlap_info *); -#ifdef CONFIG_IRDA_DEBUG -static const char *const irlap_event[] = { +static const char *const irlap_event[]__maybe_unused = {"DISCOVERY_REQUEST" ,"CONNECT_REQUEST" ,"CONNECT_RESPONSE" ,
@@ -119,7 +118,6 @@ static const char *const irlap_event[] = {"BACKOFF_TIMER_EXPIRED" , "MEDIA_BUSY_TIMER_EXPIRED", }; -#endif /* CONFIG_IRDA_DEBUG */ const char *const irlap_state[] = { "LAP_NDM",
net/irda/irlmp_event.c +1 -3
@@ -48,8 +48,7 @@ const char *const irlsap_state[] = { "LSAP_SETUP_PEND", }; -#ifdef CONFIG_IRDA_DEBUG -static const char *const irlmp_event[] = { +static const char *const irlmp_event[]__maybe_unused = {"LM_CONNECT_REQUEST" ,"LM_CONNECT_CONFIRM" ,"LM_CONNECT_RESPONSE" ,
@@ -75,7 +74,6 @@ static const char *const irlmp_event[] = {"LM_LAP_DISCOVERY_CONFIRM" , "LM_LAP_IDLE_TIMEOUT", }; -#endif /* CONFIG_IRDA_DEBUG */ /* LAP Connection control proto declarations */ static void irlmp_state_standby (struct lap_cb *, IRLMP_EVENT,
David Miller
maintainerRe: [PATCH] irda: Fix build failures after IRDA_DEBUG->pr_debug
From: Joe Perches <[email protected]>
Date: Wed, 12 Nov 2014 18:15:47 -0800
Quoted 4 lines
Fix the build failures that result from the use of
pr_debugwithout the referenced char * arrays being defined.Signed-off-by Joe Perches <[email protected]>
...
Quoted 2 lines
Let me know if you want this as a a patch or a
reversion followed by a consolidated new version.
I'll just apply this patch, it's the cleanest thing to do at this point.
Thanks.
David Miller
maintainerRe: [PATCH] irda: Remove IRDA_<TYPE> logging macros
In reply to Joe PerchesFrom: Joe Perches <[email protected]>
Date: Tue, 11 Nov 2014 13:37:30 -0800
Quoted 10 lines
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.
Quoted 5 lines
Signed-off-by Joe Perches <[email protected]>---
Some long line warnings still exist for individual variables. switch/case style was also not changed.
Looks good, applied, thanks Joe.