* [PATCH 1/4] staging: i4l: act2000: fix use of return
@ 2016-04-30 21:33 Sudip Mukherjee
2016-04-30 21:33 ` [PATCH 2/4] staging: i4l: act2000: do not assign in if Sudip Mukherjee
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Sudip Mukherjee @ 2016-04-30 21:33 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-kernel, devel, Sudip Mukherjee
checkpatch warns that return is not a function and as such the brace
after it is not required.
Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
---
drivers/staging/i4l/act2000/act2000_isa.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/i4l/act2000/act2000_isa.c b/drivers/staging/i4l/act2000/act2000_isa.c
index b5fad29..34c0a9a 100644
--- a/drivers/staging/i4l/act2000/act2000_isa.c
+++ b/drivers/staging/i4l/act2000/act2000_isa.c
@@ -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);
}
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/4] staging: i4l: act2000: do not assign in if
2016-04-30 21:33 [PATCH 1/4] staging: i4l: act2000: fix use of return Sudip Mukherjee
@ 2016-04-30 21:33 ` Sudip Mukherjee
2016-04-30 21:33 ` [PATCH 3/4] staging: i4l: act2000: remove blank line after brace Sudip Mukherjee
2016-04-30 21:33 ` [PATCH 4/4] staging: i4l: act2000: remove extra space Sudip Mukherjee
2 siblings, 0 replies; 4+ messages in thread
From: Sudip Mukherjee @ 2016-04-30 21:33 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-kernel, devel, Sudip Mukherjee
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 <sudip.mukherjee@codethink.co.uk>
---
drivers/staging/i4l/act2000/act2000_isa.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/i4l/act2000/act2000_isa.c b/drivers/staging/i4l/act2000/act2000_isa.c
index 34c0a9a..048507e 100644
--- a/drivers/staging/i4l/act2000/act2000_isa.c
+++ b/drivers/staging/i4l/act2000/act2000_isa.c
@@ -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) {
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 3/4] staging: i4l: act2000: remove blank line after brace
2016-04-30 21:33 [PATCH 1/4] staging: i4l: act2000: fix use of return Sudip Mukherjee
2016-04-30 21:33 ` [PATCH 2/4] staging: i4l: act2000: do not assign in if Sudip Mukherjee
@ 2016-04-30 21:33 ` Sudip Mukherjee
2016-04-30 21:33 ` [PATCH 4/4] staging: i4l: act2000: remove extra space Sudip Mukherjee
2 siblings, 0 replies; 4+ messages in thread
From: Sudip Mukherjee @ 2016-04-30 21:33 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-kernel, devel, Sudip Mukherjee
checkpatch complains about an extra blank line after an opening brace.
Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
---
drivers/staging/i4l/act2000/act2000_isa.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/staging/i4l/act2000/act2000_isa.c b/drivers/staging/i4l/act2000/act2000_isa.c
index 048507e..27c0046 100644
--- a/drivers/staging/i4l/act2000/act2000_isa.c
+++ b/drivers/staging/i4l/act2000/act2000_isa.c
@@ -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;
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 4/4] staging: i4l: act2000: remove extra space
2016-04-30 21:33 [PATCH 1/4] staging: i4l: act2000: fix use of return Sudip Mukherjee
2016-04-30 21:33 ` [PATCH 2/4] staging: i4l: act2000: do not assign in if Sudip Mukherjee
2016-04-30 21:33 ` [PATCH 3/4] staging: i4l: act2000: remove blank line after brace Sudip Mukherjee
@ 2016-04-30 21:33 ` Sudip Mukherjee
2 siblings, 0 replies; 4+ messages in thread
From: Sudip Mukherjee @ 2016-04-30 21:33 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-kernel, devel, Sudip Mukherjee
It 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 <sudip.mukherjee@codethink.co.uk>
---
drivers/staging/i4l/act2000/act2000_isa.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/i4l/act2000/act2000_isa.c b/drivers/staging/i4l/act2000/act2000_isa.c
index 27c0046..f0eb844 100644
--- a/drivers/staging/i4l/act2000/act2000_isa.c
+++ b/drivers/staging/i4l/act2000/act2000_isa.c
@@ -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;
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-04-30 21:33 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-30 21:33 [PATCH 1/4] staging: i4l: act2000: fix use of return Sudip Mukherjee
2016-04-30 21:33 ` [PATCH 2/4] staging: i4l: act2000: do not assign in if Sudip Mukherjee
2016-04-30 21:33 ` [PATCH 3/4] staging: i4l: act2000: remove blank line after brace Sudip Mukherjee
2016-04-30 21:33 ` [PATCH 4/4] staging: i4l: act2000: remove extra space Sudip Mukherjee
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).