Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 00/29] treewide: Convert comma separated statements
@ 2020-08-25 4:55 Joe Perches
2020-08-25 4:56 ` [PATCH 16/29] 8390: Avoid " Joe Perches
` (5 more replies)
0 siblings, 6 replies; 12+ messages in thread
From: Joe Perches @ 2020-08-25 4:55 UTC (permalink / raw)
To: Jiri Kosina, oprofile-list, linux-ide, drbd-dev, linux-media,
dri-devel, linaro-mm-sig, intel-gfx, linux-hwmon, linux-input,
linux-bcache, netdev, linuxppc-dev, linux-arm-kernel,
linux-fsdevel, reiserfs-devel, linux-nfs
Cc: linux-doc, linux-kernel, linux-alpha, linux-ia64, sparclinux,
linux-block, linux-mtd, linux-s390, linux-scsi, devel,
linux-fbdev, linux-pm, linux-kselftest
There are many comma separated statements in the kernel.
See:https://lore.kernel.org/lkml/alpine.DEB.2.22.394.2008201856110.2524@hadrien/
Convert the comma separated statements that are in if/do/while blocks
to use braces and semicolons.
Many comma separated statements still exist but those are changes for
another day.
Joe Perches (29):
coding-style.rst: Avoid comma statements
alpha: Avoid comma separated statements
ia64: Avoid comma separated statements
sparc: Avoid comma separated statements
ata: Avoid comma separated statements
drbd: Avoid comma separated statements
lp: Avoid comma separated statements
dma-buf: Avoid comma separated statements
drm/gma500: Avoid comma separated statements
drm/i915: Avoid comma separated statements
hwmon: (scmi-hwmon): Avoid comma separated statements
Input: MT - Avoid comma separated statements
bcache: Avoid comma separated statements
media: Avoid comma separated statements
mtd: Avoid comma separated statements
8390: Avoid comma separated statements
fs_enet: Avoid comma separated statements
wan: sbni: Avoid comma separated statements
s390/tty3270: Avoid comma separated statements
scai/arm: Avoid comma separated statements
media: atomisp: Avoid comma separated statements
video: fbdev: Avoid comma separated statements
fuse: Avoid comma separated statements
reiserfs: Avoid comma separated statements
lib/zlib: Avoid comma separated statements
lib: zstd: Avoid comma separated statements
ipv6: fib6: Avoid comma separated statements
sunrpc: Avoid comma separated statements
tools: Avoid comma separated statements
Documentation/process/coding-style.rst | 17 +
arch/alpha/kernel/pci_iommu.c | 8 +-
arch/alpha/oprofile/op_model_ev4.c | 22 +-
arch/alpha/oprofile/op_model_ev5.c | 8 +-
arch/ia64/kernel/smpboot.c | 7 +-
arch/sparc/kernel/smp_64.c | 7 +-
drivers/ata/pata_icside.c | 21 +-
drivers/block/drbd/drbd_receiver.c | 6 +-
drivers/char/lp.c | 6 +-
drivers/dma-buf/st-dma-fence.c | 7 +-
drivers/gpu/drm/gma500/mdfld_intel_display.c | 44 ++-
drivers/gpu/drm/i915/gt/gen8_ppgtt.c | 8 +-
drivers/gpu/drm/i915/gt/intel_gt_requests.c | 6 +-
.../gpu/drm/i915/gt/selftest_workarounds.c | 6 +-
drivers/gpu/drm/i915/intel_runtime_pm.c | 6 +-
drivers/hwmon/scmi-hwmon.c | 6 +-
drivers/input/input-mt.c | 11 +-
drivers/md/bcache/bset.c | 12 +-
drivers/md/bcache/sysfs.c | 6 +-
drivers/media/i2c/msp3400-kthreads.c | 12 +-
drivers/media/pci/bt8xx/bttv-cards.c | 6 +-
drivers/media/pci/saa7134/saa7134-video.c | 7 +-
drivers/mtd/devices/lart.c | 10 +-
drivers/net/ethernet/8390/axnet_cs.c | 19 +-
drivers/net/ethernet/8390/lib8390.c | 14 +-
drivers/net/ethernet/8390/pcnet_cs.c | 6 +-
.../ethernet/freescale/fs_enet/fs_enet-main.c | 11 +-
drivers/net/wan/sbni.c | 101 +++---
drivers/s390/char/tty3270.c | 6 +-
drivers/scsi/arm/cumana_2.c | 19 +-
drivers/scsi/arm/eesox.c | 9 +-
drivers/scsi/arm/powertec.c | 9 +-
.../media/atomisp/pci/atomisp_subdev.c | 6 +-
drivers/video/fbdev/tgafb.c | 12 +-
fs/fuse/dir.c | 24 +-
fs/reiserfs/fix_node.c | 36 ++-
lib/zlib_deflate/deftree.c | 49 ++-
lib/zstd/compress.c | 120 ++++---
lib/zstd/fse_compress.c | 24 +-
lib/zstd/huf_compress.c | 6 +-
net/ipv6/ip6_fib.c | 12 +-
net/sunrpc/sysctl.c | 6 +-
tools/lib/subcmd/help.c | 10 +-
tools/power/cpupower/utils/cpufreq-set.c | 14 +-
tools/testing/selftests/vm/gup_benchmark.c | 18 +-
tools/testing/selftests/vm/userfaultfd.c | 296 +++++++++++-------
46 files changed, 694 insertions(+), 382 deletions(-)
--
2.26.0
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 16/29] 8390: Avoid comma separated statements
2020-08-25 4:55 [PATCH 00/29] treewide: Convert comma separated statements Joe Perches
@ 2020-08-25 4:56 ` Joe Perches
2020-08-25 14:54 ` David Miller
2020-08-25 4:56 ` [PATCH 17/29] fs_enet: " Joe Perches
` (4 subsequent siblings)
5 siblings, 1 reply; 12+ messages in thread
From: Joe Perches @ 2020-08-25 4:56 UTC (permalink / raw)
To: Jiri Kosina, linux-kernel; +Cc: David S. Miller, Jakub Kicinski, netdev
Use semicolons and braces.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/ethernet/8390/axnet_cs.c | 19 ++++++++++++-------
drivers/net/ethernet/8390/lib8390.c | 14 +++++++++-----
drivers/net/ethernet/8390/pcnet_cs.c | 6 ++++--
3 files changed, 25 insertions(+), 14 deletions(-)
diff --git a/drivers/net/ethernet/8390/axnet_cs.c b/drivers/net/ethernet/8390/axnet_cs.c
index a00b36f91d9f..d041b6dda012 100644
--- a/drivers/net/ethernet/8390/axnet_cs.c
+++ b/drivers/net/ethernet/8390/axnet_cs.c
@@ -657,8 +657,10 @@ static void block_input(struct net_device *dev, int count,
outb_p(E8390_RREAD+E8390_START, nic_base + AXNET_CMD);
insw(nic_base + AXNET_DATAPORT,buf,count>>1);
- if (count & 0x01)
- buf[count-1] = inb(nic_base + AXNET_DATAPORT), xfer_count++;
+ if (count & 0x01) {
+ buf[count-1] = inb(nic_base + AXNET_DATAPORT);
+ xfer_count++;
+ }
}
@@ -1270,10 +1272,12 @@ static void ei_tx_intr(struct net_device *dev)
ei_local->txing = 1;
NS8390_trigger_send(dev, ei_local->tx2, ei_local->tx_start_page + 6);
netif_trans_update(dev);
- ei_local->tx2 = -1,
+ ei_local->tx2 = -1;
ei_local->lasttx = 2;
- }
- else ei_local->lasttx = 20, ei_local->txing = 0;
+ } else {
+ ei_local->lasttx = 20;
+ ei_local->txing = 0;
+ }
}
else if (ei_local->tx2 < 0)
{
@@ -1289,9 +1293,10 @@ static void ei_tx_intr(struct net_device *dev)
netif_trans_update(dev);
ei_local->tx1 = -1;
ei_local->lasttx = 1;
+ } else {
+ ei_local->lasttx = 10;
+ ei_local->txing = 0;
}
- else
- ei_local->lasttx = 10, ei_local->txing = 0;
}
// else
// netdev_warn(dev, "unexpected TX-done interrupt, lasttx=%d\n",
diff --git a/drivers/net/ethernet/8390/lib8390.c b/drivers/net/ethernet/8390/lib8390.c
index babc92e2692e..1f48d7f6365c 100644
--- a/drivers/net/ethernet/8390/lib8390.c
+++ b/drivers/net/ethernet/8390/lib8390.c
@@ -597,10 +597,12 @@ static void ei_tx_intr(struct net_device *dev)
ei_local->txing = 1;
NS8390_trigger_send(dev, ei_local->tx2, ei_local->tx_start_page + 6);
netif_trans_update(dev);
- ei_local->tx2 = -1,
+ ei_local->tx2 = -1;
ei_local->lasttx = 2;
- } else
- ei_local->lasttx = 20, ei_local->txing = 0;
+ } else {
+ ei_local->lasttx = 20;
+ ei_local->txing = 0;
+ }
} else if (ei_local->tx2 < 0) {
if (ei_local->lasttx != 2 && ei_local->lasttx != -2)
pr_err("%s: bogus last_tx_buffer %d, tx2=%d\n",
@@ -612,8 +614,10 @@ static void ei_tx_intr(struct net_device *dev)
netif_trans_update(dev);
ei_local->tx1 = -1;
ei_local->lasttx = 1;
- } else
- ei_local->lasttx = 10, ei_local->txing = 0;
+ } else {
+ ei_local->lasttx = 10;
+ ei_local->txing = 0;
+ }
} /* else
netdev_warn(dev, "unexpected TX-done interrupt, lasttx=%d\n",
ei_local->lasttx);
diff --git a/drivers/net/ethernet/8390/pcnet_cs.c b/drivers/net/ethernet/8390/pcnet_cs.c
index 164c3ed550bf..9d3b1e0e425c 100644
--- a/drivers/net/ethernet/8390/pcnet_cs.c
+++ b/drivers/net/ethernet/8390/pcnet_cs.c
@@ -1178,8 +1178,10 @@ static void dma_block_input(struct net_device *dev, int count,
outb_p(E8390_RREAD+E8390_START, nic_base + PCNET_CMD);
insw(nic_base + PCNET_DATAPORT,buf,count>>1);
- if (count & 0x01)
- buf[count-1] = inb(nic_base + PCNET_DATAPORT), xfer_count++;
+ if (count & 0x01) {
+ buf[count-1] = inb(nic_base + PCNET_DATAPORT);
+ xfer_count++;
+ }
/* This was for the ALPHA version only, but enough people have been
encountering problems that it is still here. */
--
2.26.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 17/29] fs_enet: Avoid comma separated statements
2020-08-25 4:55 [PATCH 00/29] treewide: Convert comma separated statements Joe Perches
2020-08-25 4:56 ` [PATCH 16/29] 8390: Avoid " Joe Perches
@ 2020-08-25 4:56 ` Joe Perches
2020-08-25 14:55 ` David Miller
2020-08-25 4:56 ` [PATCH 18/29] wan: sbni: " Joe Perches
` (3 subsequent siblings)
5 siblings, 1 reply; 12+ messages in thread
From: Joe Perches @ 2020-08-25 4:56 UTC (permalink / raw)
To: Jiri Kosina, Pantelis Antoniou
Cc: David S. Miller, Jakub Kicinski, linuxppc-dev, netdev, linux-kernel
Use semicolons and braces.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c b/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c
index bf846b42bc74..78e008b81374 100644
--- a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c
+++ b/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c
@@ -562,10 +562,13 @@ fs_enet_start_xmit(struct sk_buff *skb, struct net_device *dev)
BD_ENET_TX_TC);
CBDS_SC(bdp, BD_ENET_TX_READY);
- if ((CBDR_SC(bdp) & BD_ENET_TX_WRAP) == 0)
- bdp++, curidx++;
- else
- bdp = fep->tx_bd_base, curidx = 0;
+ if ((CBDR_SC(bdp) & BD_ENET_TX_WRAP) == 0) {
+ bdp++;
+ curidx++;
+ } else {
+ bdp = fep->tx_bd_base;
+ curidx = 0;
+ }
len = skb_frag_size(frag);
CBDW_BUFADDR(bdp, skb_frag_dma_map(fep->dev, frag, 0, len,
--
2.26.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 18/29] wan: sbni: Avoid comma separated statements
2020-08-25 4:55 [PATCH 00/29] treewide: Convert comma separated statements Joe Perches
2020-08-25 4:56 ` [PATCH 16/29] 8390: Avoid " Joe Perches
2020-08-25 4:56 ` [PATCH 17/29] fs_enet: " Joe Perches
@ 2020-08-25 4:56 ` Joe Perches
2020-08-25 14:55 ` David Miller
2020-08-25 4:56 ` [PATCH 27/29] ipv6: fib6: " Joe Perches
` (2 subsequent siblings)
5 siblings, 1 reply; 12+ messages in thread
From: Joe Perches @ 2020-08-25 4:56 UTC (permalink / raw)
To: Jiri Kosina, linux-kernel; +Cc: David S. Miller, Jakub Kicinski, netdev
Use semicolons and braces.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/wan/sbni.c | 101 +++++++++++++++++++++++------------------
1 file changed, 58 insertions(+), 43 deletions(-)
diff --git a/drivers/net/wan/sbni.c b/drivers/net/wan/sbni.c
index 40c04ea1200a..2fde439543fb 100644
--- a/drivers/net/wan/sbni.c
+++ b/drivers/net/wan/sbni.c
@@ -260,11 +260,12 @@ static int __init sbni_init(struct net_device *dev)
return sbni_isa_probe( dev );
/* otherwise we have to perform search our adapter */
- if( io[ num ] != -1 )
- dev->base_addr = io[ num ],
+ if( io[ num ] != -1 ) {
+ dev->base_addr = io[ num ];
dev->irq = irq[ num ];
- else if( scandone || io[ 0 ] != -1 )
+ } else if( scandone || io[ 0 ] != -1 ) {
return -ENODEV;
+ }
/* if io[ num ] contains non-zero address, then that is on ISA bus */
if( dev->base_addr )
@@ -399,12 +400,13 @@ sbni_probe1( struct net_device *dev, unsigned long ioaddr, int irq )
nl->maxframe = DEFAULT_FRAME_LEN;
nl->csr1.rate = baud[ num ];
- if( (nl->cur_rxl_index = rxl[ num ]) == -1 )
+ if( (nl->cur_rxl_index = rxl[ num ]) == -1 ) {
/* autotune rxl */
- nl->cur_rxl_index = DEF_RXL,
+ nl->cur_rxl_index = DEF_RXL;
nl->delta_rxl = DEF_RXL_DELTA;
- else
+ } else {
nl->delta_rxl = 0;
+ }
nl->csr1.rxl = rxl_tab[ nl->cur_rxl_index ];
if( inb( ioaddr + CSR0 ) & 0x01 )
nl->state |= FL_SLOW_MODE;
@@ -512,13 +514,15 @@ sbni_interrupt( int irq, void *dev_id )
do {
repeat = 0;
- if( inb( dev->base_addr + CSR0 ) & (RC_RDY | TR_RDY) )
- handle_channel( dev ),
+ if( inb( dev->base_addr + CSR0 ) & (RC_RDY | TR_RDY) ) {
+ handle_channel( dev );
repeat = 1;
+ }
if( nl->second && /* second channel present */
- (inb( nl->second->base_addr+CSR0 ) & (RC_RDY | TR_RDY)) )
- handle_channel( nl->second ),
+ (inb( nl->second->base_addr+CSR0 ) & (RC_RDY | TR_RDY)) ) {
+ handle_channel( nl->second );
repeat = 1;
+ }
} while( repeat );
if( nl->second )
@@ -610,11 +614,12 @@ recv_frame( struct net_device *dev )
nl->state |= FL_PREV_OK;
if( framelen > 4 )
nl->in_stats.all_rx_number++;
- } else
- nl->state &= ~FL_PREV_OK,
- change_level( dev ),
- nl->in_stats.all_rx_number++,
+ } else {
+ nl->state &= ~FL_PREV_OK;
+ change_level( dev );
+ nl->in_stats.all_rx_number++;
nl->in_stats.bad_rx_number++;
+ }
return !frame_ok || framelen > 4;
}
@@ -689,9 +694,10 @@ download_data( struct net_device *dev, u32 *crc_p )
*crc_p = calc_crc32( *crc_p, skb->data + nl->outpos, len );
/* if packet too short we should write some more bytes to pad */
- for( len = nl->framelen - len; len--; )
- outb( 0, dev->base_addr + DAT ),
+ for( len = nl->framelen - len; len--; ) {
+ outb( 0, dev->base_addr + DAT );
*crc_p = CRC32( 0, *crc_p );
+ }
}
@@ -703,9 +709,10 @@ upload_data( struct net_device *dev, unsigned framelen, unsigned frameno,
int frame_ok;
- if( is_first )
- nl->wait_frameno = frameno,
+ if( is_first ) {
+ nl->wait_frameno = frameno;
nl->inppos = 0;
+ }
if( nl->wait_frameno == frameno ) {
@@ -717,33 +724,35 @@ upload_data( struct net_device *dev, unsigned framelen, unsigned frameno,
* error was occurred... drop entire packet
*/
else if( (frame_ok = skip_tail( dev->base_addr, framelen, crc ))
- != 0 )
- nl->wait_frameno = 0,
- nl->inppos = 0,
+ != 0 ) {
+ nl->wait_frameno = 0;
+ nl->inppos = 0;
#ifdef CONFIG_SBNI_MULTILINE
- nl->master->stats.rx_errors++,
+ nl->master->stats.rx_errors++;
nl->master->stats.rx_missed_errors++;
#else
- dev->stats.rx_errors++,
+ dev->stats.rx_errors++;
dev->stats.rx_missed_errors++;
#endif
+ }
/* now skip all frames until is_first != 0 */
} else
frame_ok = skip_tail( dev->base_addr, framelen, crc );
- if( is_first && !frame_ok )
+ if( is_first && !frame_ok ) {
/*
* Frame has been broken, but we had already stored
* is_first... Drop entire packet.
*/
- nl->wait_frameno = 0,
+ nl->wait_frameno = 0;
#ifdef CONFIG_SBNI_MULTILINE
- nl->master->stats.rx_errors++,
+ nl->master->stats.rx_errors++;
nl->master->stats.rx_crc_errors++;
#else
- dev->stats.rx_errors++,
+ dev->stats.rx_errors++;
dev->stats.rx_crc_errors++;
#endif
+ }
return frame_ok;
}
@@ -782,17 +791,18 @@ interpret_ack( struct net_device *dev, unsigned ack )
if( nl->state & FL_WAIT_ACK ) {
nl->outpos += nl->framelen;
- if( --nl->tx_frameno )
+ if( --nl->tx_frameno ) {
nl->framelen = min_t(unsigned int,
nl->maxframe,
nl->tx_buf_p->len - nl->outpos);
- else
- send_complete( dev ),
+ } else {
+ send_complete( dev );
#ifdef CONFIG_SBNI_MULTILINE
netif_wake_queue( nl->master );
#else
netif_wake_queue( dev );
#endif
+ }
}
}
@@ -872,16 +882,17 @@ drop_xmit_queue( struct net_device *dev )
{
struct net_local *nl = netdev_priv(dev);
- if( nl->tx_buf_p )
- dev_kfree_skb_any( nl->tx_buf_p ),
- nl->tx_buf_p = NULL,
+ if( nl->tx_buf_p ) {
+ dev_kfree_skb_any( nl->tx_buf_p );
+ nl->tx_buf_p = NULL;
#ifdef CONFIG_SBNI_MULTILINE
- nl->master->stats.tx_errors++,
+ nl->master->stats.tx_errors++;
nl->master->stats.tx_carrier_errors++;
#else
- dev->stats.tx_errors++,
+ dev->stats.tx_errors++;
dev->stats.tx_carrier_errors++;
#endif
+ }
nl->tx_frameno = 0;
nl->framelen = 0;
@@ -1327,12 +1338,13 @@ sbni_ioctl( struct net_device *dev, struct ifreq *ifr, int cmd )
spin_lock( &nl->lock );
flags = *(struct sbni_flags*) &ifr->ifr_ifru;
- if( flags.fixed_rxl )
- nl->delta_rxl = 0,
+ if( flags.fixed_rxl ) {
+ nl->delta_rxl = 0;
nl->cur_rxl_index = flags.rxl;
- else
- nl->delta_rxl = DEF_RXL_DELTA,
+ } else {
+ nl->delta_rxl = DEF_RXL_DELTA;
nl->cur_rxl_index = DEF_RXL;
+ }
nl->csr1.rxl = rxl_tab[ nl->cur_rxl_index ];
nl->csr1.rate = flags.rate;
@@ -1526,13 +1538,16 @@ sbni_setup( char *p )
(*dest[ parm ])[ n ] = simple_strtol( p, &p, 0 );
if( !*p || *p == ')' )
return 1;
- if( *p == ';' )
- ++p, ++n, parm = 0;
- else if( *p++ != ',' )
+ if( *p == ';' ) {
+ ++p;
+ ++n;
+ parm = 0;
+ } else if( *p++ != ',' ) {
break;
- else
+ } else {
if( ++parm >= 5 )
break;
+ }
}
bad_param:
pr_err("Error in sbni kernel parameter!\n");
--
2.26.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 27/29] ipv6: fib6: Avoid comma separated statements
2020-08-25 4:55 [PATCH 00/29] treewide: Convert comma separated statements Joe Perches
` (2 preceding siblings ...)
2020-08-25 4:56 ` [PATCH 18/29] wan: sbni: " Joe Perches
@ 2020-08-25 4:56 ` Joe Perches
2020-08-25 14:55 ` David Miller
2020-08-25 4:56 ` [PATCH 28/29] sunrpc: " Joe Perches
2020-09-09 2:09 ` [PATCH 00/29] treewide: Convert " Martin K. Petersen
5 siblings, 1 reply; 12+ messages in thread
From: Joe Perches @ 2020-08-25 4:56 UTC (permalink / raw)
To: Jiri Kosina, David S. Miller, Alexey Kuznetsov, Hideaki YOSHIFUJI
Cc: Jakub Kicinski, netdev, linux-kernel
Use semicolons and braces.
Signed-off-by: Joe Perches <joe@perches.com>
---
net/ipv6/ip6_fib.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index 25a90f3f705c..44d68ed70f24 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -1812,10 +1812,14 @@ static struct fib6_node *fib6_repair_tree(struct net *net,
children = 0;
child = NULL;
- if (fn_r)
- child = fn_r, children |= 1;
- if (fn_l)
- child = fn_l, children |= 2;
+ if (fn_r) {
+ child = fn_r;
+ children |= 1;
+ }
+ if (fn_l) {
+ child = fn_l;
+ children |= 2;
+ }
if (children == 3 || FIB6_SUBTREE(fn)
#ifdef CONFIG_IPV6_SUBTREES
--
2.26.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 28/29] sunrpc: Avoid comma separated statements
2020-08-25 4:55 [PATCH 00/29] treewide: Convert comma separated statements Joe Perches
` (3 preceding siblings ...)
2020-08-25 4:56 ` [PATCH 27/29] ipv6: fib6: " Joe Perches
@ 2020-08-25 4:56 ` Joe Perches
2020-08-25 14:55 ` David Miller
2020-09-09 2:09 ` [PATCH 00/29] treewide: Convert " Martin K. Petersen
5 siblings, 1 reply; 12+ messages in thread
From: Joe Perches @ 2020-08-25 4:56 UTC (permalink / raw)
To: Jiri Kosina, Trond Myklebust, Anna Schumaker, J. Bruce Fields,
Chuck Lever
Cc: David S. Miller, Jakub Kicinski, linux-nfs, netdev, linux-kernel
Use semicolons and braces.
Signed-off-by: Joe Perches <joe@perches.com>
---
net/sunrpc/sysctl.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/net/sunrpc/sysctl.c b/net/sunrpc/sysctl.c
index 999eee1ed61c..6c86e2a7d942 100644
--- a/net/sunrpc/sysctl.c
+++ b/net/sunrpc/sysctl.c
@@ -108,8 +108,10 @@ proc_dodebug(struct ctl_table *table, int write, void *buffer, size_t *lenp,
left -= (s - tmpbuf);
if (left && !isspace(*s))
return -EINVAL;
- while (left && isspace(*s))
- left--, s++;
+ while (left && isspace(*s)) {
+ left--;
+ s++;
+ }
} else
left = 0;
*(unsigned int *) table->data = value;
--
2.26.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH 16/29] 8390: Avoid comma separated statements
2020-08-25 4:56 ` [PATCH 16/29] 8390: Avoid " Joe Perches
@ 2020-08-25 14:54 ` David Miller
0 siblings, 0 replies; 12+ messages in thread
From: David Miller @ 2020-08-25 14:54 UTC (permalink / raw)
To: joe; +Cc: trivial, linux-kernel, kuba, netdev
From: Joe Perches <joe@perches.com>
Date: Mon, 24 Aug 2020 21:56:13 -0700
> Use semicolons and braces.
>
> Signed-off-by: Joe Perches <joe@perches.com>
Applied.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 17/29] fs_enet: Avoid comma separated statements
2020-08-25 4:56 ` [PATCH 17/29] fs_enet: " Joe Perches
@ 2020-08-25 14:55 ` David Miller
0 siblings, 0 replies; 12+ messages in thread
From: David Miller @ 2020-08-25 14:55 UTC (permalink / raw)
To: joe; +Cc: trivial, pantelis.antoniou, kuba, linuxppc-dev, netdev, linux-kernel
From: Joe Perches <joe@perches.com>
Date: Mon, 24 Aug 2020 21:56:14 -0700
> Use semicolons and braces.
>
> Signed-off-by: Joe Perches <joe@perches.com>
Applied.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 18/29] wan: sbni: Avoid comma separated statements
2020-08-25 4:56 ` [PATCH 18/29] wan: sbni: " Joe Perches
@ 2020-08-25 14:55 ` David Miller
0 siblings, 0 replies; 12+ messages in thread
From: David Miller @ 2020-08-25 14:55 UTC (permalink / raw)
To: joe; +Cc: trivial, linux-kernel, kuba, netdev
From: Joe Perches <joe@perches.com>
Date: Mon, 24 Aug 2020 21:56:15 -0700
> Use semicolons and braces.
>
> Signed-off-by: Joe Perches <joe@perches.com>
Applied.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 27/29] ipv6: fib6: Avoid comma separated statements
2020-08-25 4:56 ` [PATCH 27/29] ipv6: fib6: " Joe Perches
@ 2020-08-25 14:55 ` David Miller
0 siblings, 0 replies; 12+ messages in thread
From: David Miller @ 2020-08-25 14:55 UTC (permalink / raw)
To: joe; +Cc: trivial, kuznet, yoshfuji, kuba, netdev, linux-kernel
From: Joe Perches <joe@perches.com>
Date: Mon, 24 Aug 2020 21:56:24 -0700
> Use semicolons and braces.
>
> Signed-off-by: Joe Perches <joe@perches.com>
Applied.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 28/29] sunrpc: Avoid comma separated statements
2020-08-25 4:56 ` [PATCH 28/29] sunrpc: " Joe Perches
@ 2020-08-25 14:55 ` David Miller
0 siblings, 0 replies; 12+ messages in thread
From: David Miller @ 2020-08-25 14:55 UTC (permalink / raw)
To: joe
Cc: trivial, trond.myklebust, anna.schumaker, bfields, chuck.lever,
kuba, linux-nfs, netdev, linux-kernel
From: Joe Perches <joe@perches.com>
Date: Mon, 24 Aug 2020 21:56:25 -0700
> Use semicolons and braces.
>
> Signed-off-by: Joe Perches <joe@perches.com>
Applied.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 00/29] treewide: Convert comma separated statements
2020-08-25 4:55 [PATCH 00/29] treewide: Convert comma separated statements Joe Perches
` (4 preceding siblings ...)
2020-08-25 4:56 ` [PATCH 28/29] sunrpc: " Joe Perches
@ 2020-09-09 2:09 ` Martin K. Petersen
5 siblings, 0 replies; 12+ messages in thread
From: Martin K. Petersen @ 2020-09-09 2:09 UTC (permalink / raw)
To: linuxppc-dev, linux-ide, dri-devel, linux-hwmon, Joe Perches,
oprofile-list, linux-fsdevel, linux-media, linaro-mm-sig,
drbd-dev, intel-gfx, linux-arm-kernel, linux-input, linux-nfs,
netdev, reiserfs-devel, linux-bcache, Jiri Kosina
Cc: Martin K . Petersen, sparclinux, linux-mtd, linux-s390,
linux-doc, linux-block, linux-ia64, linux-pm, linux-kselftest,
linux-fbdev, devel, linux-scsi, linux-alpha, linux-kernel
On Mon, 24 Aug 2020 21:55:57 -0700, Joe Perches wrote:
> There are many comma separated statements in the kernel.
> See:https://lore.kernel.org/lkml/alpine.DEB.2.22.394.2008201856110.2524@hadrien/
>
> Convert the comma separated statements that are in if/do/while blocks
> to use braces and semicolons.
>
> Many comma separated statements still exist but those are changes for
> another day.
>
> [...]
Applied to 5.10/scsi-queue, thanks!
[01/29] coding-style.rst: Avoid comma statements
(no commit info)
[02/29] alpha: Avoid comma separated statements
(no commit info)
[03/29] ia64: Avoid comma separated statements
(no commit info)
[04/29] sparc: Avoid comma separated statements
(no commit info)
[05/29] ata: Avoid comma separated statements
(no commit info)
[06/29] drbd: Avoid comma separated statements
(no commit info)
[07/29] lp: Avoid comma separated statements
(no commit info)
[08/29] dma-buf: Avoid comma separated statements
(no commit info)
[09/29] drm/gma500: Avoid comma separated statements
(no commit info)
[10/29] drm/i915: Avoid comma separated statements
(no commit info)
[11/29] hwmon: (scmi-hwmon): Avoid comma separated statements
(no commit info)
[12/29] Input: MT - Avoid comma separated statements
(no commit info)
[13/29] bcache: Avoid comma separated statements
(no commit info)
[14/29] media: Avoid comma separated statements
(no commit info)
[15/29] mtd: Avoid comma separated statements
(no commit info)
[16/29] 8390: Avoid comma separated statements
(no commit info)
[17/29] fs_enet: Avoid comma separated statements
(no commit info)
[18/29] wan: sbni: Avoid comma separated statements
(no commit info)
[19/29] s390/tty3270: Avoid comma separated statements
(no commit info)
[20/29] scsi: arm: Avoid comma separated statements
https://git.kernel.org/mkp/scsi/c/a08a07326510
[21/29] media: atomisp: Avoid comma separated statements
(no commit info)
[22/29] video: fbdev: Avoid comma separated statements
(no commit info)
[23/29] fuse: Avoid comma separated statements
(no commit info)
[24/29] reiserfs: Avoid comma separated statements
(no commit info)
[25/29] lib/zlib: Avoid comma separated statements
(no commit info)
[26/29] lib: zstd: Avoid comma separated statements
(no commit info)
[27/29] ipv6: fib6: Avoid comma separated statements
(no commit info)
[28/29] sunrpc: Avoid comma separated statements
(no commit info)
[29/29] tools: Avoid comma separated statements
(no commit info)
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2020-09-09 2:12 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-25 4:55 [PATCH 00/29] treewide: Convert comma separated statements Joe Perches
2020-08-25 4:56 ` [PATCH 16/29] 8390: Avoid " Joe Perches
2020-08-25 14:54 ` David Miller
2020-08-25 4:56 ` [PATCH 17/29] fs_enet: " Joe Perches
2020-08-25 14:55 ` David Miller
2020-08-25 4:56 ` [PATCH 18/29] wan: sbni: " Joe Perches
2020-08-25 14:55 ` David Miller
2020-08-25 4:56 ` [PATCH 27/29] ipv6: fib6: " Joe Perches
2020-08-25 14:55 ` David Miller
2020-08-25 4:56 ` [PATCH 28/29] sunrpc: " Joe Perches
2020-08-25 14:55 ` David Miller
2020-09-09 2:09 ` [PATCH 00/29] treewide: Convert " Martin K. Petersen
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).