From patchwork Sat Jul 8 19:25:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christos Gkekas X-Patchwork-Id: 9831517 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C4233602A0 for ; Sat, 8 Jul 2017 19:26:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AAFD41FFB7 for ; Sat, 8 Jul 2017 19:26:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9DD512521E; Sat, 8 Jul 2017 19:26:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A0E821FFB7 for ; Sat, 8 Jul 2017 19:26:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753065AbdGHT0W (ORCPT ); Sat, 8 Jul 2017 15:26:22 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:35511 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753016AbdGHT0V (ORCPT ); Sat, 8 Jul 2017 15:26:21 -0400 Received: by mail-wr0-f196.google.com with SMTP id z45so15432728wrb.2; Sat, 08 Jul 2017 12:26:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=cXV15GE/NuZp9kHcf+c/KmPvu7bq9daq7NPH9zYtx+Q=; b=AwfcgfL8rHjZp9ohdoSkLmIFni0Witrxs829f9N7IhngG/L2sIONgR8umwT9lla7oD MJSm5C3hk20RX+/aDvsPXF5qtgRLTlRPJe+akGj2ZB/Z6QH+vObXEceCjMVlLhgfWPoO vS0fL1MU69Q/2sBKn5Y8MyOluUXw9sDnAgRYyGbn+/D3vUzrUnkHT3CZN2k2wUqRXLNn 4oeOk4v4nZMKxnqrEqStZ6wZvVCnvZh0FHPYGnY4sfSasY6t0fI1sHlHOh8uJ7T5aRkF Qwb1GeAZ0Kx9VnATXGGuxmLElAbmtiK05uLamEDGlqUFjK+3zPtkw821wcv1HLLIPiHO q17w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=cXV15GE/NuZp9kHcf+c/KmPvu7bq9daq7NPH9zYtx+Q=; b=S4efm6j+dUm3AaR7YS0o5+EMDsHwzD1LZxnPS0sDWjfxNIs77O0IXzFHPTfPrf/dll DCzxo0VaLm02Cam9yvi7gJNWbZcQml5xdZS+sRcH//jPyzYYpTY3IPs6kMwgsQ9Qeq2F TgRrSbM54N6ARiAhFdt307QN9QugrOmsgeVUlFmSkbuEvz0P59S3iY2JQkiOjuXOQu2H r3AyxKft5Vziv1I/ivQ4OduAN4/uEBQAyitJGH9naGXLCvoC5F8cA5g7CqWVZM4KixZL xZuPLbvBeda2CdQ8UTBxPQ7dKSbcrCRgBpOsTUDJVD+fWdXIcwqGMYtq0eA6s0VKefDA xx0Q== X-Gm-Message-State: AIVw112lP4+CnXxYAeOdEy2LXNKphciV2BG5ckSvHkfvr+PChEBUs3DG 6v5Qd0IHNsJvnA== X-Received: by 10.223.136.11 with SMTP id d11mr3371041wrd.73.1499541980219; Sat, 08 Jul 2017 12:26:20 -0700 (PDT) Received: from inspiron ([2a02:c7d:5e0c:c300:e8a6:f2aa:e229:3a23]) by smtp.gmail.com with ESMTPSA id j13sm11844670wra.56.2017.07.08.12.26.19 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 08 Jul 2017 12:26:19 -0700 (PDT) From: Christos Gkekas To: Joe Perches , Jiri Kosina , Benjamin Tissoires , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Christos Gkekas Subject: [PATCH RESEND] HID: wacom: Remove comparison of u8 mode with zero and simplify. Date: Sat, 8 Jul 2017 20:25:48 +0100 Message-Id: <1499541948-3392-1-git-send-email-chris.gekas@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Variable mode in method wacom_show_remote_mode() is defined as u8, thus statement (mode >= 0) is always true and should be removed, simplifying the logic. Signed-off-by: Christos Gkekas Reviewed-by: Benjamin Tissoires --- drivers/hid/wacom_sys.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c index 838c1eb..ae2408d 100644 --- a/drivers/hid/wacom_sys.c +++ b/drivers/hid/wacom_sys.c @@ -1671,10 +1671,7 @@ static ssize_t wacom_show_remote_mode(struct kobject *kobj, u8 mode; mode = wacom->led.groups[index].select; - if (mode >= 0 && mode < 3) - return snprintf(buf, PAGE_SIZE, "%d\n", mode); - else - return snprintf(buf, PAGE_SIZE, "%d\n", -1); + return sprintf(buf, "%d\n", mode < 3 ? mode : -1); } #define DEVICE_EKR_ATTR_GROUP(SET_ID) \