Skip to contentSkip to conversation

net: drivers/net: include/net: Remove unnecessary semicolons

PATCH In review Joe Perches 2 participants 5 messages Jun 3, 2011 – Jun 5, 2011

Subsystems (11)
lore
Share & tools
lore
#0 lore raw

cover net: drivers/net: include/net: Remove unnecessary semicolons

Done via perl script:

my $match_balanced_parentheses = qr/(\((?:[^\(\)]++|(?-1))*\))/;
my $match_balanced_braces = qr/(\{(?:[^\{\}]++|(?-1))*\})/;

foreach my $file (@ARGV) {
    my $f;
    my $text;
    my $oldtext;

    next if ((-d $file));

    open($f, '<', $file)
	or die "$P: Can't open $file for read\n";
    $oldtext = do { local($/) ; <$f> };
    close($f);

    next if ($oldtext eq "");

    $text = $oldtext;

    my $count = 0;
    do {
	$count = 0;
	$count += $text =~ s@\b(if\s*${match_balanced_parentheses}\s*)${match_balanced_braces}\s*;@"$1$3"@egx;
	$count += $text =~ s@\b(while\s*${match_balanced_parentheses}\s*)${match_balanced_braces}\s*;@"$1$3"@egx;
	$count += $text =~ s@\b(for\s*${match_balanced_parentheses}\s*)${match_balanced_braces}\s*;@"$1$3"@egx;
	$count += $text =~ s@\b(switch\s*${match_balanced_parentheses}\s*)${match_balanced_braces}\s*;@"$1$3"@egx;
    } while ($count > 0);

    if ($text ne $oldtext) {
	my $newfile = $file;

	open($f, '>', $newfile)
	    or die "$P: Can't open $newfile for write\n";
	print $f $text;
	close($f);

    }
}

Joe Perches (3):
net: Remove unnecessary semicolons
drivers/net: Remove unnecessary semicolons
include/net: Remove unnecessary semicolons

 drivers/net/amd8111e.c                  |    2 +-
 drivers/net/cxgb4/cxgb4_main.c          |    2 +-
 drivers/net/enic/enic_main.c            |    2 +-
 drivers/net/irda/via-ircc.h             |    2 +-
 drivers/net/iseries_veth.c              |    4 ++--
 drivers/net/ixgbe/ixgbe_82599.c         |    4 ++--
 drivers/net/ixgbe/ixgbe_common.c        |    4 ++--
 drivers/net/myri10ge/myri10ge.c         |    2 +-
 drivers/net/netxen/netxen_nic_init.c    |    2 +-
 drivers/net/ps3_gelic_net.c             |    2 +-
 drivers/net/slhc.c                      |    2 +-
 drivers/net/sungem.c                    |    2 +-
 drivers/net/tokenring/3c359.c           |    6 ++++--
 drivers/net/tokenring/ibmtr.c           |    2 +-
 drivers/net/tun.c                       |    2 +-
 drivers/net/via-velocity.c              |    2 +-
 drivers/net/wireless/b43/main.c         |    2 +-
 drivers/net/wireless/b43legacy/main.c   |    2 +-
 drivers/net/wireless/iwmc3200wifi/fw.c  |    2 +-
 drivers/net/wireless/orinoco/main.c     |    2 +-
 drivers/net/wireless/rt2x00/rt2800lib.c |    2 +-
 drivers/net/wireless/rt2x00/rt2800pci.c |    2 +-
 drivers/net/znet.c                      |    2 +-
 include/net/sctp/sctp.h                 |    4 ++--
 net/batman-adv/hard-interface.c         |    2 +-
 net/bluetooth/hci_core.c                |    4 ++--
 net/sunrpc/auth.c                       |    2 +-
 27 files changed, 35 insertions(+), 33 deletions(-)
Signature · 1 line
1.7.5.rc3.dirty
#1 lore raw

PATCH 1/3 net: Remove unnecessary semicolons

Semicolons are not necessary after switch/while/for/if braces so remove them.

---
 net/batman-adv/hard-interface.c |    2 +-
 net/bluetooth/hci_core.c        |    4 ++--
 net/sunrpc/auth.c               |    2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
