tegra11_soctherm.c: fix compilation with gcc 7
authorMax Krummenacher <max.krummenacher@toradex.com>
Mon, 24 Jul 2017 12:11:40 +0000 (14:11 +0200)
committerMarcel Ziswiler <marcel.ziswiler@toradex.com>
Wed, 20 Sep 2017 16:16:11 +0000 (18:16 +0200)
With gcc 7 the following compile time error occurs:

| arch/arm/mach-tegra/tegra11_soctherm.c:2978:40: error: the omitted middle operand in ?: will always be 'true', suggest explicit middle operand [-Werror=parentheses]
|    s->sensor_enable = s->sensor_enable ?: therm->zone_enable;
|                                         ^

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
arch/arm/mach-tegra/tegra11_soctherm.c

index 5a2140234ec1c3a00bbc97a8b7158431a382be60..f1d24c278e74c1cb3c02c98606fc343c398c73b3 100644 (file)
@@ -2975,7 +2975,8 @@ static int soctherm_init_platform_data(void)
        for (i = 0; i < TSENSE_SIZE; i++) {
                therm = &plat_data.therm[tsensor2therm_map[i]];
                s = &plat_data.sensor_data[i];
-               s->sensor_enable = s->sensor_enable ?: therm->zone_enable;
+               if (!(s->sensor_enable))
+                       s->sensor_enable = therm->zone_enable;
                s->tall      = s->tall      ?: sensor_defaults.tall;
                s->tiddq     = s->tiddq     ?: sensor_defaults.tiddq;
                s->ten_count = s->ten_count ?: sensor_defaults.ten_count;