staging: i4l: act2000: fix use of return
PATCH 1/4 staging: i4l: act2000: fix use of return
checkpatch warns that return is not a function and as such the brace after it is not required.
Signed-off-by Sudip Mukherjee <[email protected]>
--- drivers/staging/i4l/act2000/act2000_isa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/i4l/act2000/act2000_isa.c +1 -1
@@ -439,5 +439,5 @@ act2000_isa_download(act2000_card *card, act2000_ddef __user *cb) }kfree (buf);msleep_interruptible (500 ); -return (act2000_isa_getid (card)); +return act2000_isa_getid (card); }
Signature · 1 line
1.9.1
PATCH 2/4 staging: i4l: act2000: do not assign in if
It is not the kernel coding style to assign values to some variable in if statement. Split them up into different statements.
Signed-off-by Sudip Mukherjee <[email protected]>
--- drivers/staging/i4l/act2000/act2000_isa.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/staging/i4l/act2000/act2000_isa.c +6 -3
@@ -31,7 +31,8 @@ act2000_isa_reset(unsigned short portbase)int serial =0 ; found =0 ; -if ((reg =inb (portbase +ISA_COR )) !=0xff ) { + reg =inb (portbase +ISA_COR ); +if (reg !=0xff ) {outb (reg |ISA_COR_RESET , portbase +ISA_COR );mdelay (10 );outb (reg, portbase +ISA_COR );
@@ -303,7 +304,8 @@ act2000_isa_send(act2000_card *card)while (1 ) {spin_lock_irqsave (&card->lock, flags);if (!(card->sbuf)) { -if ((card->sbuf =skb_dequeue (&card->sndq))) { + card->sbuf =skb_dequeue (&card->sndq); +if (card->sbuf) { card->ack_msg = card->sbuf->data; msg = (actcapi_msg *)card->sbuf->data; if ((msg->hdr.cmd.cmd == 0x86) &&
@@ -378,7 +380,8 @@ act2000_isa_getid(act2000_card *card)printk (KERN_WARNING "act2000: Wrong Firmware-ID!\n" );return -EPROTO ; } -if ((p =strchr (fid.revision,'\n' ))) + p =strchr (fid.revision,'\n' ); +if (p) *p ='\0' ;printk (KERN_INFO "act2000: Firmware-ID: %s\n" , fid.revision);if (card->flags &ACT2000_FLAGS_IVALID ) {
Signature · 1 line
1.9.1
PATCH 3/4 staging: i4l: act2000: remove blank line after brace
In reply to Sudip Mukherjeecheckpatch complains about an extra blank line after an opening brace.
Signed-off-by Sudip Mukherjee <[email protected]>
--- drivers/staging/i4l/act2000/act2000_isa.c | 1 - 1 file changed, 1 deletion(-)
drivers/staging/i4l/act2000/act2000_isa.c +0 -1
@@ -358,7 +358,6 @@ act2000_isa_send(act2000_card *card)static int act2000_isa_getid (act2000_card *card) { -act2000_fwid fid;u_char *p = (u_char *)&fid;int count =0 ;
Signature · 1 line
1.9.1
PATCH 4/4 staging: i4l: act2000: remove extra space
In reply to Sudip MukherjeeIt is not kernel coding style to give an extra space after a cast. We get warned about it by checkpatch.
Signed-off-by Sudip Mukherjee <[email protected]>
--- drivers/staging/i4l/act2000/act2000_isa.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/staging/i4l/act2000/act2000_isa.c +6 -6
@@ -233,7 +233,7 @@ act2000_isa_receive(act2000_card *card) {u_char c; -if (test_and_set_bit (ACT2000_LOCK_RX , (void *) &card->ilock) !=0 ) +if (test_and_set_bit (ACT2000_LOCK_RX , (void *)&card->ilock) !=0 )return ;while (!act2000_isa_readb (card, &c)) {if (card->idat.isa.rcvidx <8 ) {
@@ -248,7 +248,7 @@ act2000_isa_receive(act2000_card *card) card->idat.isa.rcvignore =1 ;printk (KERN_WARNING "act2000_isa_receive: no memory\n" ); -test_and_clear_bit (ACT2000_LOCK_RX , (void *) &card->ilock); +test_and_clear_bit (ACT2000_LOCK_RX , (void *)&card->ilock);return ; }memcpy (skb_put (card->idat.isa.rcvskb,8 ), card->idat.isa.rcvhdr,8 );
@@ -288,7 +288,7 @@ act2000_isa_receive(act2000_card *card) (card->idat.isa.rcvidx < card->idat.isa.rcvlen)))act2000_schedule_poll (card); } -test_and_clear_bit (ACT2000_LOCK_RX , (void *) &card->ilock); +test_and_clear_bit (ACT2000_LOCK_RX , (void *)&card->ilock); }void
@@ -299,7 +299,7 @@ act2000_isa_send(act2000_card *card)actcapi_msg *msg;int l; -if (test_and_set_bit (ACT2000_LOCK_TX , (void *) &card->ilock) !=0 ) +if (test_and_set_bit (ACT2000_LOCK_TX , (void *)&card->ilock) !=0 )return ;while (1 ) {spin_lock_irqsave (&card->lock, flags);
@@ -319,7 +319,7 @@ act2000_isa_send(act2000_card *card)spin_unlock_irqrestore (&card->lock, flags);if (!(card->sbuf)) {/* No more data to send */ -test_and_clear_bit (ACT2000_LOCK_TX , (void *) &card->ilock); +test_and_clear_bit (ACT2000_LOCK_TX , (void *)&card->ilock);return ; } skb = card->sbuf;
@@ -327,7 +327,7 @@ act2000_isa_send(act2000_card *card)while (skb->len) {if (act2000_isa_writeb (card, *(skb->data))) {/* Fifo is full, but more data to send */ -test_and_clear_bit (ACT2000_LOCK_TX , (void *) &card->ilock); +test_and_clear_bit (ACT2000_LOCK_TX , (void *)&card->ilock);/* Schedule myself */ act2000_schedule_tx (card);return ;
Signature · 1 line
1.9.1