mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Sean Anderson <sean.anderson@linux.dev>
Cc: Suraj Gupta <suraj.gupta2@amd.com>,
	andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com, michal.simek@amd.com,
	radhey.shyam.pandey@amd.com, horms@kernel.org,
	netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, harini.katakam@amd.com
Subject: Re: [PATCH net-next 2/2] net: xilinx: axienet: Add inline comment for stats_lock mutex definition
Date: Thu, 11 Sep 2025 16:44:16 +0200	[thread overview]
Message-ID: <633175ac-97c8-42d0-8f3b-767e89aa4132@lunn.ch> (raw)
In-Reply-To: <0dc424bf-c19b-4eeb-82db-88bff4f85d46@linux.dev>

On Thu, Sep 11, 2025 at 10:35:22AM -0400, Sean Anderson wrote:
> On 9/11/25 03:28, Suraj Gupta wrote:
> > Add inline comment to document the purpose of the stats_lock mutex in
> > the axienet_local structure. This mutex protects the hw_stats_seqcount
> > sequence counter used for hardware statistics synchronization.
> > 
> > Fixes checkpatch warning:
> > CHECK: struct mutex definition without comment
> > 
> > Signed-off-by: Suraj Gupta <suraj.gupta2@amd.com>
> > ---
> >  drivers/net/ethernet/xilinx/xilinx_axienet.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet.h b/drivers/net/ethernet/xilinx/xilinx_axienet.h
> > index 5ff742103beb..99b9c27bbd60 100644
> > --- a/drivers/net/ethernet/xilinx/xilinx_axienet.h
> > +++ b/drivers/net/ethernet/xilinx/xilinx_axienet.h
> > @@ -598,7 +598,7 @@ struct axienet_local {
> >  
> >  	u64 hw_stat_base[STAT_COUNT];
> >  	u32 hw_last_counter[STAT_COUNT];
> > -	seqcount_mutex_t hw_stats_seqcount;
> > +	seqcount_mutex_t hw_stats_seqcount; /* Lock for hardware statistics */
> >  	struct mutex stats_lock;
> >  	struct delayed_work stats_work;
> >  	bool reset_in_progress;
> 
> NAK. This is already documented in the kernel-doc comment.

Agreed. checkpatch is just a guide, it does get things wrong, and we
don't insist it is 100% clean.

And the existing comment is much more specific:

   Sequence counter for @hw_stat_base, @hw_last_counter,
   and @reset_in_progress.

This makes it clear exactly what it should protect, and what it does
not protect.

    Andrew

---
pw-bot: cr

      reply	other threads:[~2025-09-11 14:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-11  7:28 [PATCH net-next 0/2] Fix Linux style violations Suraj Gupta
2025-09-11  7:28 ` [PATCH net-next 1/2] net: xilinx: axienet: Fix kernel-doc warning for axienet_free_tx_chain return value Suraj Gupta
2025-09-11 14:35   ` Sean Anderson
2025-09-11 15:41   ` Pandey, Radhey Shyam
2025-09-11  7:28 ` [PATCH net-next 2/2] net: xilinx: axienet: Add inline comment for stats_lock mutex definition Suraj Gupta
2025-09-11 14:35   ` Sean Anderson
2025-09-11 14:44     ` Andrew Lunn [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=633175ac-97c8-42d0-8f3b-767e89aa4132@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=harini.katakam@amd.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.simek@amd.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=radhey.shyam.pandey@amd.com \
    --cc=sean.anderson@linux.dev \
    --cc=suraj.gupta2@amd.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

all inboxes | Powered by JetHome®