From 9c89ab6d9569309c791ce7de1f8f09b464803dd9 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Sun, 16 Jun 2019 19:37:37 -0700 Subject: [PATCH] Replace one more __builtin_popcount with bitwise test __builtin_popcount might not be available and in this case, a bitwise-and can accomplish the same task. Signed-off-by: Michael Forney --- src/evdev-tablet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/evdev-tablet.c b/src/evdev-tablet.c index fc4982d..6ef2db2 100644 --- a/src/evdev-tablet.c +++ b/src/evdev-tablet.c @@ -1735,7 +1735,7 @@ tablet_update_tool_state(struct tablet_dispatch *tablet, /* Kernel tools are supposed to be mutually exclusive, if we have * two set discard the most recent one. */ - if (__builtin_popcount(tablet->tool_state) > 1) { + if (tablet->tool_state & (tablet->tool_state - 1)) { evdev_log_bug_kernel(device, "Multiple tools active simultaneously (%#x)\n", tablet->tool_state); -- 2.7.4