Commit 6060a75
platform/x86: thinkpad_acpi: consistently check fan_get_status return.
Clang static analysis returns this false positive
thinkpad_acpi.c:8926:19: warning: The left operand
of '!=' is a garbage value
(status != 0) ? "enabled" : "disabled", status);
~~~~~~ ^
The return of fan_get_status* is checked inconsistenly.
Sometime ret < 0 is an error, sometimes !ret.
Both fan_get_status() and fan_get_status_safe() return
0 on success and return negative otherwise. Change
the checks for error, ret < 0, into checks for
not success, !ret.
Signed-off-by: Tom Rix <trix@redhat.com>
Link: https://lore.kernel.org/r/20220312145327.1398510-1-trix@redhat.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>1 parent 286e937 commit 6060a75
1 file changed
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8285 | 8285 | | |
8286 | 8286 | | |
8287 | 8287 | | |
8288 | | - | |
| 8288 | + | |
8289 | 8289 | | |
8290 | 8290 | | |
8291 | 8291 | | |
| |||
8304 | 8304 | | |
8305 | 8305 | | |
8306 | 8306 | | |
8307 | | - | |
| 8307 | + | |
8308 | 8308 | | |
8309 | 8309 | | |
8310 | 8310 | | |
| |||
8843 | 8843 | | |
8844 | 8844 | | |
8845 | 8845 | | |
8846 | | - | |
| 8846 | + | |
8847 | 8847 | | |
8848 | 8848 | | |
8849 | 8849 | | |
| |||
8864 | 8864 | | |
8865 | 8865 | | |
8866 | 8866 | | |
8867 | | - | |
| 8867 | + | |
8868 | 8868 | | |
8869 | 8869 | | |
8870 | 8870 | | |
| |||
8918 | 8918 | | |
8919 | 8919 | | |
8920 | 8920 | | |
8921 | | - | |
| 8921 | + | |
8922 | 8922 | | |
8923 | 8923 | | |
8924 | 8924 | | |
| |||
8929 | 8929 | | |
8930 | 8930 | | |
8931 | 8931 | | |
8932 | | - | |
| 8932 | + | |
8933 | 8933 | | |
8934 | 8934 | | |
8935 | 8935 | | |
| |||
0 commit comments