Re: [PATCH] hwmon/applesmc: Fix uninitialized variables warnings

From: Guenter Roeck
Date: Thu Nov 05 2015 - 19:45:12 EST


On Thu, Nov 05, 2015 at 03:39:27PM -0700, Shuah Khan wrote:
> Fix the following "maybe used uninitialized" warnings by
> initializing the variables to keep the compiler quiet.
> There is no "used uninitialized" in this case.
>
> CC [M] drivers/hwmon/applesmc.o
> drivers/hwmon/applesmc.c: In function âapplesmc_init_smcregâ:
> drivers/hwmon/applesmc.c:595:43: warning: âright_light_sensorâ
> may be used uninitialized in this function [-Wmaybe-uninitialized]
> s->num_light_sensors = left_light_sensor + right_light_sensor;
> ^
> drivers/hwmon/applesmc.c:540:26: note: âright_light_sensorâ was
> declared here
> bool left_light_sensor, right_light_sensor;
> ^
> drivers/hwmon/applesmc.c:595:43: warning: âleft_light_sensorâ may
> be used uninitialized in this function [-Wmaybe-uninitialized]
> s->num_light_sensors = left_light_sensor + right_light_sensor;
> ^
> drivers/hwmon/applesmc.c:540:7: note: âleft_light_sensorâ was
> declared here
> bool left_light_sensor, right_light_sensor;
> ^
>
> Signed-off-by: Shuah Khan <shuahkh@xxxxxxxxxxxxxxx>

Applied.

Thanks,
Guenter
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/