On 5/13/24 23:37, Keller, Jacob E wrote:


-----Original Message-----
From: Michal Swiatkowski <michal.swiatkow...@linux.intel.com>
Sent: Monday, May 13, 2024 3:23 AM
To: Kalesh Anakkur Purayil <kalesh-anakkur.pura...@broadcom.com>
Cc: sh...@nvidia.com; Fijalkowski, Maciej <maciej.fijalkow...@intel.com>;
Polchlopek, Mateusz <mateusz.polchlo...@intel.com>; net...@vger.kernel.org;
j...@nvidia.com; Kubiak, Michal <michal.kub...@intel.com>; intel-wired-
l...@lists.osuosl.org; pio.raczyn...@gmail.com; Samudrala, Sridhar
<sridhar.samudr...@intel.com>; Keller, Jacob E <jacob.e.kel...@intel.com>;
Drewek, Wojciech <wojciech.dre...@intel.com>; Kitszel, Przemyslaw
<przemyslaw.kits...@intel.com>
Subject: Re: [Intel-wired-lan] [iwl-next v2 05/15] ice: allocate devlink for
subfunction

On Mon, May 13, 2024 at 02:55:48PM +0530, Kalesh Anakkur Purayil wrote:
On Mon, May 13, 2024 at 2:03 PM Michal Swiatkowski
+       struct devlink_port_attrs attrs = {};
+       struct devlink_port *devlink_port;
+       struct ice_dynamic_port *dyn_port;
[Kalesh] Try to maintain RCT order for variable declaration.

Maybe I don't understand RCT order correctly, but based on my
understanding it is fine. Which declaration here break RCT order?

Do you mean that ice_dynamic_port is longer than devlink_port and should
be moved up? Didn't know that RCT is also applied to inner part of
declaration. If there will be more comments I will move it in another
spin.


RCT (Reverse Christmas Tree) order would be to put the longest declaration line 
first then the rest in order down to shortest. RCT is preferred over using 
initializers in the case where initializers would add a dependency that forces 
a non-RCT ordering. In that case, you would delay initialization to a block 
after the declarations.

So here, you would put dyn_port first, then attrs, then devlink_port.

Thanks,
Jake


Documentation/process/maintainer-netdev.rst says nothing about how to
resolve ties, and we sort by byte-count of given line. For me it means
that author is free to decide.
(Thank ASCII gods that we don't accept full width CJK chars;)

Here order is correct, swapping devlink_port and dyn_port lines will
be equally correct.

Reply via email to