[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250215192935.GU1615191@kernel.org>
Date: Sat, 15 Feb 2025 19:29:35 +0000
From: Simon Horman <horms@...nel.org>
To: Tariq Toukan <tariqt@...dia.com>
Cc: "David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Eric Dumazet <edumazet@...gle.com>,
Andrew Lunn <andrew+netdev@...n.ch>,
Shahar Shitrit <shshitrit@...dia.com>,
Gal Pressman <gal@...dia.com>, Saeed Mahameed <saeedm@...dia.com>,
Leon Romanovsky <leon@...nel.org>, netdev@...r.kernel.org,
linux-rdma@...r.kernel.org, linux-kernel@...r.kernel.org,
Carolina Jubran <cjubran@...dia.com>
Subject: Re: [PATCH net-next 4/4] net/mlx5: Add sensor name to temperature
event message
On Thu, Feb 13, 2025 at 11:46:41AM +0200, Tariq Toukan wrote:
> From: Shahar Shitrit <shshitrit@...dia.com>
>
> Previously, a temperature event message included a bitmap indicating
> which sensors detect high temperatures.
>
> To enhance clarity, we modify the message format to explicitly list
> the names of the overheating sensors, alongside the sensors bitmap.
> If HWMON is not configured, the event message remains unchanged.
>
> Signed-off-by: Shahar Shitrit <shshitrit@...dia.com>
> Reviewed-by: Carolina Jubran <cjubran@...dia.com>
> Signed-off-by: Tariq Toukan <tariqt@...dia.com>
Reviewed-by: Simon Horman <horms@...nel.org>
...
> +#if IS_ENABLED(CONFIG_HWMON)
> +static void print_sensor_names_in_bit_set(struct mlx5_core_dev *dev, struct mlx5_hwmon *hwmon,
> + u64 bit_set, int bit_set_offset)
> +{
> + unsigned long *bit_set_ptr = (unsigned long *)&bit_set;
> + int num_bits = sizeof(bit_set) * BITS_PER_BYTE;
> + int i;
> +
> + for_each_set_bit(i, bit_set_ptr, num_bits) {
> + const char *sensor_name = hwmon_get_sensor_name(hwmon, i + bit_set_offset);
> +
> + mlx5_core_warn(dev, "Sensor name[%d]: %s\n", i + bit_set_offset, sensor_name);
> + }
> +}
nit:
If you have to respin for some other reason, please consider limiting lines
to 80 columns wide or less here and elsewhere in this patch where it
doesn't reduce readability (subjective I know).
e.g.:
static void print_sensor_names_in_bit_set(struct mlx5_core_dev *dev,
struct mlx5_hwmon *hwmon,
u64 bit_set, int bit_set_offset)
{
unsigned long *bit_set_ptr = (unsigned long *)&bit_set;
int num_bits = sizeof(bit_set) * BITS_PER_BYTE;
int i;
for_each_set_bit(i, bit_set_ptr, num_bits) {
const char *sensor_name;
sensor_name = hwmon_get_sensor_name(hwmon, i + bit_set_offset);
mlx5_core_warn(dev, "Sensor name[%d]: %s\n",
i + bit_set_offset, sensor_name);
}
}
...
Powered by blists - more mailing lists