[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z4_T3s7zn3UQNkbW@shell.armlinux.org.uk>
Date: Tue, 21 Jan 2025 17:05:34 +0000
From: "Russell King (Oracle)" <linux@...linux.org.uk>
To: 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, linux@...ck-us.net, 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 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.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
Powered by blists - more mailing lists