From: Florian Fainelli <f.fainelli@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: netdev <netdev@vger.kernel.org>, David Miller <davem@davemloft.net>
Subject: Re: [PATCH net-next 1/2] net: dsa: mv88e6xxx: Fix warning with CONFIG_OF=n
Date: Thu, 6 Apr 2017 07:32:36 -0700 [thread overview]
Message-ID: <c6ca4d5c-2e09-2e51-acb7-9ec1113e1e3b@gmail.com> (raw)
In-Reply-To: <20170406140431.GA17713@lunn.ch>
On 04/06/2017 07:04 AM, Andrew Lunn wrote:
> On Thu, Apr 06, 2017 at 06:47:35AM -0700, Florian Fainelli wrote:
>> When CONFIG_OF=n, we will see the following warning:
>>
>> drivers/net/dsa/mv88e6xxx/chip.c:2834:34: warning: 'mv88e6xxx_mdio_external_match' defined but not used [-Wunused-const-variable=]
>> static const struct of_device_id mv88e6xxx_mdio_external_match[] = {
>> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>
>> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
>> ---
>> drivers/net/dsa/mv88e6xxx/chip.c | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
>> index 44ba8cff5631..64cbc4c04907 100644
>> --- a/drivers/net/dsa/mv88e6xxx/chip.c
>> +++ b/drivers/net/dsa/mv88e6xxx/chip.c
>> @@ -2831,11 +2831,13 @@ static int mv88e6xxx_mdio_register(struct mv88e6xxx_chip *chip,
>> return 0;
>> }
>>
>> +#ifdef CONFIG_OF
>> static const struct of_device_id mv88e6xxx_mdio_external_match[] = {
>> { .compatible = "marvell,mv88e6xxx-mdio-external",
>> .data = (void *)true },
>> { },
>> };
>> +#endif
Hi Andrew,
>
> Hi Florian
>
> Maybe a better fix is to make the stub of of_match_node() an inline
> function, so its parameters are used. That will fix this warning
> everywhere in the kernel, not just in this driver.
Good point, this is just much better.
Thanks!
--
Florian
next prev parent reply other threads:[~2017-04-06 14:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-06 13:47 [PATCH net-next 0/2] net: dsa: mv88e6xxx: Fix a few build warnings Florian Fainelli
2017-04-06 13:47 ` [PATCH net-next 1/2] net: dsa: mv88e6xxx: Fix warning with CONFIG_OF=n Florian Fainelli
2017-04-06 14:04 ` Andrew Lunn
2017-04-06 14:32 ` Florian Fainelli [this message]
2017-04-06 13:47 ` [PATCH net-next 2/2] net: dsa: mv88e6xxx: Provide prototypes for SMI read/write functions Florian Fainelli
2017-04-06 14:07 ` Andrew Lunn
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=c6ca4d5c-2e09-2e51-acb7-9ec1113e1e3b@gmail.com \
--to=f.fainelli@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--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).