[Intel-wired-lan] [iwl-next v2 05/15] ice: allocate devlink for subfunction

Przemek Kitszel przemyslaw.kitszel at intel.com
Tue May 14 06:36:09 UTC 2024


On 5/13/24 23:37, Keller, Jacob E wrote:
> 
> 
>> -----Original Message-----
>> From: Michal Swiatkowski <michal.swiatkowski at linux.intel.com>
>> Sent: Monday, May 13, 2024 3:23 AM
>> To: Kalesh Anakkur Purayil <kalesh-anakkur.purayil at broadcom.com>
>> Cc: shayd at nvidia.com; Fijalkowski, Maciej <maciej.fijalkowski at intel.com>;
>> Polchlopek, Mateusz <mateusz.polchlopek at intel.com>; netdev at vger.kernel.org;
>> jiri at nvidia.com; Kubiak, Michal <michal.kubiak at intel.com>; intel-wired-
>> lan at lists.osuosl.org; pio.raczynski at gmail.com; Samudrala, Sridhar
>> <sridhar.samudrala at intel.com>; Keller, Jacob E <jacob.e.keller at intel.com>;
>> Drewek, Wojciech <wojciech.drewek at intel.com>; Kitszel, Przemyslaw
>> <przemyslaw.kitszel at 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.


More information about the Intel-wired-lan mailing list