LKML Archive on lore.kernel.org
 help / Atom feed
From: Joey Pabalinas <joeypabalinas@gmail.com>
To: linux-input@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Jiri Kosina <jikos@kernel.org>,
	Benjamin Tissoires <benjamin.tissoires@redhat.com>,
	Daniel Martin <consume.noise@gmail.com>
Subject: [PATCH RESEND 4/4] HID: multitouch: remove unneeded else conditional cases
Date: Thu,  9 Aug 2018 13:39:19 -1000
Message-ID: <d35643165a1d1972fd91e547922697a3c785a413.1530402641.git.joeypabalinas@gmail.com> (raw)
Message-ID: <20180809233919.bkHn4ajY5xtFVm20dmlFMPl-GgEBX2yYDMj_iiHUKmg@z> (raw)
In-Reply-To: <cover.1530402641.git.joeypabalinas@gmail.com>

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 <joeypabalinas@gmail.com>

 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


  parent reply index

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-01  0:19 [PATCH 0/4] reduce Surface Pro 3 multitouch jitter Joey Pabalinas
2018-07-01  0:19 ` [PATCH 1/4] HID: multitouch: add MT_QUIRK_NOT_SEEN_MEANS_UP to MT_CLS_WIN_8 quirks Joey Pabalinas
2018-07-03  7:53   ` Benjamin Tissoires
2018-08-09 23:57     ` Joey Pabalinas
2018-08-09 23:39   ` [PATCH RESEND " Joey Pabalinas
2018-08-10  3:54   ` Joey Pabalinas
2018-07-01  0:19 ` [PATCH 2/4] HID: multitouch: don't check HID_GROUP_MULTITOUCH_WIN_8 for serial protocol Joey Pabalinas
2018-07-03  8:16   ` Benjamin Tissoires
2018-08-10  3:50     ` Joey Pabalinas
2018-08-09 23:39   ` [PATCH RESEND " Joey Pabalinas
2018-07-01  0:19 ` [PATCH 3/4] HID: multitouch: drop reports containing invalid values Joey Pabalinas
2018-07-03  8:13   ` Benjamin Tissoires
2018-08-10  3:27     ` Joey Pabalinas
2018-08-09 23:39   ` [PATCH RESEND " Joey Pabalinas
2018-07-01  0:19 ` Joey Pabalinas [this message]
2018-07-03  8:17   ` [PATCH 4/4] HID: multitouch: remove unneeded else conditional cases Benjamin Tissoires
2018-08-10  0:03     ` Joey Pabalinas
2018-08-09 23:39   ` [PATCH RESEND " Joey Pabalinas
2018-08-09 23:39 ` [PATCH RESEND 0/4] reduce Surface Pro 3 multitouch jitter Joey Pabalinas

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d35643165a1d1972fd91e547922697a3c785a413.1530402641.git.joeypabalinas@gmail.com \
    --to=joeypabalinas@gmail.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=consume.noise@gmail.com \
    --cc=jikos@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git
	git clone --mirror https://lore.kernel.org/lkml/7 lkml/git/7.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ https://lore.kernel.org/lkml \
		linux-kernel@vger.kernel.org linux-kernel@archiver.kernel.org
	public-inbox-index lkml


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox