Re: [PATCH v1 01/21] hwmon: Fix the type of 'config' in struct hwmon_channel_info to u64

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

 




在 2025/1/22 1:05, Russell King (Oracle) 写道:
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.
Yes.

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.
got it. Thanks for suggestion.




[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux