From patchwork Sun Jul 2 21:54:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christos Gkekas X-Patchwork-Id: 9821785 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 CA79360224 for ; Sun, 2 Jul 2017 21:54:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B926927D4A for ; Sun, 2 Jul 2017 21:54:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AA4CA27F17; Sun, 2 Jul 2017 21:54:31 +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 488FB27D4A for ; Sun, 2 Jul 2017 21:54:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751973AbdGBVya (ORCPT ); Sun, 2 Jul 2017 17:54:30 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:35088 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751894AbdGBVy3 (ORCPT ); Sun, 2 Jul 2017 17:54:29 -0400 Received: by mail-wm0-f66.google.com with SMTP id u23so17344050wma.2; Sun, 02 Jul 2017 14:54:28 -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=qW3VxEvvBP7VBYFrL4F/jlpWy1M+rgBEPmkofdWesZM=; b=CMkkAafdtbg2v14XQkJbxvXvr4Zv9vzMmXw3Bk5wGD5g8cBbwbW6MpTwMrsE2MNkqk 2uJGKZ9xEODB06gH33IHfv1dSOdC8/RLfeyu6FPlnc13cMl++PY2Bf6ByvSo8/3z26n8 nZNM62M4uOV2QTAtK4WFC2VxD+PKqiMFbz6KMQSVfZCAcP5H7fz5YVu1Pw9TvFIBuP1c 5ttYoCsnPM744aOHuZ0wNnJuERilSeUIU9JeTSPDczOfAc28xDgFdFslOjRaenrNMseb u9J1YB5nlHAmv/vqc5QqI28qgn1C1ehPdGVGICpeqpR0nBz9NSKIB49WhVCmECorLAp9 gTdQ== 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=qW3VxEvvBP7VBYFrL4F/jlpWy1M+rgBEPmkofdWesZM=; b=GHhGt8vJyciB8K42Sf85MYNMlmbcIe7gNeM16fTj2nuSMC0Rq/xfhpHCoSSuNZNWDv Gh3w1JFeO2DY3iZQdDvAr5x0li1UPvDSEIzUQsZlS1C51zntVcUKn6eqQloVUeUkfxXg 2CTKnFuOCQNlCmGiccwri6q9ZazhihNO56mBGa6R9z0rOJXc9HZIiObcgTjX20/ElMeT C2C3JId3r+IB/Ccgz/+jAM9wisUFjzV3d7ELnwrQYeI80+VQVb4BhLWrMjM3rcLnXQN0 GFO4ybSszPUIcR5jM+EjEajg4mlXJwuQG9v61tasR6rKVg9hYRR6yOWWGEydFVBafT6i zY0A== X-Gm-Message-State: AKS2vOxrEcRog26I8WuZolQ6ixj2TSiqkwhttqqJ0oEP92sBEqPwIP3A GOeqr2mvVJAHd6gXgIY= X-Received: by 10.28.206.202 with SMTP id e193mr23021137wmg.0.1499032468063; Sun, 02 Jul 2017 14:54:28 -0700 (PDT) Received: from inspiron ([2a02:c7d:5e0c:c300:197f:7023:a78d:9f70]) by smtp.gmail.com with ESMTPSA id m26sm20119367wrm.4.2017.07.02.14.54.27 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 02 Jul 2017 14:54:27 -0700 (PDT) From: Christos Gkekas To: Jiri Kosina , Benjamin Tissoires , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Christos Gkekas Subject: [PATCH] HID: wacom: Remove comparison of u8 mode with zero and simplify. Date: Sun, 2 Jul 2017 22:54:23 +0100 Message-Id: <1499032463-22425-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 --- 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..79c3d7f 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 snprintf(buf, PAGE_SIZE, "%d\n", mode < 3 ? mode : -1); } #define DEVICE_EKR_ATTR_GROUP(SET_ID) \