[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <193f1583-973e-4d5b-8a9f-559622b16441@roeck-us.net>
Date: Tue, 21 Jan 2025 09:32:23 -0800
From: Guenter Roeck <linux@...ck-us.net>
To: "Russell King (Oracle)" <linux@...linux.org.uk>,
Huisong Li <lihuisong@...wei.com>
Cc: linux-hwmon@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-media@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
arm-scmi@...r.kernel.org, netdev@...r.kernel.org, linux-rtc@...r.kernel.org,
oss-drivers@...igine.com, linux-rdma@...r.kernel.org,
platform-driver-x86@...r.kernel.org, linuxarm@...wei.com, jdelvare@...e.com,
kernel@...davale.org, pauk.denis@...il.com, james@...iv.tech,
sudeep.holla@....com, cristian.marussi@....com, matt@...ostay.sg,
mchehab@...nel.org, irusskikh@...vell.com, andrew+netdev@...n.ch,
davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
pabeni@...hat.com, saeedm@...dia.com, leon@...nel.org, tariqt@...dia.com,
louis.peens@...igine.com, hkallweit1@...il.com, kabel@...nel.org,
W_Armin@....de, hdegoede@...hat.com, ilpo.jarvinen@...ux.intel.com,
alexandre.belloni@...tlin.com, krzk@...nel.org, jonathan.cameron@...wei.com,
zhanjie9@...ilicon.com, zhenglifeng1@...wei.com, liuyonglong@...wei.com
Subject: Re: [PATCH v1 01/21] hwmon: Fix the type of 'config' in struct
hwmon_channel_info to u64
On 1/21/25 09:05, Russell King (Oracle) wrote:
> On Tue, Jan 21, 2025 at 02:44:59PM +0800, Huisong Li wrote:
>> */
>> struct hwmon_channel_info {
>> enum hwmon_sensor_types type;
>> - const u32 *config;
>> + const u64 *config;
>> };
>>
>> #define HWMON_CHANNEL_INFO(stype, ...) \
>> (&(const struct hwmon_channel_info) { \
>> .type = hwmon_##stype, \
>> - .config = (const u32 []) { \
>> + .config = (const u64 []) { \
>> __VA_ARGS__, 0 \
>> } \
>> })
>
> I'm sorry, but... no. Just no. Have you tried building with only your
> first patch?
>
> It will cause the compiler to barf on, e.g. the following:
>
> static u32 marvell_hwmon_chip_config[] = {
> ...
>
> static const struct hwmon_channel_info marvell_hwmon_chip = {
> .type = hwmon_chip,
> .config = marvell_hwmon_chip_config,
> };
>
> I suggest that you rearrange your series: first, do the conversions
> to HWMON_CHANNEL_INFO() in the drivers you have.
>
> At this point, if all the drivers that assign to hw_channel_info.config
> have been converted, this patch 1 is then suitable.
>
> If there are still drivers that assign a u32 array to
> hw_channel_info.config, then you need to consider how to handle
> that without causing regressions. You can't cast it between a u32
> array and u64 array to silence the warning, because config[1]
> won't point at the next entry.
>
> I think your only option would be to combine the conversion of struct
> hwmon_channel_info and the other drivers into a single patch. Slightly
> annoying, but without introducing more preprocessor yuckiness, I don't
> see another way.
>
This is moot because the series does not explain which attributes
would be added ... and it turns out the to-be-added attributes would be
non-standard and thus not be acceptable anyway. On top of that, if the
size of configuration fields ever becomes an issue, I would look for a
much less invasive solution.
The author of this series did not contact me before submitting it,
and I did not have a chance to prevent it from being submitted.
Still, sorry for the noise.
Guenter
Powered by blists - more mailing lists