From 47ea7558748fefc9f98bf691e4669c74c9a2c22c Mon Sep 17 00:00:00 2001 From: Wesley Cheng Date: Sat, 29 Aug 2020 01:46:19 -0700 Subject: [PATCH] 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 --- drivers/usb/gadget/function/f_qdss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/function/f_qdss.c b/drivers/usb/gadget/function/f_qdss.c index 8c2d9b8dff20..92c3bfaaecba 100644 --- a/drivers/usb/gadget/function/f_qdss.c +++ b/drivers/usb/gadget/function/f_qdss.c @@ -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;