netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeremy Kerr <jk@codeconstruct.com.au>
To: Adam Young <admiyo@amperemail.onmicrosoft.com>,
	Adam Young <admiyo@os.amperecomputing.com>,
	Matt Johnston <matt@codeconstruct.com.au>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Sudeep Holla <sudeep.holla@arm.com>,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	 Huisong Li <lihuisong@huawei.com>
Subject: Re: [PATCH net-next v27 1/1] mctp pcc: Implement MCTP over PCC Transport
Date: Wed, 03 Sep 2025 11:31:30 +0800	[thread overview]
Message-ID: <a0be916bc2e1736279362b91dbda932f60ac378c.camel@codeconstruct.com.au> (raw)
In-Reply-To: <958f555a-1187-44ef-95df-c93474888208@amperemail.onmicrosoft.com>

Hi Adam,

> Without the wrapping I get:
> WARNING: Violation(s) in mctp-pcc.c
> Line 275
>      struct mctp_pcc_ndev *mctp_pcc_ndev = netdev_priv(ndev);
>      struct mctp_pcc_mailbox *outbox = &mctp_pcc_ndev->outbox;
> 
> I could move the initialization of outbox, but that seems wrong. The 
> wrapping is the least bad option here.

You're kind-of tricking your RCT checker there, by introducing this
unnecessary wrap - and the results are not RCT. I wouldn't call that the
best option.

The netdev docs say this:

    If there are dependencies between the variables preventing the ordering
    move the initialization out of line.

But I think this is a fairly legitimate case of breaking RCT for better
readability, and preserving variable-initiness. We have exactly this,
intentionally, in existing code, eg.:

    static void mctp_usb_out_complete(struct urb *urb)
    {
            struct sk_buff *skb = urb->context;
            struct net_device *netdev = skb->dev;
            int status;

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/net/mctp/mctp-usb.c#n38

- which triggers no checkpatch/NIPA warnings.

The wrapping in the middle of declarations seem odd for a non-80-col
line.

I would suggest either out-of-line, or slightly-broken RCT, over the
checker-workaround format. However, I would not reject a patch on this
choice of style alone :D

Cheers,


Jeremy

      reply	other threads:[~2025-09-03  3:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-28  4:33 [PATCH net-next v27 0/1] MCTP Over PCC Transport Adam Young
2025-08-28  4:33 ` [PATCH net-next v27 1/1] mctp pcc: Implement MCTP over " Adam Young
2025-08-29  9:16   ` Jeremy Kerr
2025-08-29 15:59     ` Adam Young
2025-09-01  2:31       ` Jeremy Kerr
2025-09-02 22:45         ` Adam Young
2025-09-03  3:06           ` Adam Young
2025-09-03  3:31             ` Jeremy Kerr [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=a0be916bc2e1736279362b91dbda932f60ac378c.camel@codeconstruct.com.au \
    --to=jk@codeconstruct.com.au \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=admiyo@amperemail.onmicrosoft.com \
    --cc=admiyo@os.amperecomputing.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=lihuisong@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matt@codeconstruct.com.au \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sudeep.holla@arm.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).