public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Eugene Shalygin <eugene.shalygin@gmail.com>
Cc: Jean Delvare <jdelvare@suse.com>,
	linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 3/4] hwmon: (asus-ec-sensors) add support for board families
Date: Tue, 26 Apr 2022 08:24:18 -0700	[thread overview]
Message-ID: <20220426152418.GA3344789@roeck-us.net> (raw)
In-Reply-To: <20220426092340.495704-4-eugene.shalygin@gmail.com>

On Tue, Apr 26, 2022 at 11:23:39AM +0200, Eugene Shalygin wrote:
> DSDT code for AMD 400-series chipset shows that sensor addresses differ
> for this generation from those for the AMD 500-series boards.
> 
> Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com>
> ---
>  drivers/hwmon/asus-ec-sensors.c | 39 ++++++++++++++++++++++++++++-----
>  1 file changed, 34 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/hwmon/asus-ec-sensors.c b/drivers/hwmon/asus-ec-sensors.c
> index 7267682de191..b52e3679476a 100644
> --- a/drivers/hwmon/asus-ec-sensors.c
> +++ b/drivers/hwmon/asus-ec-sensors.c
> @@ -135,8 +135,12 @@ enum ec_sensors {
>  #define SENSOR_TEMP_WATER_IN BIT(ec_sensor_temp_water_in)
>  #define SENSOR_TEMP_WATER_OUT BIT(ec_sensor_temp_water_out)
>  
> +enum board_family {
> +	family_amd_500_series,

The default enum value is 0. This means that specifying nothing
for .family matches in the structure below always matches the first
enum, which doesn't make much sense and might cause trouble in the
future. I would suggest to explicitly select a value != 0 as first
entry, such as 

enum board_family {
	family_amd_500_series = 1,
	...
};

to avoid that problem.

Guenter

  reply	other threads:[~2022-04-26 15:24 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-26  9:23 [PATCH v2 0/4] asus-ec-sensors: add support for board families Eugene Shalygin
2022-04-26  9:23 ` [PATCH v2 1/4] hwmon: (asus-ec-sensors) introduce ec_board_info struct for board data Eugene Shalygin
2022-04-26 15:16   ` Guenter Roeck
2022-04-27  9:32     ` Eugene Shalygin
2022-04-27 12:04       ` Guenter Roeck
2022-04-27 12:16         ` Eugene Shalygin
2022-04-27 13:20           ` Guenter Roeck
2022-04-27 13:34             ` Eugene Shalygin
2022-04-27 13:41               ` Guenter Roeck
2022-04-27 13:46                 ` Eugene Shalygin
2022-04-26  9:23 ` [PATCH v2 2/4] hwmon: (asus-ec-sensors) implement locking via the ACPI global lock Eugene Shalygin
2022-04-26  9:23 ` [PATCH v2 3/4] hwmon: (asus-ec-sensors) add support for board families Eugene Shalygin
2022-04-26 15:24   ` Guenter Roeck [this message]
2022-04-26 21:50     ` Eugene Shalygin
2022-04-26  9:23 ` [PATCH v2 4/4] hwmon: (asus-ec-sensors) add PRIME X470-PRO board Eugene Shalygin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220426152418.GA3344789@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=eugene.shalygin@gmail.com \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox