From: "Toshiharu Okada" <toshiharu-linux@dsn.okisemi.com>
To: "Dr. David Alan Gilbert" <linux@treblig.org>,
<masa-korg@dsn.okisemi.com>
Cc: <netdev@vger.kernel.org>, <davem@davemloft.net>
Subject: Re: Bad initialisers in pch_gbe_param.c:pch_gbe_check_options ?
Date: Mon, 22 Nov 2010 12:20:32 +0900 [thread overview]
Message-ID: <008001cb89f4$79dd4180$66f8800a@maildom.okisemi.com> (raw)
In-Reply-To: 20101121171710.GA1682@gallifrey
Hi Dave
Thank you for the pointing out.
This driver's author was changed to me from "Masayuki Ohtake".
So, I confirmed your pointing out and understood the issue.
I will modified and submit the patch.
Best regards
Toshiharu Okada (OKI SEMICONDUCTOR)
-----
Date: Sun, 21 Nov 2010 17:17:10 +0000
From: "Dr. David Alan Gilbert" <linux@treblig.org>
> Hi,
> The 'sparse' checker pointed me at the following code in pch_gbe_param.c
> that does look wrong:
>
> drivers/net/pch_gbe/pch_gbe_param.c:437:26: warning: Initializer entry
defined twice
> drivers/net/pch_gbe/pch_gbe_param.c:438:26: also defined here
>
> static const struct pch_gbe_option opt = {
> .type = range_option,
> .name = "Transmit Descriptors",
> .err = "using default of "
> __MODULE_STRING(PCH_GBE_DEFAULT_TXD),
> .def = PCH_GBE_DEFAULT_TXD,
> ******* .arg = { .r = { .min = PCH_GBE_MIN_TXD } },
> ******* .arg = { .r = { .max = PCH_GBE_MAX_TXD } }
> };
>
> The structure has a union called arg inside of which are two structs (l
and r)
> and r has two members, min and max. This initialiser is initialising the
whole
> of .arg twice; I wrote a little test stand alone program and indeed
> when doing it this way 'min' ended up as zero.
>
> I suggest what you really want is:
> static const struct pch_gbe_option opt = {
> .type = range_option,
> .name = "Transmit Descriptors",
> .err = "using default of "
> __MODULE_STRING(PCH_GBE_DEFAULT_TXD),
> .def = PCH_GBE_DEFAULT_TXD,
> .arg = { .r = { .min = PCH_GBE_MIN_TXD,
> .max = PCH_GBE_MAX_TXD } }
> };
>
> (There's also an equivalent pair a few lines below)
>
> drivers/net/pch_gbe/pch_gbe_param.c:453:26: warning: Initializer entry
defined twice
> drivers/net/pch_gbe/pch_gbe_param.c:454:26: also defined here
>
> Dave
> --
> -----Open up your eyes, open up your mind, open up your code -------
> / Dr. David Alan Gilbert | Running GNU/Linux | Happy \
> \ gro.gilbert @ treblig.org | | In Hex /
> \ _________________________|_____ http://www.treblig.org |_______/
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
prev parent reply other threads:[~2010-11-22 3:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-21 17:17 Bad initialisers in pch_gbe_param.c:pch_gbe_check_options ? Dr. David Alan Gilbert
2010-11-22 3:20 ` Toshiharu Okada [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='008001cb89f4$79dd4180$66f8800a@maildom.okisemi.com' \
--to=toshiharu-linux@dsn.okisemi.com \
--cc=davem@davemloft.net \
--cc=linux@treblig.org \
--cc=masa-korg@dsn.okisemi.com \
--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;
as well as URLs for NNTP newsgroup(s).