From: Christophe Lucas <clucas@rotomalug.org>
To: kernel-janitors@vger.kernel.org
Subject: Re: [KJ] Re: [PATCH] drivers/char: Use ARRAY_SIZE macro
Date: Mon, 21 Nov 2005 21:30:48 +0000 [thread overview]
Message-ID: <20051121213048.GA31916@rotomalug.org> (raw)
In-Reply-To: <20051117151243.08b30e29.akpm@osdl.org>
[-- Attachment #1: Type: text/plain, Size: 961 bytes --]
Andrew Morton (akpm@osdl.org) wrote:
> Tobias Klauser <tklauser@nuerscht.ch> wrote:
> >
> > @@ -913,15 +913,10 @@ static int stl_parsebrd(stlconf_t *confp
> > for (sp = argp[0], i = 0; ((*sp != 0) && (i < 25)); sp++, i++)
> > *sp = TOLOWER(*sp);
> >
> > - nrbrdnames = sizeof(stl_brdstr) / sizeof(stlbrdtype_t);
> > - for (i = 0; (i < nrbrdnames); i++) {
> > + for (i = 0; i < ARRAY_SIZE(stl_brdstr); i++) {
> > if (strcmp(stl_brdstr[i].name, argp[0]) == 0)
> > break;
> > }
> > - if (i >= nrbrdnames) {
> > - printk("STALLION: unknown board name, %s?\n", argp[0]);
> > - return(0);
> > - }
> >
> > confp->brdtype = stl_brdstr[i].type;
>
> The second change here in stallion.c seems wrong.
>
> I replaced it with
>
> if (i == ARRAY_SIZE(stl_brdstr)) {
> printk("STALLION: unknown board name, %s?\n", argp[0]);
> return 0;
> }
Should correct KERN_* constant be used here in printk(); ?
- Christophe (clucas@rotomalug.org)
[-- Attachment #2: Type: text/plain, Size: 168 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors
prev parent reply other threads:[~2005-11-21 21:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-17 23:12 [KJ] Re: [PATCH] drivers/char: Use ARRAY_SIZE macro Andrew Morton
2005-11-17 23:15 ` Andrew Morton
2005-11-18 6:58 ` Tobias Klauser
2005-11-21 21:30 ` Christophe Lucas [this message]
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=20051121213048.GA31916@rotomalug.org \
--to=clucas@rotomalug.org \
--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.