RE: [PATCH v4 06/12] platform/mellanox: Rename field to improve code readability

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> -----Original Message-----
> From: Ilpo Järvinen <ilpo.jarvinen@xxxxxxxxxxxxxxx>
> Sent: Friday, 24 January 2025 14:57
> To: Vadim Pasternak <vadimp@xxxxxxxxxx>
> Cc: Hans de Goede <hdegoede@xxxxxxxxxx>; Michael Shych
> <michaelsh@xxxxxxxxxx>; Ciju Rajan K <crajank@xxxxxxxxxx>; Felix Radensky
> <fradensky@xxxxxxxxxx>; Oleksandr Shamray <oleksandrs@xxxxxxxxxx>;
> platform-driver-x86@xxxxxxxxxxxxxxx
> Subject: RE: [PATCH v4 06/12] platform/mellanox: Rename field to improve
> code readability
> 
> On Fri, 24 Jan 2025, Vadim Pasternak wrote:
> >
> > > -----Original Message-----
> > > From: Ilpo Järvinen <ilpo.jarvinen@xxxxxxxxxxxxxxx>
> > > Sent: Friday, 24 January 2025 10:14
> > > To: Vadim Pasternak <vadimp@xxxxxxxxxx>
> > > Cc: Hans de Goede <hdegoede@xxxxxxxxxx>; Michael Shych
> > > <michaelsh@xxxxxxxxxx>; Ciju Rajan K <crajank@xxxxxxxxxx>; Felix
> > > Radensky <fradensky@xxxxxxxxxx>; Oleksandr Shamray
> > > <oleksandrs@xxxxxxxxxx>; platform-driver-x86@xxxxxxxxxxxxxxx
> > > Subject: Re: [PATCH v4 06/12] platform/mellanox: Rename field to
> > > improve code readability
> > >
> > > On Thu, 23 Jan 2025, Vadim Pasternak wrote:
> > >
> > > > Rename filed 'item' in structure 'mlxreg_core_item' to 'item_count'.
> > >
> > > field -> field
> > >
> > > 'item' -> 'count'
> > >
> > > However, this did not rename 'counter' (that's in the other struct)
> > > which was what I suggested you should consider changing.
> > >
> > > Also in mlxreg_core_item, 'count' field seems to be the number of
> > > elements in 'data' so 'item_count' doesn't sound so good name in
> > > this particular case (in the other case 'counter' counts the number
> > > of items in 'item', thus my suggestion to use 'item_count').
> >
> > Hi Ilpo,
> >
> > I think better to rename counter filed in 'mlxreg_core_item' to same
> > 'counter' name as in 'mlxreg_core_platform_data'.
> > Thus, 'item->counter' will be number of 'data' elements (struct
> > 'mlxreg_core_item')and 'pdata->counter' will be like it is now number of
> 'item' elements: 'item->counter'
> > (struct 'mlxreg_core_platform_data').
> 
> No. "Counter" means something that is counting something which is not really
> the case here. Just use "count" if you want have them the same.

OK, in this case I'll change field name to 'count' in ' mlxreg_core_hotplug_platform_data'
and 'mlxreg_core_item'.
But will leave name 'counter' in 'mlxreg_core_platform_data' because it will require
changes in drivers from the different subsystems (led, hwmon, wd) and it'll complicate
submission.

Thanks,
Vadim.

> 
> --
>  i.




[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux