Skip to contentSkip to conversation

kernel 2.6 size macro clean ups in

PATCH Aaron Cripps 1 participant 1 message May 29, 2007

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

Removed the N_SMT_PLEN macro in favor of the more generic ARRAY_SIZE(arr) defined in kernel.h This required minor code reformatting to stick to the 80 charcter convention.
Compile tested, no issues found.

drivers/net/skfp/smt.c +1 -3
diff -Nuar linux-2.6/drivers/net/skfp/smt.c linux-2.6-patched/drivers/net/skfp/smt.c
@@ -1654,8 +1654,6 @@
 	{ SMT_P4053,	0,	SWAP_SMT_P4053			} ,
 } ;
 
-#define N_SMT_PLEN	(sizeof(smt_pdef)/sizeof(smt_pdef[0]))
-
 int smt_check_para(struct s_smc *smc, struct smt_header	*sm,
 		   const u_short list[])
 {
@@ -1881,7 +1879,7 @@
 		if (plen < 0)
 			break ;
 		plen += PARA_LEN ;
-		for (i = N_SMT_PLEN, pd = smt_pdef; i ; i--,pd++) {
+		for (i = ARRAY_SIZE(smt_pdef), pd = smt_pdef; i ; i--,pd++) {
 			if (pd->ptype == type)
 				break ;
 		}

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors