netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Heiner Kallweit <hkallweit1@gmail.com>
Cc: Peter Geis <pgwipeout@gmail.com>, Andrew Lunn <andrew@lunn.ch>,
	Russell King <linux@armlinux.org.uk>,
	"David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Kernel Network Developers <netdev@vger.kernel.org>,
	"open list:ARM/Rockchip SoC..."
	<linux-rockchip@lists.infradead.org>
Subject: Re: [PATCH] net: phy: add driver for Motorcomm yt8511 phy
Date: Wed, 19 May 2021 14:50:04 +0300	[thread overview]
Message-ID: <YKT7bLjzucl/QEo2@unreal> (raw)
In-Reply-To: <cbfecaf2-2991-c79e-ba80-c805d119ac2f@gmail.com>

On Wed, May 19, 2021 at 12:37:43PM +0200, Heiner Kallweit wrote:
> On 19.05.2021 10:18, Leon Romanovsky wrote:
> > On Tue, May 18, 2021 at 08:20:03PM -0400, Peter Geis wrote:
> >> On Tue, May 18, 2021 at 4:59 AM Leon Romanovsky <leon@kernel.org> wrote:
> >>>
> >>> On Tue, May 11, 2021 at 05:46:06PM -0400, Peter Geis wrote:
> >>>> Add a driver for the Motorcomm yt8511 phy that will be used in the
> >>>> production Pine64 rk3566-quartz64 development board.
> >>>> It supports gigabit transfer speeds, rgmii, and 125mhz clk output.
> >>>>
> >>>> Signed-off-by: Peter Geis <pgwipeout@gmail.com>
> >>>> ---
> >>>>  MAINTAINERS                 |  6 +++
> >>>>  drivers/net/phy/Kconfig     |  6 +++
> >>>>  drivers/net/phy/Makefile    |  1 +
> >>>>  drivers/net/phy/motorcomm.c | 85 +++++++++++++++++++++++++++++++++++++
> >>>>  4 files changed, 98 insertions(+)
> >>>>  create mode 100644 drivers/net/phy/motorcomm.c
> >>>
> >>> <...>
> >>>
> >>>> +static const struct mdio_device_id __maybe_unused motorcomm_tbl[] = {
> >>>> +     { PHY_ID_MATCH_EXACT(PHY_ID_YT8511) },
> >>>> +     { /* sentinal */ }
> >>>> +}
> >>>
> >>> Why is this "__maybe_unused"? This *.c file doesn't have any compilation option
> >>> to compile part of it.
> >>>
> >>> The "__maybe_unused" is not needed in this case.
> >>
> >> I was simply following convention, for example the realtek.c,
> >> micrel.c, and smsc.c drivers all have this as well.
> > 
> > Maybe they have a reason, but this specific driver doesn't have such.
> > 
> 
> It's used like this:
> MODULE_DEVICE_TABLE(mdio, <mdio_device_id_tbl>);
> 
> And MODULE_DEVICE_TABLE is a no-op if MODULE isn't defined:
> 
> #ifdef MODULE
> /* Creates an alias so file2alias.c can find device table. */
> #define MODULE_DEVICE_TABLE(type, name)					\
> extern typeof(name) __mod_##type##__##name##_device_table		\
>   __attribute__ ((unused, alias(__stringify(name))))
> #else  /* !MODULE */
> #define MODULE_DEVICE_TABLE(type, name)
> #endif
> 
> In this case the table is unused.

Do you see compilation warning for such scenario?

Thanks

> 
> > Thanks
> > 
> >>
> >>>
> >>> Thanks
> 
> 

  reply	other threads:[~2021-05-19 11:50 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-11 21:46 [PATCH] net: phy: add driver for Motorcomm yt8511 phy Peter Geis
2021-05-11 21:56 ` Russell King - ARM Linux admin
2021-05-11 22:56   ` Peter Geis
2021-05-18  8:59 ` Leon Romanovsky
2021-05-19  0:20   ` Peter Geis
2021-05-19  8:18     ` Leon Romanovsky
2021-05-19 10:37       ` Heiner Kallweit
2021-05-19 11:50         ` Leon Romanovsky [this message]
2021-05-19 12:45           ` Peter Geis
2021-05-19 12:56             ` Leon Romanovsky
2021-05-19 13:15               ` Russell King (Oracle)
2021-05-19 13:25                 ` Peter Geis

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=YKT7bLjzucl/QEo2@unreal \
    --to=leon@kernel.org \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pgwipeout@gmail.com \
    /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).