Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp876013imm; Tue, 3 Jul 2018 01:19:09 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKe7bfwMue+pnXHBIWHQQC7T5LYXUdJnFttlk9nOPEThzlC9/ECvDejGE/JOFFVOv6ryERN X-Received: by 2002:a17:902:8f82:: with SMTP id z2-v6mr29133770plo.203.1530605949794; Tue, 03 Jul 2018 01:19:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530605949; cv=none; d=google.com; s=arc-20160816; b=kwoLeWk0dqIzN31QIOVMK4wVkLCcRg9AtnfjpLVkHVK3TKpstmtIoGhfqvX+v5XmuC oPhLxFXP3pAyO8uM7yS0fhnZUOQgdaa0CoDlNnZ/Zgs8HyF2qGoZcUbfVVqSUs3WpsN+ rlJTPG1U7Qz+eq1YaYof8nL4BhVf3JcI/3P/MyKx6SZNz4clPOi7n/sLTAmsFYqbjQ5r wcBqf95pIUER6GDNB0lcSfHX/qpCiJTDgMLwblexDxkWi7odF9jvuB3ozkVw0WnyX7Ka 6aVzQ8Ej15fOCnh84W9hHj6rEmvfG4qLitG6JBdz0KlGCkxLPwkQuNnI05Pljr4JZeTk lClA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:arc-authentication-results; bh=VyyBQEPjzsX4JSExyA6bThl9OxFWCIZcvp8f9y5GTUs=; b=MYR1Qgv2x0eE2lPyMeH00Hu+Urx7CucPooqgMEheOFpaLxGjzwhMh42be5YupjBDgR NDMReeE8KWjSx0zwG8kfvSKI36JxkZ1Z6EUFkDfNJ7dT9HLcC/g64VMdP4596/buD0au I16OTL8KKgLUkJRk+YNRiXkQpPhoQZLBtn1njeL0YEJDTrahnbqtpThKRNhSVSzJDksL VviUtLgDhg4PV17J0WMbzhA4UI4Vf2Gtpl7hfda7PkL7n6Tg4hc3q8pHyHUsGiQZJhtU iageBRyvCrvlWUFLL3t6jRbH0j8hGZhqZkqMKO6ebNezLAv8ZxWnDsuj8c0MdQGAepgi VA5g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u1-v6si497077pgo.114.2018.07.03.01.18.54; Tue, 03 Jul 2018 01:19:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933304AbeGCISB (ORCPT + 99 others); Tue, 3 Jul 2018 04:18:01 -0400 Received: from mail-qt0-f196.google.com ([209.85.216.196]:43293 "EHLO mail-qt0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753463AbeGCIR7 (ORCPT ); Tue, 3 Jul 2018 04:17:59 -0400 Received: by mail-qt0-f196.google.com with SMTP id f18-v6so815921qtp.10 for ; Tue, 03 Jul 2018 01:17:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=VyyBQEPjzsX4JSExyA6bThl9OxFWCIZcvp8f9y5GTUs=; b=KOeMwPAhIcOHYEa2Tc6TfjflniFXwQrfvrtZ0KCjNyr4ZqivqlSPI7zWbnO/vhQ/xb cvHAnYcSZ4uejRXR2Pg8jQUYK4AbeGx8IT0S76JC2Y9/A87tmpEWv8hMer5QbTIpTGYR G9b8sB+nOl8WQXTK2szvrP3Quo9qqgLHdYV+t7ZCkik4RTtmZCwUBgQ05XejNSu99oER G+NBtQBns1BcooHGltrbN63kYA27/u31z0t9K7spteS396iLB0aNPLniBNi6VPvFUs+M qFl5HbR9VBYgA4SvlcVcLdocevTLFlPhVDreZXKlG4QmKh8uE4zZTUmO9jX8BSNwVlB5 wiPg== X-Gm-Message-State: APt69E3O1Ilaj6JyENh3RMIHMgObTuwf6iYQpYcgO4OyME8TmZDHaz0e tWoWDWon0o+T7WDX528tE4dDjpViP/e0dv108TVTDQ== X-Received: by 2002:ac8:1a18:: with SMTP id v24-v6mr16146591qtj.115.1530605879061; Tue, 03 Jul 2018 01:17:59 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ac8:2fca:0:0:0:0:0 with HTTP; Tue, 3 Jul 2018 01:17:58 -0700 (PDT) In-Reply-To: References: From: Benjamin Tissoires Date: Tue, 3 Jul 2018 10:17:58 +0200 Message-ID: Subject: Re: [PATCH 4/4] HID: multitouch: remove unneeded else conditional cases To: Joey Pabalinas Cc: "open list:HID CORE LAYER" , lkml , Jiri Kosina , Daniel Martin Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jul 1, 2018 at 2:19 AM, Joey Pabalinas wrote: > Elide lone `else` cases and replace `else if` clauses > with plain `if` conditionals when they occur immediately > after return statements. > > Signed-off-by: Joey Pabalinas > This one looks good. Reviewed-by: Benjamin Tissoires Just FYI, I sent out a big refactor of the hid-multitouch code. Jiri should be still reviewing it, so I am not so sure who will have to rebase which series on top of the other, but someone between us will have to do it :) Cheers, Benjamin > 1 file changed, 6 insertions(+), 5 deletions(-) > > diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c > index 08b50e5908cecdda66..30b1a2c67f39a41325 100644 > --- a/drivers/hid/hid-multitouch.c > +++ b/drivers/hid/hid-multitouch.c > @@ -205,12 +205,12 @@ static void mt_post_parse(struct mt_device *td); > > static int cypress_compute_slot(struct mt_device *td) > { > if (td->curdata.contactid != 0 || td->num_received == 0) > return td->curdata.contactid; > - else > - return -1; > + > + return -1; > } > > static struct mt_class mt_classes[] = { > { .name = MT_CLS_DEFAULT, > .quirks = MT_QUIRK_ALWAYS_VALID | > @@ -803,12 +803,12 @@ static int mt_compute_timestamp(struct mt_device *td, struct hid_field *field, > delta *= 100; > > if (jdelta > MAX_TIMESTAMP_INTERVAL) > /* No data received for a while, resync the timestamp. */ > return 0; > - else > - return td->timestamp + delta; > + > + return td->timestamp + delta; > } > > static int mt_touch_event(struct hid_device *hid, struct hid_field *field, > struct hid_usage *usage, __s32 value) > { > @@ -1110,11 +1110,12 @@ static int mt_input_mapping(struct hid_device *hdev, struct hid_input *hi, > * HID_DG_CONTACTCOUNT from the pen report as it is outside the physical > * collection, but within the report ID. > */ > if (field->physical == HID_DG_STYLUS) > return 0; > - else if ((field->physical == 0) && > + > + if ((field->physical == 0) && > (field->report->id != td->mt_report_id) && > (td->mt_report_id != -1)) > return 0; > > if (field->application == HID_DG_TOUCHSCREEN || > -- > 2.18.0 >