All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aaron Cripps <acripps@gmail.com>
To: kernel-janitors@vger.kernel.org
Subject: [KJ] Re: [PATCH ARRAY_SIZE 3/4] kernel 2.6 size macro clean ups in
Date: Tue, 29 May 2007 21:12:13 +0000	[thread overview]
Message-ID: <465C99FD.3070302@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1 bytes --]



[-- Attachment #2: smt_ArraySize.patch --]
[-- Type: text/plain, Size: 953 bytes --]

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.
Signed-off-by: Aaron Cripps <cripps@cs.mun.ca>

diff -Nuar linux-2.6/drivers/net/skfp/smt.c linux-2.6-patched/drivers/net/skfp/smt.c
--- linux-2.6/drivers/net/skfp/smt.c	2007-05-22 20:31:05.000000000 -0230
+++ linux-2.6-patched/drivers/net/skfp/smt.c	2007-05-25 22:40:04.000000000 -0230
@@ -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 ;
 		}

[-- Attachment #3: Type: text/plain, Size: 187 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors

                 reply	other threads:[~2007-05-29 21:12 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=465C99FD.3070302@gmail.com \
    --to=acripps@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.