lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <a0be916bc2e1736279362b91dbda932f60ac378c.camel@codeconstruct.com.au>
Date: Wed, 03 Sep 2025 11:31:30 +0800
From: Jeremy Kerr <jk@...econstruct.com.au>
To: Adam Young <admiyo@...eremail.onmicrosoft.com>, Adam Young
 <admiyo@...amperecomputing.com>, Matt Johnston <matt@...econstruct.com.au>,
  Andrew Lunn <andrew+netdev@...n.ch>, "David S. Miller"
 <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski
 <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>
Cc: netdev@...r.kernel.org, linux-kernel@...r.kernel.org, Sudeep Holla
	 <sudeep.holla@....com>, Jonathan Cameron <Jonathan.Cameron@...wei.com>, 
	Huisong Li <lihuisong@...wei.com>
Subject: Re: [PATCH net-next v27 1/1] mctp pcc: Implement MCTP over PCC
 Transport

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