From patchwork Sun Jul 1 00:19:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Pabalinas X-Patchwork-Id: 10498469 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 1D71660552 for ; Sun, 1 Jul 2018 00:20:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0EBB128B1C for ; Sun, 1 Jul 2018 00:20:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F358328C10; Sun, 1 Jul 2018 00:20:27 +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=-7.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, 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 6BA2128B1C for ; Sun, 1 Jul 2018 00:20:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752211AbeGAAUM (ORCPT ); Sat, 30 Jun 2018 20:20:12 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:42410 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752085AbeGAAUD (ORCPT ); Sat, 30 Jun 2018 20:20:03 -0400 Received: by mail-pf0-f196.google.com with SMTP id v9-v6so4713862pff.9; Sat, 30 Jun 2018 17:20:02 -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:in-reply-to:references; bh=Mhr7JwFi8iflendta6bT0wM7DZnPnlvlWV2sR3YuKf4=; b=KzFFXAQ2R6A7xjAorleokBxIXUW6phi7ewLB3GOp6ByRGqtGBMHhwsWQ6BVY8dKuX5 OwZKPb78pStWOHoGgpmR/jMt2GslXTNZkvlaBxqXr57p22mAIX9rsvgs+2giajOIE4Lz YGDjYBcwriYrMMG3QPIef9/52bH3nMt1cgYWYVMbjFh/Ey9K4hJdYuvBZrTDQ6LMZppH C15F6wA5irX71p7nGUKjCggTvKRxxlApiD5j1YzkXKQxMUX8Wriupl8lpRCVAGrhakTn T1knjWseYKmQ7exdvAfGSQFxD4Hz7uqK50cWUU9dpQvtmbdmxoj31NP77nu1QelOZpm8 DmmQ== 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:in-reply-to :references; bh=Mhr7JwFi8iflendta6bT0wM7DZnPnlvlWV2sR3YuKf4=; b=XKzMkY5GjIleG+705LuIeI8+yeHieBjhmaXt64Wvukc/kkHblg7CPvmAjdnpDnh4WU PGwxDZmiq8ZdaHee8rrn+/R3lyvQWP7JoJ2MKDm1Vlw2wlwtd3CVhF35w244X3OuQZJ0 wyv67cb8bq2yB+a6VMC3qm8fbgFEc6T0M9b1WjQWeno/3AmxQPLs6XbZ4mNFHj7oZLWm Oib9K6/xGzEKDv/RaoXy4FUSQHm35wuKsZNLUVvJsajHOUB7nDeaRWz2XhGZj5U0TEq/ T+kL7SLosB3jIYyuFtJYXfaZddEGLWXUoXl2AlQqIdrMm9GqASVGwCQ8PVrS7CZR86qP yLAw== X-Gm-Message-State: APt69E0/lmZmDGy2RApfCTXsZPfre0fW0tsK81MWHZQGnTsBktbSOPnN JaqFARR/S7sT2xVoi+lFHUBN6A== X-Google-Smtp-Source: AAOMgpdZAGo8j9aYckcfptoZWBbl8aWYK/s7zHGpYrp4d+zxphnQRWqbYCgKqheYR9+WpkW7z9YfiA== X-Received: by 2002:a62:8917:: with SMTP id v23-v6mr20166699pfd.127.1530404402133; Sat, 30 Jun 2018 17:20:02 -0700 (PDT) Received: from hobbes.alyptik.lan ([2605:e000:1117:c002:2e0:1bff:fe70:ea]) by smtp.gmail.com with ESMTPSA id b123-v6sm8424566pfb.156.2018.06.30.17.20.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 30 Jun 2018 17:20:01 -0700 (PDT) From: Joey Pabalinas To: linux-input@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Jiri Kosina , Benjamin Tissoires , Daniel Martin Subject: [PATCH 4/4] HID: multitouch: remove unneeded else conditional cases Date: Sat, 30 Jun 2018 14:19:53 -1000 Message-Id: X-Mailer: git-send-email 2.18.0 In-Reply-To: References: 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 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 1 file changed, 6 insertions(+), 5 deletions(-) Reviewed-by: Benjamin Tissoires 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 ||