netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Russell King - ARM Linux admin <linux@armlinux.org.uk>
To: Colton Lewis <colton.w.lewis@protonmail.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
	davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: FWD: [PATCH 3/3] net: phylink: correct trivial kernel-doc inconsistencies
Date: Mon, 22 Jun 2020 00:44:31 +0100	[thread overview]
Message-ID: <20200621234431.GZ1551@shell.armlinux.org.uk> (raw)
In-Reply-To: <3315816.iIbC2pHGDl@laptop.coltonlewis.name>

On Sun, Jun 21, 2020 at 11:02:30PM +0000, Colton Lewis wrote:
> On Sunday, June 21, 2020 10:53:45 AM CDT Russell King - ARM Linux admin wrote:
> > > ---
> > >   */
> > >  struct phylink_config {
> > >  	struct device *dev;
> > > @@ -331,7 +333,7 @@ void pcs_get_state(struct phylink_config *config,
> > >   *
> > >   * For most 10GBASE-R, there is no advertisement.
> > >   */
> > > -int (*pcs_config)(struct phylink_config *config, unsigned int mode,
> > > +int *pcs_config(struct phylink_config *config, unsigned int mode,
> > >  		  phy_interface_t interface, const unsigned long *advertising);
> > 
> > *Definitely* a NAK on this and two changes below.  You're changing the
> > function signature to be incorrect.  If the documentation can't parse
> > a legitimate C function pointer declaration and allow it to be
> > documented, then that's a problem with the documentation's parsing of
> > C code, rather than a problem with the C code itself.
> 
> I realize this changes the signature, but this declaration is not compiled. It is under an #if 0 with a comment stating it exists for kernel-doc purposes only. The *real* function pointer declaration exists in struct phylink_pcs_ops.
> 
> Given the declaration is there exclusively for documentation, it makes sense to change it so the documentation system can parse it.

My objection is that you are changing the return type from (e.g.)
"int" to "int *", which will then end up in the documentation as
such, and the documentation will, therefore, be incorrect.

I have subsequently realised that I didn't follow my own pattern
for documenting phylink_mac_ops - a correct solution would be to
drop the parens _and_ the "*" preceding the function name, so:

int pcs_config(struct phylink_config *config, unsigned int mode,
...

Thanks.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

  reply	other threads:[~2020-06-21 23:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200621154248.GB338481@lunn.ch>
2020-06-21 15:53 ` FWD: [PATCH 3/3] net: phylink: correct trivial kernel-doc inconsistencies Russell King - ARM Linux admin
2020-06-21 23:02   ` Colton Lewis
2020-06-21 23:44     ` Russell King - ARM Linux admin [this message]
     [not found]       ` <3034206.AJdgDx1Vlc@laptop.coltonlewis.name>
2020-06-27 23:58         ` [PATCH v3] " Colton Lewis
2020-06-28  9:36           ` Russell King - ARM Linux admin
2020-06-28 21:36             ` Colton Lewis
2020-06-28 22:20               ` Russell King - ARM Linux admin
2020-06-29  4:00                 ` David Miller
2020-06-28 21:39         ` [PATCH v4 1/2] net: core: " Colton Lewis
2020-06-29  3:59           ` David Miller
2020-06-28 21:39         ` [PATCH v4 2/2] " Colton Lewis
2020-06-29  3:59           ` David Miller
2020-06-22 20:07     ` [PATCH 3/3] net: phylink: " 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=20200621234431.GZ1551@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=andrew@lunn.ch \
    --cc=colton.w.lewis@protonmail.com \
    --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).