usb: gadget: qdss: Fix overlapping comparison operators

The conditional check in qdss_enable_debug_inface_store() ensures that the
user input is either a 1 or 0.  However, the comparison check used has
overlapping conditions, leading to a compile warning/error.  Change the
operators to check explicitly for 1 or 0 to avoid this.

Change-Id: I582cd0ab56815b434818744f597f867fbf3abce2
Signed-off-by: Wesley Cheng <wcheng@codeaurora.org>
This commit is contained in:
Wesley Cheng 2020-08-29 01:46:19 -07:00 • committed by Gerrit - the friendly Code Review server
commit 47ea755874

View file

@ -1013,7 +1013,7 @@ static ssize_t qdss_enable_debug_inface_store(struct config_item *item,
return len;
}
if (kstrtou8(page, 0, &stats) != 0 && (stats != 0 || stats != 1)) {
if (kstrtou8(page, 0, &stats) != 0 && !(stats == 0 || stats == 1)) {
pr_err("(%u)Wrong value. enter 0 to disable or 1 to enable.\n",
stats);
return len;