[PATCH net-next v4 09/17] net: pktgen: align some variable declarations to the most common pattern

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Align some variable declarations (in get_imix_entries and get_labels) to
the most common pattern (int instead of ssize_t/long) and adjust function
return value accordingly.

Signed-off-by: Peter Seiderer <ps.report@xxxxxxx>
---
Changes v3 -> v4
  - new patch (factored out of patch 'net: pktgen: fix access outside of user
    given buffer in pktgen_if_write()')
---
 net/core/pktgen.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 4f201a2db2dc..279910367ad4 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -850,12 +850,11 @@ static int strn_len(const char __user * user_buffer, unsigned int maxlen)
  * where each entry consists of size and weight delimited by commas.
  * "size1,weight_1 size2,weight_2 ... size_n,weight_n" for example.
  */
-static ssize_t get_imix_entries(const char __user *buffer,
-				struct pktgen_dev *pkt_dev)
+static int get_imix_entries(const char __user *buffer,
+			    struct pktgen_dev *pkt_dev)
 {
-	int i = 0;
-	long len;
 	char c;
+	int i = 0, len;
 
 	pkt_dev->n_imix_entries = 0;
 
@@ -900,12 +899,11 @@ static ssize_t get_imix_entries(const char __user *buffer,
 	return i;
 }
 
-static ssize_t get_labels(const char __user *buffer, struct pktgen_dev *pkt_dev)
+static int get_labels(const char __user *buffer, struct pktgen_dev *pkt_dev)
 {
-	unsigned int n = 0;
 	char c;
-	ssize_t i = 0;
-	int len;
+	int i = 0, len;
+	unsigned int n = 0;
 
 	pkt_dev->nr_labels = 0;
 	do {
-- 
2.48.1


[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux