Thread (8 messages) 8 messages, 3 authors, 2025-09-03

Re: [PATCH net-next v27 1/1] mctp pcc: Implement MCTP over PCC Transport

From: Jeremy Kerr <jk@codeconstruct.com.au>
Date: 2025-09-03 03:31:33
Also in: lkml

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help