net/batman-adv/hard-interface.c +1 -1
index a3fbfb5..5719087 100644
@@ -568,7 +568,7 @@ static int hard_if_event(struct notifier_block *this,
 		break;
 	default:
 		break;
-	};
+	}
 
 hardif_put:
 	hardif_free_ref(hard_iface);
net/bluetooth/hci_core.c +2 -2
index 815269b..e937ada 100644
@@ -1519,7 +1519,7 @@ int hci_recv_fragment(struct hci_dev *hdev, int type, void *data, int count)
 
 		data += (count - rem);
 		count = rem;
-	};
+	}
 
 	return rem;
 }
@@ -1554,7 +1554,7 @@ int hci_recv_stream_fragment(struct hci_dev *hdev, void *data, int count)
 
 		data += (count - rem);
 		count = rem;
-	};
+	}
 
 	return rem;
 }
net/sunrpc/auth.c +1 -1
index cd6e4aa..727e506 100644
@@ -626,7 +626,7 @@ rpcauth_refreshcred(struct rpc_task *task)
 		if (err < 0)
 			goto out;
 		cred = task->tk_rqstp->rq_cred;
-	};
+	}
 	dprintk("RPC: %5u refreshing %s cred %p\n",
 		task->tk_pid, cred->cr_auth->au_ops->au_name, cred);
 
Signature · 1 line
1.7.5.rc3.dirty
#2 lore raw

PATCH 2/3 drivers/net: Remove unnecessary semicolons

In reply to Joe Perches

Semicolons are not necessary after switch/while/for/if braces so remove them.

---
 drivers/net/amd8111e.c                  |    2 +-
 drivers/net/cxgb4/cxgb4_main.c          |    2 +-
 drivers/net/enic/enic_main.c            |    2 +-
 drivers/net/irda/via-ircc.h             |    2 +-
 drivers/net/iseries_veth.c              |    4 ++--
 drivers/net/ixgbe/ixgbe_82599.c         |    4 ++--
 drivers/net/ixgbe/ixgbe_common.c        |    4 ++--
 drivers/net/myri10ge/myri10ge.c         |    2 +-
 drivers/net/netxen/netxen_nic_init.c    |    2 +-
 drivers/net/ps3_gelic_net.c             |    2 +-
 drivers/net/slhc.c                      |    2 +-
 drivers/net/sungem.c                    |    2 +-
 drivers/net/tokenring/3c359.c           |    6 ++++--
 drivers/net/tokenring/ibmtr.c           |    2 +-
 drivers/net/tun.c                       |    2 +-
 drivers/net/via-velocity.c              |    2 +-
 drivers/net/wireless/b43/main.c         |    2 +-
 drivers/net/wireless/b43legacy/main.c   |    2 +-
 drivers/net/wireless/iwmc3200wifi/fw.c  |    2 +-
 drivers/net/wireless/orinoco/main.c     |    2 +-
 drivers/net/wireless/rt2x00/rt2800lib.c |    2 +-
 drivers/net/wireless/rt2x00/rt2800pci.c |    2 +-
 drivers/net/znet.c                      |    2 +-
 23 files changed, 29 insertions(+), 27 deletions(-)
drivers/net/amd8111e.c +1 -1
index 241b185..81475ea 100644
@@ -1958,7 +1958,7 @@ static int __devinit amd8111e_probe_one(struct pci_dev *pdev,
 						 IPG_CONVERGE_JIFFIES;
 		lp->ipg_data.ipg = DEFAULT_IPG;
 		lp->ipg_data.ipg_state = CSTATE;
-	};
+	}
 
 	/*  display driver and device information */
 
drivers/net/cxgb4/cxgb4_main.c +1 -1
index 7e3cfbe..c9957b7 100644
@@ -3704,7 +3704,7 @@ static int __devinit init_one(struct pci_dev *pdev,
 	if (err) {
 		dev_warn(&pdev->dev, "only %d net devices registered\n", i);
 		err = 0;
-	};
+	}
 
 	if (cxgb4_debugfs_root) {
 		adapter->debugfs_root = debugfs_create_dir(pci_name(pdev),
drivers/net/enic/enic_main.c +1 -1
index 2f433fb..5b087eb 100644
@@ -1560,7 +1560,7 @@ static void enic_notify_timer_start(struct enic *enic)
 	default:
 		/* Using intr for notification for INTx/MSI-X */
 		break;
-	};
+	}
 }
 
 /* rtnl lock is held, process context */
drivers/net/irda/via-ircc.h +1 -1
index c6f5848..f903a6a 100644
@@ -210,7 +210,7 @@ static void DisableDmaChannel(unsigned int channel)
 		break;
 	default:
 		break;
-	};			//Switch
+	}
 }
 
 static unsigned char ReadLPCReg(int iRegNum)
drivers/net/iseries_veth.c +2 -2
index 9ece1fd..b6c296f 100644
@@ -538,7 +538,7 @@ static void veth_handle_ack(struct veth_lpevent *event)
 	default:
 		veth_error("Unknown ack type %d from LPAR %d.\n",
 				event->base_event.xSubtype, rlp);
-	};
+	}
 }
 
 static void veth_handle_int(struct veth_lpevent *event)
@@ -584,7 +584,7 @@ static void veth_handle_int(struct veth_lpevent *event)
 	default:
 		veth_error("Unknown interrupt type %d from LPAR %d.\n",
 				event->base_event.xSubtype, rlp);
-	};
+	}
 }
 
 static void veth_handle_event(struct HvLpEvent *event)
drivers/net/ixgbe/ixgbe_82599.c +2 -2
index 8ee6612..0d7bc91 100644
@@ -1157,7 +1157,7 @@ s32 ixgbe_init_fdir_signature_82599(struct ixgbe_hw *hw, u32 pballoc)
 	default:
 		/* bad value */
 		return IXGBE_ERR_CONFIG;
-	};
+	}
 
 	/* Move the flexible bytes to use the ethertype - shift 6 words */
 	fdirctrl |= (0x6 << IXGBE_FDIRCTRL_FLEX_SHIFT);
@@ -1245,7 +1245,7 @@ s32 ixgbe_init_fdir_perfect_82599(struct ixgbe_hw *hw, u32 pballoc)
 	default:
 		/* bad value */
 		return IXGBE_ERR_CONFIG;
-	};
+	}
 
 	/* Turn perfect match filtering on */
 	fdirctrl |= IXGBE_FDIRCTRL_PERFECT_MATCH;
drivers/net/ixgbe/ixgbe_common.c +2 -2
index b894b42..de65643 100644
@@ -1292,7 +1292,7 @@ static s32 ixgbe_ready_eeprom(struct ixgbe_hw *hw)
 
 		udelay(5);
 		ixgbe_standby_eeprom(hw);
-	};
+	}
 
 	/*
 	 * On some parts, SPI write time could vary from 0-20mSec on 3.3V
@@ -1374,7 +1374,7 @@ static void ixgbe_shift_out_eeprom_bits(struct ixgbe_hw *hw, u16 data,
 		 * EEPROM
 		 */
 		mask = mask >> 1;
-	};
+	}
 
 	/* We leave the "DI" bit set to "0" when we leave this routine. */
 	eec &= ~IXGBE_EEC_DI;
drivers/net/myri10ge/myri10ge.c +1 -1
index bf84849..3f33870 100644
@@ -1013,7 +1013,7 @@ static int myri10ge_reset(struct myri10ge_priv *mgp)
 		cmd.data2 = i;
 		status |= myri10ge_send_cmd(mgp, MXGEFW_CMD_SET_INTRQ_DMA,
 					    &cmd, 0);
-	};
+	}
 
 	status |=
 	    myri10ge_send_cmd(mgp, MXGEFW_CMD_GET_IRQ_ACK_OFFSET, &cmd, 0);
drivers/net/netxen/netxen_nic_init.c +1 -1
index 7f99967..ca59b4f 100644
@@ -1279,7 +1279,7 @@ void netxen_free_dummy_dma(struct netxen_adapter *adapter)
 
 			if (--i == 0)
 				break;
-		};
+		}
 	}
 
 	if (i) {
drivers/net/ps3_gelic_net.c +1 -1
index b1f251d..d47abb4 100644
@@ -1009,7 +1009,7 @@ static int gelic_card_decode_one_descr(struct gelic_card *card)
 				netdev = card->netdev[i];
 				break;
 			}
-		};
+		}
 		if (GELIC_PORT_MAX <= i) {
 			pr_info("%s: unknown packet vid=%x\n", __func__, vid);
 			goto refill;
drivers/net/slhc.c +1 -1
index ab9e3b7..0a0a664 100644
@@ -297,7 +297,7 @@ slhc_compress(struct slcompress *comp, unsigned char *icp, int isize,
 		lcs = cs;
 		cs = cs->next;
 		comp->sls_o_searches++;
-	};
+	}
 	/*
 	 * Didn't find it -- re-use oldest cstate.  Send an
 	 * uncompressed packet that tells the other side what
drivers/net/sungem.c +1 -1
index f0bcbe4..71d4a03 100644
@@ -2716,7 +2716,7 @@ static int gem_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 			    data->val_in);
 		rc = 0;
 		break;
-	};
+	}
 	return rc;
 }
 
drivers/net/tokenring/3c359.c +4 -2
index ff32bef..b6162fe 100644
@@ -304,7 +304,7 @@ static int __devinit xl_probe(struct pci_dev *pdev,
 
 	if ((i = pci_request_regions(pdev,"3c359"))) { 
 		return i ; 
-	} ; 
+	}
 
 	/* 
 	 * Allowing init_trdev to allocate the private data will align
@@ -1773,7 +1773,9 @@ static void xl_wait_misr_flags(struct net_device *dev)
 	if (readb(xl_mmio + MMIO_MACDATA) != 0) {  /* Misr not clear */
 		for (i=0; i<6; i++) { 
 			writel(MEM_BYTE_READ | 0xDFFE0 | i, xl_mmio + MMIO_MAC_ACCESS_CMD) ; 
-			while (readb(xl_mmio + MMIO_MACDATA) != 0 ) {} ; /* Empty Loop */
+			while (readb(xl_mmio + MMIO_MACDATA) != 0) {
+				;	/* Empty Loop */
+			}
 		} 
 	}
 
drivers/net/tokenring/ibmtr.c +1 -1
index 4786497..e896ad0 100644
@@ -177,7 +177,7 @@ static char __devinit *adapter_def(char type)
 	case 0xD: return "16/4 Adapter/A (short) | 16/4 ISA-16 Adapter";
 	case 0xC: return "Auto 16/4 Adapter";
 	default: return "adapter (unknown type)";
-	};
+	}
 };
 
 #define TRC_INIT 0x01		/*  Trace initialization & PROBEs */
drivers/net/tun.c +1 -1
index 74e9405..8a27cbf 100644
@@ -666,7 +666,7 @@ static __inline__ ssize_t tun_get_user(struct tun_struct *tun,
 	case TUN_TAP_DEV:
 		skb->protocol = eth_type_trans(skb, tun->dev);
 		break;
-	};
+	}
 
 	if (gso.gso_type != VIRTIO_NET_HDR_GSO_NONE) {
 		pr_debug("GSO!\n");
drivers/net/via-velocity.c +1 -1
index 06daa9d..f929242 100644
@@ -1887,7 +1887,7 @@ static void velocity_error(struct velocity_info *vptr, int status)
 		else
 			netif_wake_queue(vptr->dev);
 
-	};
+	}
 	if (status & ISR_MIBFI)
 		velocity_update_hw_mibs(vptr);
 	if (status & ISR_LSTEI)
drivers/net/wireless/b43/main.c +1 -1
index eb41596..d74bc5f 100644
@@ -4085,7 +4085,7 @@ static int b43_phy_versioning(struct b43_wldev *dev)
 #endif
 	default:
 		unsupported = 1;
