Re: [PATCH] hwmon: (cros-ec_hwmon) Fix access to restricted __le16

From: Guenter Roeck
Date: Thu Jun 06 2024 - 16:17:13 EST


On 6/6/24 12:53, Thomas Weißschuh wrote:
Thanks!

On 2024-06-06 11:05:07+0000, Guenter Roeck wrote:
0-day complains:

drivers-hwmon-cros_ec_hwmon.c:sparse:sparse:cast-to-restricted-__le16

Fix by using a __le16 typed variable as parameter to le16_to_cpu().

Fixes: bc3e45258096 ("hwmon: add ChromeOS EC driver")
Cc: Thomas Weißschuh <linux@xxxxxxxxxxxxxx>
Cc: Tzung-Bi Shih <tzungbi@xxxxxxxxxx>
Signed-off-by: Guenter Roeck <linux@xxxxxxxxxxxx>

Acked-by: Thomas Weißschuh <linux@xxxxxxxxxxxxxx>

Guenter, does sparse work locally for you?


It does, but I use the version from git://repo.or.cz/smatch.git.

Guenter