pcmcia: cm4000_cs.c: Remove duplicated function names
PATCH 1/2 pcmcia: cm4000_cs.c: Remove duplicated function names
The macro DEBUGP already ensures that __func__ is included in the output, so there's no reason to have the function name in the format string itself.
--- drivers/char/pcmcia/cm4000_cs.c | 52 ++++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 26 deletions(-)
drivers/char/pcmcia/cm4000_cs.c +26 -26
@@ -322,10 +322,10 @@ static int parse_atr(struct cm4000_dev *dev)unsigned char ch, ifno;int ix, done; -DEBUGP (3 , dev,"-> parse_atr: dev->atr_len = %i\n" , dev->atr_len); +DEBUGP (3 , dev,"dev->atr_len = %i\n" , dev->atr_len);if (dev->atr_len <3 ) { -DEBUGP (5 , dev,"parse_atr: atr_len < 3\n" ); +DEBUGP (5 , dev,"atr_len < 3\n" );return 0 ; }
@@ -423,7 +423,7 @@ static void set_cardparameter(struct cm4000_dev *dev)unsigned int iobase = dev->p_dev->resource[0 ]->start;u_int8_t stopbits =0x02 ;/* ISO default */ -DEBUGP (3 , dev,"-> set_cardparameter\n" ); +DEBUGP (3 , dev,"->\n" ); dev->flags1 = dev->flags1 | (((dev->baudv -1 ) &0x0100 ) >>8 );xoutb (dev->flags1,REG_FLAGS1 (iobase));
@@ -443,7 +443,7 @@ static void set_cardparameter(struct cm4000_dev *dev) }xoutb (stopbits,REG_STOPBITS (iobase)); -DEBUGP (3 , dev,"<- set_cardparameter\n" ); +DEBUGP (3 , dev,"<-\n" ); }static int set_protocol (struct cm4000_dev *dev,struct ptsreq *ptsreq)
@@ -457,7 +457,7 @@ static int set_protocol(struct cm4000_dev *dev, struct ptsreq *ptsreq) rc =0 ; -DEBUGP (3 , dev,"-> set_protocol\n" ); +DEBUGP (3 , dev,"->\n" ); DEBUGP(5, dev, "ptsreq->Protocol = 0x%.8x, ptsreq->Flags=0x%.8x, " "ptsreq->pts1=0x%.2x, ptsreq->pts2=0x%.2x, " "ptsreq->pts3=0x%.2x\n", (unsigned int)ptsreq->protocol,
@@ -597,7 +597,7 @@ static int set_protocol(struct cm4000_dev *dev, struct ptsreq *ptsreq) rc = -EIO ; exit_setprotocol: -DEBUGP (3 , dev,"<- set_protocol\n" ); +DEBUGP (3 , dev,"<-\n" );return rc; }
@@ -628,7 +628,7 @@ static void terminate_monitor(struct cm4000_dev *dev)/* tell the monitor to stop and wait until * it terminates. */ -DEBUGP (3 , dev,"-> terminate_monitor\n" ); +DEBUGP (3 , dev,"->\n" );wait_event_interruptible (dev->devq,test_and_set_bit (LOCK_MONITOR , (void *)&dev->flags));
@@ -648,7 +648,7 @@ static void terminate_monitor(struct cm4000_dev *dev) dev->monitor_running =0 ;#endif -DEBUGP (3 , dev,"<- terminate_monitor\n" ); +DEBUGP (3 , dev,"<-\n" ); }/*
@@ -667,7 +667,7 @@ static void monitor_card(unsigned long p)struct ptsreq ptsreq;int i, atrc; -DEBUGP (7 , dev,"-> monitor_card\n" ); +DEBUGP (7 , dev,"->\n" );/* if someone has set the lock for us: we're done! */ if (test_and_set_bit (LOCK_MONITOR , &dev->flags)) {
@@ -680,7 +680,7 @@ static void monitor_card(unsigned long p)clear_bit (LOCK_MONITOR , &dev->flags);/* close et al. are sleeping on devq, so wake it */ wake_up_interruptible (&dev->devq); -DEBUGP (2 , dev,"<- monitor_card (we are done now)\n" ); +DEBUGP (2 , dev,"<- (we are done now)\n" );return ; }
@@ -821,7 +821,7 @@ static void monitor_card(unsigned long p) }if (test_bit (IS_ATR_VALID , &dev->flags) ==1 ) { -DEBUGP (4 , dev,"monitor_card: ATR valid\n" ); +DEBUGP (4 , dev,"ATR valid\n" );/* if ta1 == 0x11, no PPS necessary (default values) */ /* do not do PPS with multi protocol cards */ if ((test_bit(IS_AUTOPPS_ACT, &dev->flags) == 0) &&
@@ -911,7 +911,7 @@ release_io:wake_up_interruptible (&dev->ioq);/* whoever needs IO */ return_with_timer: -DEBUGP (7 , dev,"<- monitor_card (returns with timer)\n" ); +DEBUGP (7 , dev,"<- (returns with timer)\n" );mod_timer (&dev->timer, jiffies + dev->mdelay);clear_bit (LOCK_MONITOR , &dev->flags); }
@@ -926,7 +926,7 @@ static ssize_t cmm_read(struct file *filp, __user char *buf, size_t count,ssize_t rc;int i, j, k; -DEBUGP (2 , dev,"-> cmm_read(%s,%d)\n" , current->comm, current->pid); +DEBUGP (2 , dev,"-> (%s,%d)\n" , current->comm, current->pid);if (count ==0 )/* according to manpage */ return 0 ;
@@ -1037,7 +1037,7 @@ release_io:clear_bit (LOCK_IO , &dev->flags);wake_up_interruptible (&dev->ioq); -DEBUGP (2 , dev,"<- cmm_read returns: rc = %Zi\n" , +DEBUGP (2 , dev,"<- returns: rc = %Zi\n" , (rc <0 ? rc : count));return rc <0 ? rc : count; }
@@ -1056,7 +1056,7 @@ static ssize_t cmm_write(struct file *filp, const char __user *buf,ssize_t rc;int i; -DEBUGP (2 , dev,"-> cmm_write(%s,%d)\n" , current->comm, current->pid); +DEBUGP (2 , dev,"-> (%s,%d)\n" , current->comm, current->pid);if (count ==0 )/* according to manpage */ return 0 ;
@@ -1365,13 +1365,13 @@ release_io:memset ((char *)dev->sbuf,0 ,512 );/* return error or actually written bytes */ -DEBUGP (2 , dev,"<- cmm_write\n" ); +DEBUGP (2 , dev,"<-\n" );return rc <0 ? rc : nr; }static void start_monitor (struct cm4000_dev *dev) { -DEBUGP (3 , dev,"-> start_monitor\n" ); +DEBUGP (3 , dev,"->\n" );if (!dev->monitor_running) {DEBUGP (5 , dev,"create, init and add timer\n" );setup_timer (&dev->timer, monitor_card, (unsigned long )dev);
@@ -1379,12 +1379,12 @@ static void start_monitor(struct cm4000_dev *dev)mod_timer (&dev->timer, jiffies); }else DEBUGP (5 , dev,"monitor already running\n" ); -DEBUGP (3 , dev,"<- start_monitor\n" ); +DEBUGP (3 , dev,"<-\n" ); }static void stop_monitor (struct cm4000_dev *dev) { -DEBUGP (3 , dev,"-> stop_monitor\n" ); +DEBUGP (3 , dev,"->\n" );if (dev->monitor_running) {DEBUGP (5 , dev,"stopping monitor\n" );terminate_monitor (dev);
@@ -1393,7 +1393,7 @@ static void stop_monitor(struct cm4000_dev *dev)clear_bit (IS_ATR_PRESENT , &dev->flags); }else DEBUGP (5 , dev,"monitor already stopped\n" ); -DEBUGP (3 , dev,"<- stop_monitor\n" ); +DEBUGP (3 , dev,"<-\n" ); }static long cmm_ioctl (struct file *filp,unsigned int cmd,unsigned long arg)
@@ -1654,7 +1654,7 @@ static int cmm_open(struct inode *inode, struct file *filp) dev = link->priv; filp->private_data = dev; -DEBUGP (2 , dev,"-> cmm_open(device=%d.%d process=%s,%d)\n" , +DEBUGP (2 , dev,"-> (device=%d.%d process=%s,%d)\n" ,imajor (inode), minor, current->comm, current->pid);/* init device variables, they may be "polluted" after close
@@ -1681,7 +1681,7 @@ static int cmm_open(struct inode *inode, struct file *filp) link->open =1 ;/* only one open per device */ -DEBUGP (2 , dev,"<- cmm_open\n" ); +DEBUGP (2 , dev,"<-\n" ); ret =nonseekable_open (inode, filp); out:mutex_unlock (&cmm_mutex);
@@ -1703,7 +1703,7 @@ static int cmm_close(struct inode *inode, struct file *filp) dev = link->priv; -DEBUGP (2 , dev,"-> cmm_close(maj/min=%d.%d)\n" , +DEBUGP (2 , dev,"-> (maj/min=%d.%d)\n" ,imajor (inode), minor);stop_monitor (dev);
@@ -1713,7 +1713,7 @@ static int cmm_close(struct inode *inode, struct file *filp) link->open =0 ;/* only one open per device */ wake_up (&dev->devq);/* socket removed? */ -DEBUGP (2 , dev,"cmm_close\n" ); +DEBUGP (2 , dev,"<-\n" );return 0 ; }
@@ -1724,7 +1724,7 @@ static void cmm_cm4000_release(struct pcmcia_device * link)/* dont terminate the monitor, rather rely on * close doing that for us. */ -DEBUGP (3 , dev,"-> cmm_cm4000_release\n" ); +DEBUGP (3 , dev,"->\n" );while (link->open) { printk(KERN_INFO MODULE_NAME ": delaying release until " "process has terminated\n");
@@ -1735,7 +1735,7 @@ static void cmm_cm4000_release(struct pcmcia_device * link)wait_event (dev->devq, (link->open ==0 )); }/* dev->devq=NULL; this cannot be zeroed earlier */ -DEBUGP (3 , dev,"<- cmm_cm4000_release\n" ); +DEBUGP (3 , dev,"<-\n" );return ; }
Signature · 1 line
2.1.3
PATCH 2/2 pcmcia: cm4040_cs.c: Remove duplicated function names
The macro DEBUGP already ensures that __func__ is included in the output, so there's no reason to have the function name in the format string itself.
I've also removed a useless KERN_INFO in cm4040_reader_release which would end up in the middle of the format string.
--- drivers/char/pcmcia/cm4040_cs.c | 46 ++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 23 deletions(-)
drivers/char/pcmcia/cm4040_cs.c +23 -23
@@ -223,7 +223,7 @@ static ssize_t cm4040_read(struct file *filp, char __user *buf,int rc;unsigned char uc; -DEBUGP (2 , dev,"-> cm4040_read(%s,%d)\n" , current->comm, current->pid); +DEBUGP (2 , dev,"-> %s,%d\n" , current->comm, current->pid);if (count ==0 )return 0 ;
@@ -233,7 +233,7 @@ static ssize_t cm4040_read(struct file *filp, char __user *buf,if (filp->f_flags &O_NONBLOCK ) {DEBUGP (4 , dev,"filep->f_flags O_NONBLOCK set\n" ); -DEBUGP (2 , dev,"<- cm4040_read (failure)\n" ); +DEBUGP (2 , dev,"<- failure\n" );return -EAGAIN ; }
@@ -244,7 +244,7 @@ static ssize_t cm4040_read(struct file *filp, char __user *buf, rc =wait_for_bulk_in_ready (dev);if (rc <=0 ) {DEBUGP (5 , dev,"wait_for_bulk_in_ready rc=%.2x\n" , rc); -DEBUGP (2 , dev,"<- cm4040_read (failed)\n" ); +DEBUGP (2 , dev,"<- failed\n" );if (rc == -ERESTARTSYS )return rc;return -EIO ;
@@ -271,7 +271,7 @@ static ssize_t cm4040_read(struct file *filp, char __user *buf, rc =wait_for_bulk_in_ready (dev);if (rc <=0 ) {DEBUGP (5 , dev,"wait_for_bulk_in_ready rc=%.2x\n" , rc); -DEBUGP (2 , dev,"<- cm4040_read (failed)\n" ); +DEBUGP (2 , dev,"<- failed\n" );if (rc == -ERESTARTSYS )return rc;return -EIO ;
@@ -292,7 +292,7 @@ static ssize_t cm4040_read(struct file *filp, char __user *buf, rc =wait_for_bulk_in_ready (dev);if (rc <=0 ) {DEBUGP (5 , dev,"wait_for_bulk_in_ready rc=%.2x\n" , rc); -DEBUGP (2 , dev,"<- cm4040_read (failed)\n" ); +DEBUGP (2 , dev,"<- failed\n" );if (rc == -ERESTARTSYS )return rc;return -EIO ;
@@ -301,7 +301,7 @@ static ssize_t cm4040_read(struct file *filp, char __user *buf, rc =write_sync_reg (SCR_READER_TO_HOST_DONE , dev);if (rc <=0 ) {DEBUGP (5 , dev,"write_sync_reg c=%.2x\n" , rc); -DEBUGP (2 , dev,"<- cm4040_read (failed)\n" ); +DEBUGP (2 , dev,"<- failed\n" );if (rc == -ERESTARTSYS )return rc;else
@@ -310,7 +310,7 @@ static ssize_t cm4040_read(struct file *filp, char __user *buf, uc =xinb (iobase +REG_OFFSET_BULK_IN ); -DEBUGP (2 , dev,"<- cm4040_read (successfully)\n" ); +DEBUGP (2 , dev,"<- successfully\n" );return min_bytes_to_read; }
@@ -323,21 +323,21 @@ static ssize_t cm4040_write(struct file *filp, const char __user *buf,int i;unsigned int bytes_to_write; -DEBUGP (2 , dev,"-> cm4040_write(%s,%d)\n" , current->comm, current->pid); +DEBUGP (2 , dev,"-> %s,%d\n" , current->comm, current->pid);if (count ==0 ) { -DEBUGP (2 , dev,"<- cm4040_write empty read (successfully)\n" ); +DEBUGP (2 , dev,"<- empty read (successfully)\n" );return 0 ; }if ((count <5 ) || (count >READ_WRITE_BUFFER_SIZE )) { -DEBUGP (2 , dev,"<- cm4040_write buffersize=%Zd < 5\n" , count); +DEBUGP (2 , dev,"<- buffersize=%Zd < 5\n" , count);return -EIO ; }if (filp->f_flags &O_NONBLOCK ) {DEBUGP (4 , dev,"filep->f_flags O_NONBLOCK set\n" ); -DEBUGP (4 , dev,"<- cm4040_write (failure)\n" ); +DEBUGP (4 , dev,"<- failure\n" );return -EAGAIN ; }
@@ -375,7 +375,7 @@ static ssize_t cm4040_write(struct file *filp, const char __user *buf, rc =write_sync_reg (SCR_HOST_TO_READER_START , dev);if (rc <=0 ) {DEBUGP (5 , dev,"write_sync_reg c=%.2Zx\n" , rc); -DEBUGP (2 , dev,"<- cm4040_write (failed)\n" ); +DEBUGP (2 , dev,"<- failed\n" );if (rc == -ERESTARTSYS )return rc;else
@@ -389,7 +389,7 @@ static ssize_t cm4040_write(struct file *filp, const char __user *buf,if (rc <=0 ) {DEBUGP (5 , dev,"wait_for_bulk_out_ready rc=%.2Zx\n" , rc); -DEBUGP (2 , dev,"<- cm4040_write (failed)\n" ); +DEBUGP (2 , dev,"<- failed\n" );if (rc == -ERESTARTSYS )return rc;else
@@ -404,14 +404,14 @@ static ssize_t cm4040_write(struct file *filp, const char __user *buf,if (rc <=0 ) {DEBUGP (5 , dev,"write_sync_reg c=%.2Zx\n" , rc); -DEBUGP (2 , dev,"<- cm4040_write (failed)\n" ); +DEBUGP (2 , dev,"<- failed\n" );if (rc == -ERESTARTSYS )return rc;else return -EIO ; } -DEBUGP (2 , dev,"<- cm4040_write (successfully)\n" ); +DEBUGP (2 , dev,"<- successfully\n" );return count; }
@@ -427,7 +427,7 @@ static unsigned int cm4040_poll(struct file *filp, poll_table *wait)if (test_and_clear_bit (BS_WRITABLE , &dev->buffer_status)) mask |=POLLOUT |POLLWRNORM ; -DEBUGP (2 , dev,"<- cm4040_poll(%u)\n" , mask); +DEBUGP (2 , dev,"<- %u\n" , mask);return mask; }
@@ -468,7 +468,7 @@ static int cm4040_open(struct inode *inode, struct file *filp) dev->poll_timer.data = (unsigned long ) dev;mod_timer (&dev->poll_timer, jiffies +POLL_PERIOD ); -DEBUGP (2 , dev,"<- cm4040_open (successfully)\n" ); +DEBUGP (2 , dev,"<- successfully\n" ); ret =nonseekable_open (inode, filp); out:mutex_unlock (&cm4040_mutex);
@@ -481,7 +481,7 @@ static int cm4040_close(struct inode *inode, struct file *filp)struct pcmcia_device *link;int minor =iminor (inode); -DEBUGP (2 , dev,"-> cm4040_close(maj/min=%d.%d)\n" ,imajor (inode), +DEBUGP (2 , dev,"-> maj/min=%d.%d\n" ,imajor (inode),iminor (inode));if (minor >=CM_MAX_DEV )
@@ -496,7 +496,7 @@ static int cm4040_close(struct inode *inode, struct file *filp) link->open =0 ;wake_up (&dev->devq); -DEBUGP (2 , dev,"<- cm4040_close\n" ); +DEBUGP (2 , dev,"<-\n" );return 0 ; }
@@ -504,13 +504,13 @@ static void cm4040_reader_release(struct pcmcia_device *link) {struct reader_dev *dev = link->priv; -DEBUGP (3 , dev,"-> cm4040_reader_release\n" ); +DEBUGP (3 , dev,"->\n" );while (link->open) { - DEBUGP(3, dev, KERN_INFO MODULE_NAME ": delaying release " +DEBUGP (3 , dev,MODULE_NAME ": delaying release " "until process has terminated\n" );wait_event (dev->devq, (link->open ==0 )); } -DEBUGP (3 , dev,"<- cm4040_reader_release\n" ); +DEBUGP (3 , dev,"<-\n" );return ; }
@@ -542,7 +542,7 @@ static int reader_config(struct pcmcia_device *link, int devno)DEBUGP (2 , dev,"device " DEVICE_NAME "%d at %pR\n" , devno, link->resource[0 ]); -DEBUGP (2 , dev,"<- reader_config (succ)\n" ); +DEBUGP (2 , dev,"<- success\n" );return 0 ;
Signature · 1 line
2.1.3
Hi Rasmus,
Quoted 3 lines · Rasmus Villemoes
The macro DEBUGP already ensures that
__func__is included in the output, so there's no reason to have the function name in the format string itself.
also for 2/2 of that patch series. Thanks!
Regards,
Harald
Signature · 4 lines
- Harald Welte <[email protected]> http://laforge.gnumonks.org/ ============================================================================ "Privacy in residential applications is a desirable marketing option." (ETSI EN 300 175-7 Ch. A6)