-	};
+	}
 	if (unsupported) {
 		b43err(dev->wl, "FOUND UNSUPPORTED PHY "
 		       "(Analog %u, Type %u, Revision %u)\n",
drivers/net/wireless/b43legacy/main.c +1 -1
index 1ab8861..60107b8 100644
@@ -2974,7 +2974,7 @@ static int b43legacy_phy_versioning(struct b43legacy_wldev *dev)
 		break;
 	default:
 		unsupported = 1;
-	};
+	}
 	if (unsupported) {
 		b43legacyerr(dev->wl, "FOUND UNSUPPORTED PHY "
 		       "(Analog %u, Type %u, Revision %u)\n",
drivers/net/wireless/iwmc3200wifi/fw.c +1 -1
index 4906709..6f1afe6 100644
@@ -187,7 +187,7 @@ static int iwm_load_img(struct iwm_priv *iwm, const char *img_name)
 		if (ret < 0)
 			goto err_release_fw;
 		opcode_idx++;
-	};
+	}
 
 	/* Read firmware version */
 	fw_offset = iwm_fw_op_offset(iwm, fw, IWM_HDR_REC_OP_SW_VER, 0);
drivers/net/wireless/orinoco/main.c +1 -1
index 62c6b2b..b0f233f 100644
@@ -1958,7 +1958,7 @@ irqreturn_t orinoco_interrupt(int irq, void *dev_id)
 
 		evstat = hermes_read_regn(hw, EVSTAT);
 		events = evstat & hw->inten;
-	};
+	}
 
 	orinoco_unlock(priv, &flags);
 	return IRQ_HANDLED;
drivers/net/wireless/rt2x00/rt2800lib.c +1 -1
index 2a6aa85..8f92dfc 100644
@@ -1355,7 +1355,7 @@ static void rt2800_config_ht_opmode(struct rt2x00_dev *rt2x00dev,
 			gf20_rate = gf40_rate = 0x0003;
 		}
 		break;
-	};
+	}
 
 	/* check for STAs not supporting greenfield mode */
 	if (any_sta_nongf)
drivers/net/wireless/rt2x00/rt2800pci.c +1 -1
index cc4a54f..3ac0943 100644
@@ -219,7 +219,7 @@ static void rt2800pci_start_queue(struct data_queue *queue)
 		break;
 	default:
 		break;
-	};
+	}
 }
 
 static void rt2800pci_kick_queue(struct data_queue *queue)
drivers/net/znet.c +1 -1
index ec2800f..8b88817 100644
@@ -731,7 +731,7 @@ static void znet_rx(struct net_device *dev)
 		cur_frame_end_offset -= ((count + 1)>>1) + 3;
 		if (cur_frame_end_offset < 0)
 		  cur_frame_end_offset += RX_BUF_SIZE/2;
-	};
+	}
 
 	/* Now step  forward through the list. */
 	do {
Signature · 1 line
1.7.5.rc3.dirty
#3 lore raw

PATCH 3/3 include/net: Remove unnecessary semicolons

In reply to Joe Perches

Semicolons are not necessary after switch/while/for/if braces so remove them.

---
 include/net/sctp/sctp.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
include/net/sctp/sctp.h +2 -2
index f9fe374..6a72a58 100644
@@ -601,7 +601,7 @@ static inline int ipver2af(__u8 ipver)
 		return AF_INET6;
 	default:
 		return 0;
-	};
+	}
 }
 
 /* Convert from an address parameter type to an address family.  */
@@ -614,7 +614,7 @@ static inline int param_type2af(__be16 type)
 		return AF_INET6;
 	default:
 		return 0;
-	};
+	}
 }
 
 /* Perform some sanity checks. */
Signature · 1 line
1.7.5.rc3.dirty
maintainer
#4 lore raw
In reply to Joe Perches

From: Joe Perches <[email protected]>
Date: Fri, 3 Jun 2011 14:51:18 -0700

Quoted 1 line

Done via perl script:

...

Quoted 4 lines

Joe Perches (3):
net: Remove unnecessary semicolons
drivers/net: Remove unnecessary semicolons
include/net: Remove unnecessary semicolons

All applied, thanks Joe.

I remember earlier in my programming that I was robotically putting that trailing semicolon at the end of switch statements :-)