History

platform/x86: thinkpad_acpi: Fix bitwise vs. logical warning

A new warning in clang points out a use of bitwise OR with boolean expressions in this driver: drivers/platform/x86/thinkpad_acpi.c:9061:11: error: use of bitwise '|' with boolean operands [-Werror,-Wbitwise-instead-of-logical] else if ((strlencmp(cmd, "level disengaged") == 0) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ || drivers/platform/x86/thinkpad_acpi.c:9061:11: note: cast one or both operands to int to silence this warning 1 error generated. This should clearly be a logical OR so change it to fix the warning.

Nathan Chancellor committed 5 years ago

Commit fd96e351 parent 33ce79b1 file · +1 −1Browse files

Unified · Split

drivers/platform/x86/thinkpad_acpi.c+1−1
@@ -9058,7 +9058,7 @@ static int fan_write_cmd_level(const char *cmd, int *rc) · 9057 unmodified lines
9058 9058
9059 if (strlencmp(cmd, "level auto") == 0)9059 if (strlencmp(cmd, "level auto") == 0)
9060 level = TP_EC_FAN_AUTO;9060 level = TP_EC_FAN_AUTO;
9061 else if ((strlencmp(cmd, "level disengaged") == 0) |9061 else if ((strlencmp(cmd, "level disengaged") == 0) ||
9062 (strlencmp(cmd, "level full-speed") == 0))9062 (strlencmp(cmd, "level full-speed") == 0))
9063 level = TP_EC_FAN_FULLSPEED;9063 level = TP_EC_FAN_FULLSPEED;
9064 else if (sscanf(cmd, "level %d", &level) != 1)9064 else if (sscanf(cmd, "level %d", &level) != 1)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t