Patch "hwmon: (scmi) Remove redundant pointer check" has been added to the 4.19-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    hwmon: (scmi) Remove redundant pointer check

to the 4.19-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     hwmon-scmi-remove-redundant-pointer-check.patch
and it can be found in the queue-4.19 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From a31796c30e423f58d266df30a9bbf321fc071b30 Mon Sep 17 00:00:00 2001
From: Nathan Chancellor <natechancellor@xxxxxxxxx>
Date: Sat, 15 Sep 2018 17:05:07 -0700
Subject: hwmon: (scmi) Remove redundant pointer check

From: Nathan Chancellor <natechancellor@xxxxxxxxx>

commit a31796c30e423f58d266df30a9bbf321fc071b30 upstream.

Clang warns when the address of a pointer is used in a boolean context
as it will always return true.

drivers/hwmon/scmi-hwmon.c:59:24: warning: address of array
'sensor->name' will always evaluate to 'true'
[-Wpointer-bool-conversion]
        if (sensor && sensor->name)
                   ~~ ~~~~~~~~^~~~
1 warning generated.

Remove the check as it isn't doing anything currently; if validation
of the contents of the data structure was intended by the original
author (since this line has been present from the first version of
this driver), it can be added in a follow-up patch.

Reported-by: Nick Desaulniers <ndesaulniers@xxxxxxxxxx>
Signed-off-by: Nathan Chancellor <natechancellor@xxxxxxxxx>
Signed-off-by: Guenter Roeck <linux@xxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/hwmon/scmi-hwmon.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/hwmon/scmi-hwmon.c
+++ b/drivers/hwmon/scmi-hwmon.c
@@ -56,7 +56,7 @@ scmi_hwmon_is_visible(const void *drvdat
 	const struct scmi_sensors *scmi_sensors = drvdata;
 
 	sensor = *(scmi_sensors->info[type] + channel);
-	if (sensor && sensor->name)
+	if (sensor)
 		return S_IRUGO;
 
 	return 0;


Patches currently in stable-queue which might be from natechancellor@xxxxxxxxx are

queue-4.19/rsi-remove-unnecessary-boolean-condition.patch
queue-4.19/hwmon-scmi-remove-redundant-pointer-check.patch
queue-4.19/kernel-extable.c-use-address-of-operator-on-section-symbols.patch
queue-4.19/regulator-da905-2-5-remove-unnecessary-array-check.patch
queue-4.19/lib-dynamic_debug.c-use-address-of-operator-on-section-symbols.patch



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux