Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sctp: remove redundant initialization of variable status

The variable status is being initialized with a value that is never read
and it is being updated later with a new value. The initialization is
redundant and can be removed. Also put the variable declarations into
reverse christmas tree order.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Colin Ian King and committed by
David S. Miller
623b57be a65878d6

+7 -7
+7 -7
net/sctp/protocol.c
··· 1367 1367 /* Initialize the universe into something sensible. */ 1368 1368 static __init int sctp_init(void) 1369 1369 { 1370 - int i; 1371 - int status = -EINVAL; 1372 - unsigned long goal; 1373 - unsigned long limit; 1374 1370 unsigned long nr_pages = totalram_pages(); 1375 - int max_share; 1376 - int order; 1377 - int num_entries; 1371 + unsigned long limit; 1372 + unsigned long goal; 1378 1373 int max_entry_order; 1374 + int num_entries; 1375 + int max_share; 1376 + int status; 1377 + int order; 1378 + int i; 1379 1379 1380 1380 sock_skb_cb_check_size(sizeof(struct sctp_ulpevent)); 1381 1381