Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1356728 > unrolled thread
| Started by | Cosmin-Gabriel Samoila <gabrielcsmo@gmail.com> |
|---|---|
| First post | 2016-03-13 20:30 +0100 |
| Last post | 2016-03-13 21:00 +0100 |
| Articles | 3 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH 2/2] isdn: hisax: isac: fixed code style issues. Cosmin-Gabriel Samoila <gabrielcsmo@gmail.com> - 2016-03-13 20:30 +0100
Re: [PATCH 2/2] isdn: hisax: isac: fixed code style issues. Joe Perches <joe@perches.com> - 2016-03-13 20:40 +0100
Re: [PATCH 2/2] isdn: hisax: isac: fixed code style issues. Daniel Baluta <daniel.baluta@gmail.com> - 2016-03-13 21:00 +0100
| From | Cosmin-Gabriel Samoila <gabrielcsmo@gmail.com> |
|---|---|
| Date | 2016-03-13 20:30 +0100 |
| Subject | [PATCH 2/2] isdn: hisax: isac: fixed code style issues. |
| Message-ID | <rcjSa-1yg-13@gated-at.bofh.it> |
Fixed errors and warnings reported by checkpatch.pl.
Signed-off-by: Cosmin-Gabriel Samoila <gabrielcsmo@gmail.com>
---
drivers/isdn/hisax/isac.c | 32 ++++++++++++++++++--------------
1 file changed, 18 insertions(+), 14 deletions(-)
diff --git a/drivers/isdn/hisax/isac.c b/drivers/isdn/hisax/isac.c
index 7fdf78f..419abe1 100644
--- a/drivers/isdn/hisax/isac.c
+++ b/drivers/isdn/hisax/isac.c
@@ -24,9 +24,8 @@
#define DBUSY_TIMER_VALUE 80
#define ARCOFI_USE 1
-static char *ISACVer[] =
-{"2086/2186 V1.1", "2085 B1", "2085 B2",
- "2085 V2.3"};
+static char *ISACVer[] = {"2086/2186 V1.1", "2085 B1", "2085 B2",
+"2085 V2.3"};
void ISACVersion(struct IsdnCardState *cs, char *s)
{
@@ -215,9 +214,11 @@ isac_interrupt(struct IsdnCardState *cs, u_char val)
if (count == 0)
count = 32;
isac_empty_fifo(cs, count);
- if ((count = cs->rcvidx) > 0) {
+ count = cs->rcvidx;
+ if (count > 0) {
cs->rcvidx = 0;
- if (!(skb = alloc_skb(count, GFP_ATOMIC)))
+ skb = alloc_skb(count, GFP_ATOMIC);
+ if (!skb)
printk(KERN_WARNING "HiSax: D receive out of memory\n");
else {
memcpy(skb_put(skb, count), cs->rcvbuf, count);
@@ -251,11 +252,12 @@ isac_interrupt(struct IsdnCardState *cs, u_char val)
cs->tx_skb = NULL;
}
}
- if ((cs->tx_skb = skb_dequeue(&cs->sq))) {
+ cs->tx_skb = skb_dequeue(&cs->sq);
+ if (cs->tx_skb) {
cs->tx_cnt = 0;
isac_fill_fifo(cs);
- } else
- schedule_event(cs, D_XMTBUFREADY);
+ }
+ schedule_event(cs, D_XMTBUFREADY);
}
afterXPR:
if (val & 0x04) { /* CISQ */
@@ -313,7 +315,8 @@ afterXPR:
#if ARCOFI_USE
if (v1 & 0x08) {
if (!cs->dc.isac.mon_rx) {
- if (!(cs->dc.isac.mon_rx = kmalloc(MAX_MON_FRAME, GFP_ATOMIC))) {
+ cs->dc.isac.mon_rx = kmalloc(MAX_MON_FRAME, GFP_ATOMIC);
+ if (!cs->dc.isac.mon_rx) {
if (cs->debug & L1_DEB_WARN)
debugl1(cs, "ISAC MON RX out of memory!");
cs->dc.isac.mocr &= 0xf0;
@@ -340,10 +343,11 @@ afterXPR:
cs->writeisac(cs, ISAC_MOCR, cs->dc.isac.mocr);
}
}
- afterMONR0:
+afterMONR0:
if (v1 & 0x80) {
if (!cs->dc.isac.mon_rx) {
- if (!(cs->dc.isac.mon_rx = kmalloc(MAX_MON_FRAME, GFP_ATOMIC))) {
+ cs->dc.isac.mon_rx = kmalloc(MAX_MON_FRAME, GFP_ATOMIC);
+ if (!cs->dc.isac.mon_rx) {
if (cs->debug & L1_DEB_WARN)
debugl1(cs, "ISAC MON RX out of memory!");
cs->dc.isac.mocr &= 0x0f;
@@ -368,7 +372,7 @@ afterXPR:
cs->dc.isac.mocr |= 0x40;
cs->writeisac(cs, ISAC_MOCR, cs->dc.isac.mocr);
}
- afterMONR1:
+afterMONR1:
if (v1 & 0x04) {
cs->dc.isac.mocr &= 0xf0;
cs->writeisac(cs, ISAC_MOCR, cs->dc.isac.mocr);
@@ -405,7 +409,7 @@ afterXPR:
if (cs->debug & L1_DEB_MONITOR)
debugl1(cs, "ISAC %02x -> MOX0", cs->dc.isac.mon_tx[cs->dc.isac.mon_txp - 1]);
}
- AfterMOX0:
+AfterMOX0:
if (v1 & 0x20) {
if ((!cs->dc.isac.mon_tx) || (cs->dc.isac.mon_txc &&
(cs->dc.isac.mon_txp >= cs->dc.isac.mon_txc) &&
@@ -428,7 +432,7 @@ afterXPR:
if (cs->debug & L1_DEB_MONITOR)
debugl1(cs, "ISAC %02x -> MOX1", cs->dc.isac.mon_tx[cs->dc.isac.mon_txp - 1]);
}
- AfterMOX1:;
+AfterMOX1:;
#endif
}
}
--
1.9.1
[toc] | [next] | [standalone]
| From | Joe Perches <joe@perches.com> |
|---|---|
| Date | 2016-03-13 20:40 +0100 |
| Message-ID | <rck1Q-1Bu-17@gated-at.bofh.it> |
| In reply to | #1356728 |
On Sun, 2016-03-13 at 21:21 +0200, Cosmin-Gabriel Samoila wrote:
> Fixed errors and warnings reported by checkpatch.pl.
Generally it's better to send multiple patches that each
change a specific type of style defect.
As is, this patch changes object code.
Fixing style inconsistency should not do that.
> diff --git a/drivers/isdn/hisax/isac.c b/drivers/isdn/hisax/isac.c
[]
> @@ -24,9 +24,8 @@
> #define DBUSY_TIMER_VALUE 80
> #define ARCOFI_USE 1
>
> -static char *ISACVer[] =
> -{"2086/2186 V1.1", "2085 B1", "2085 B2",
> - "2085 V2.3"};
> +static char *ISACVer[] = {"2086/2186 V1.1", "2085 B1", "2085 B2",
> +"2085 V2.3"};
Most common kernel style would use:
static const char *ISACVer[] = {
"2086/2186 V1.1", "2085 B1", "2085 B2", "2085 V2.3"
};
> @@ -251,11 +252,12 @@ isac_interrupt(struct IsdnCardState *cs, u_char val)
> cs->tx_skb = NULL;
> }
> }
> - if ((cs->tx_skb = skb_dequeue(&cs->sq))) {
> + cs->tx_skb = skb_dequeue(&cs->sq);
> + if (cs->tx_skb) {
> cs->tx_cnt = 0;
> isac_fill_fifo(cs);
> - } else
> - schedule_event(cs, D_XMTBUFREADY);
> + }
> + schedule_event(cs, D_XMTBUFREADY);
This changes object code.
[toc] | [prev] | [next] | [standalone]
| From | Daniel Baluta <daniel.baluta@gmail.com> |
|---|---|
| Date | 2016-03-13 21:00 +0100 |
| Message-ID | <rcklb-1IP-13@gated-at.bofh.it> |
| In reply to | #1356728 |
On Sun, Mar 13, 2016 at 9:21 PM, Cosmin-Gabriel Samoila
<gabrielcsmo@gmail.com> wrote:
> Fixed errors and warnings reported by checkpatch.pl.
>
Use indicative mood in your commit message.
So, s/Fixed/Fix.
http://chris.beams.io/posts/git-commit/
> Signed-off-by: Cosmin-Gabriel Samoila <gabrielcsmo@gmail.com>
> ---
> drivers/isdn/hisax/isac.c | 32 ++++++++++++++++++--------------
> 1 file changed, 18 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/isdn/hisax/isac.c b/drivers/isdn/hisax/isac.c
> index 7fdf78f..419abe1 100644
> --- a/drivers/isdn/hisax/isac.c
> +++ b/drivers/isdn/hisax/isac.c
> @@ -24,9 +24,8 @@
> #define DBUSY_TIMER_VALUE 80
> #define ARCOFI_USE 1
>
> -static char *ISACVer[] =
> -{"2086/2186 V1.1", "2085 B1", "2085 B2",
> - "2085 V2.3"};
> +static char *ISACVer[] = {"2086/2186 V1.1", "2085 B1", "2085 B2",
> +"2085 V2.3"};
>
> void ISACVersion(struct IsdnCardState *cs, char *s)
> {
> @@ -215,9 +214,11 @@ isac_interrupt(struct IsdnCardState *cs, u_char val)
> if (count == 0)
> count = 32;
> isac_empty_fifo(cs, count);
> - if ((count = cs->rcvidx) > 0) {
> + count = cs->rcvidx;
> + if (count > 0) {
> cs->rcvidx = 0;
> - if (!(skb = alloc_skb(count, GFP_ATOMIC)))
> + skb = alloc_skb(count, GFP_ATOMIC);
> + if (!skb)
> printk(KERN_WARNING "HiSax: D receive out of memory\n");
> else {
> memcpy(skb_put(skb, count), cs->rcvbuf, count);
> @@ -251,11 +252,12 @@ isac_interrupt(struct IsdnCardState *cs, u_char val)
> cs->tx_skb = NULL;
> }
> }
> - if ((cs->tx_skb = skb_dequeue(&cs->sq))) {
> + cs->tx_skb = skb_dequeue(&cs->sq);
> + if (cs->tx_skb) {
> cs->tx_cnt = 0;
> isac_fill_fifo(cs);
> - } else
> - schedule_event(cs, D_XMTBUFREADY);
> + }
> + schedule_event(cs, D_XMTBUFREADY);
> }
> afterXPR:
> if (val & 0x04) { /* CISQ */
> @@ -313,7 +315,8 @@ afterXPR:
> #if ARCOFI_USE
> if (v1 & 0x08) {
> if (!cs->dc.isac.mon_rx) {
> - if (!(cs->dc.isac.mon_rx = kmalloc(MAX_MON_FRAME, GFP_ATOMIC))) {
> + cs->dc.isac.mon_rx = kmalloc(MAX_MON_FRAME, GFP_ATOMIC);
> + if (!cs->dc.isac.mon_rx) {
> if (cs->debug & L1_DEB_WARN)
> debugl1(cs, "ISAC MON RX out of memory!");
> cs->dc.isac.mocr &= 0xf0;
> @@ -340,10 +343,11 @@ afterXPR:
> cs->writeisac(cs, ISAC_MOCR, cs->dc.isac.mocr);
> }
> }
> - afterMONR0:
> +afterMONR0:
> if (v1 & 0x80) {
> if (!cs->dc.isac.mon_rx) {
> - if (!(cs->dc.isac.mon_rx = kmalloc(MAX_MON_FRAME, GFP_ATOMIC))) {
> + cs->dc.isac.mon_rx = kmalloc(MAX_MON_FRAME, GFP_ATOMIC);
> + if (!cs->dc.isac.mon_rx) {
> if (cs->debug & L1_DEB_WARN)
> debugl1(cs, "ISAC MON RX out of memory!");
> cs->dc.isac.mocr &= 0x0f;
> @@ -368,7 +372,7 @@ afterXPR:
> cs->dc.isac.mocr |= 0x40;
> cs->writeisac(cs, ISAC_MOCR, cs->dc.isac.mocr);
> }
> - afterMONR1:
> +afterMONR1:
> if (v1 & 0x04) {
> cs->dc.isac.mocr &= 0xf0;
> cs->writeisac(cs, ISAC_MOCR, cs->dc.isac.mocr);
> @@ -405,7 +409,7 @@ afterXPR:
> if (cs->debug & L1_DEB_MONITOR)
> debugl1(cs, "ISAC %02x -> MOX0", cs->dc.isac.mon_tx[cs->dc.isac.mon_txp - 1]);
> }
> - AfterMOX0:
> +AfterMOX0:
> if (v1 & 0x20) {
> if ((!cs->dc.isac.mon_tx) || (cs->dc.isac.mon_txc &&
> (cs->dc.isac.mon_txp >= cs->dc.isac.mon_txc) &&
> @@ -428,7 +432,7 @@ afterXPR:
> if (cs->debug & L1_DEB_MONITOR)
> debugl1(cs, "ISAC %02x -> MOX1", cs->dc.isac.mon_tx[cs->dc.isac.mon_txp - 1]);
> }
> - AfterMOX1:;
> +AfterMOX1:;
> #endif
> }
> }
> --
> 1.9.1
>
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web