netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Jonathan Corbet <corbet@lwn.net>
Cc: Oleksij Rempel <o.rempel@pengutronix.de>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	kernel@pengutronix.de, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org, Simon Horman <horms@kernel.org>,
	Maxime Chevallier <maxime.chevallier@bootlin.com>,
	linux-doc@vger.kernel.org
Subject: Re: [PATCH net-next v1 1/1] net: phy: Move callback comments from struct to kernel-doc section
Date: Thu, 2 Jan 2025 18:28:30 +0000	[thread overview]
Message-ID: <Z3bazqZkXwVqJ8Nf@shell.armlinux.org.uk> (raw)
In-Reply-To: <87seq1xffx.fsf@trenco.lwn.net>

On Thu, Jan 02, 2025 at 11:01:54AM -0700, Jonathan Corbet wrote:
> "Russell King (Oracle)" <linux@armlinux.org.uk> writes:
> 
> > This is the fundamental problem with kernel-doc, when it's missing
> > something that really should already be there. It's not like we're
> > the first to use function pointers in structs - that's a thing that
> > the kernel has been doing for decades.
> 
> Unfortunately, kernel-doc is a gnarly collection of Perl regexes that
> first appeared in 2.3.52pre1 some 25 years ago and has only grown more
> gnarly since.
> 
> > I also have no desire to attempt to fix kernel-doc -
> 
> Neither does anybody else.  There are a few of us who will mount an
> expedition into those dark woods on occasion to fix something, but there
> is little desire on any part to make significant improvements, including
> adding things that should already be there.  It's just barely
> maintainable.
> 
> The proper solution is to reimplement kernel-doc in a language that
> people actually want to deal with, cleaning out 25 years of cruft in the
> process.  One way to do that would be to bring that functionality
> directly into our Sphinx extension, rewriting it in Python.  An
> alternative I have been considering, as a learning project that would
> make me One Of The Cool Kids again, would be to do it in Rust instead.
> 
> For the time being, though, I wouldn't hold my breath for getting this
> kind of improvement into kernel-doc.  I wish I could say otherwise.

Right, so we're at logger-heads. Someone needs to give.

Either:

1) kernel-doc gets fixed

2) we accept that we have to work around kernel-doc to decently document
   function pointers, and while it may not be great, it gives _full_ and
   complete documentation of the function pointer.

3) we don't document function pointers at all (which leads to users not
   having something to read when implementing those methods, and
   reviewers having to post boiler plate explanations of the function
   pointers when reviewing patches... or just give up with trying to
   get people to implement the methods sanely.)

I'll leave it to others to decide which they want to do, but I'm
intending to continue with (2) for phylink, because I believe that has
the most benefit to the community, even though it is sub-optimal.

If one looks at:

https://kernel.org/doc/html/v6.13-rc5/networking/kapi.html#c.phylink_mac_ops

then one can see there is a _heck_ of a lot of valuable detail
documented against each of the function pointers - and I have no
intention what so ever to get rid of that.

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

  reply	other threads:[~2025-01-02 18:28 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-06 11:39 [PATCH net-next v1 1/1] net: phy: Move callback comments from struct to kernel-doc section Oleksij Rempel
2024-12-06 12:14 ` Russell King (Oracle)
2024-12-07 20:38 ` Andrew Lunn
2024-12-10 11:56 ` Paolo Abeni
2024-12-10 14:02   ` Russell King (Oracle)
2024-12-10 14:37     ` Jakub Kicinski
2024-12-16 12:20       ` Oleksij Rempel
2024-12-17  1:53         ` Jakub Kicinski
2024-12-17  5:40           ` Oleksij Rempel
2024-12-17 15:03             ` Jakub Kicinski
2025-01-02 16:56             ` Russell King (Oracle)
2025-01-02 18:01               ` Jonathan Corbet
2025-01-02 18:28                 ` Russell King (Oracle) [this message]
2024-12-10 12:03 ` Mateusz Polchlopek

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=Z3bazqZkXwVqJ8Nf@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=andrew+netdev@lunn.ch \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=horms@kernel.org \
    --cc=kernel@pengutronix.de \
    --cc=kuba@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maxime.chevallier@bootlin.com \
    --cc=netdev@vger.kernel.org \
    --cc=o.rempel@pengutronix.de \
    --cc=pabeni@redhat.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).