From: David Laight <David.Laight@ACULAB.COM>
To: "'Dan Carpenter'" <dan.carpenter@oracle.com>,
Jarod Wilson <jarod@redhat.com>
Cc: "David S. Miller" <davem@davemloft.net>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"kernel-janitors@vger.kernel.org"
<kernel-janitors@vger.kernel.org>,
Ilya Matveychikov <matvejchikov@gmail.com>,
Baoquan He <bhe@redhat.com>,
Andrew Morton <akpm@linux-foundation.org>,
Ingo Molnar <mingo@kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH net] ethernet: xircom: small clean up in setup_xirc2ps_cs()
Date: Mon, 21 Aug 2017 14:52:34 +0000 [thread overview]
Message-ID: <063D6719AE5E284EB5DD2968C1650D6DD005CC34@AcuExch.aculab.com> (raw)
In-Reply-To: <20170821094730.ydm2xwsqbkyadybi@mwanda>
From: Dan Carpenter
> Sent: 21 August 2017 10:48
> The get_options() function takes the whole ARRAY_SIZE(). It doesn't
> matter here because we don't use more than 7 elements.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/net/ethernet/xircom/xirc2ps_cs.c b/drivers/net/ethernet/xircom/xirc2ps_cs.c
> index f71883264cc0..fd5288ff53b5 100644
> --- a/drivers/net/ethernet/xircom/xirc2ps_cs.c
> +++ b/drivers/net/ethernet/xircom/xirc2ps_cs.c
> @@ -1781,7 +1781,7 @@ static int __init setup_xirc2ps_cs(char *str)
> */
> int ints[10] = { -1 };
>
> - str = get_options(str, 9, ints);
> + str = get_options(str, ARRAY_SIZE(ints), ints);
>
> #define MAYBE_SET(X,Y) if (ints[0] >= Y && ints[Y] != -1) { X = ints[Y]; }
> MAYBE_SET(if_port, 3);
That code looks very dubious to me.
It looks as though it expects all of the ints[] array to be initialised
to -1, not just the first element.
David
next prev parent reply other threads:[~2017-08-21 14:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-21 9:47 Dan Carpenter
2017-08-21 14:52 ` David Laight [this message]
2017-08-21 14:56 ` Dan Carpenter
2017-08-22 17:30 ` David Miller
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=063D6719AE5E284EB5DD2968C1650D6DD005CC34@AcuExch.aculab.com \
--to=david.laight@aculab.com \
--cc=akpm@linux-foundation.org \
--cc=bhe@redhat.com \
--cc=dan.carpenter@oracle.com \
--cc=davem@davemloft.net \
--cc=jarod@redhat.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matvejchikov@gmail.com \
--cc=mingo@kernel.org \
--cc=netdev@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®