The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Ninad Naik <ninadnaik07@gmail.com>
To: linux@roeck-us.net
Cc: linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org,
	skhan@linuxfoundation.org, me@brighamcampbell.com,
	linux-kernel-mentees@lists.linux.dev,
	Ninad Naik <ninadnaik07@gmail.com>
Subject: [PATCH 3/3] hwmon: lm93: Remove else blocks after break or return for consistency
Date: Thu,  7 May 2026 15:41:43 +0530	[thread overview]
Message-ID: <20260507101143.559475-4-ninadnaik07@gmail.com> (raw)
In-Reply-To: <20260507101143.559475-1-ninadnaik07@gmail.com>

Fix checkpatch.pl warnings by removing multiple else blocks after break
or return statement to follow latest kernel code style.
Compiled the file and verified the changes. No functional changes are made.

Signed-off-by: Ninad Naik <ninadnaik07@gmail.com>
---
 drivers/hwmon/lm93.c | 39 +++++++++++++++------------------------
 1 file changed, 15 insertions(+), 24 deletions(-)

diff --git a/drivers/hwmon/lm93.c b/drivers/hwmon/lm93.c
index 1a3b5da924b2..ddc4c4377128 100644
--- a/drivers/hwmon/lm93.c
+++ b/drivers/hwmon/lm93.c
@@ -403,10 +403,9 @@ static u8 LM93_IN_REL_TO_REG(unsigned int val, int upper, int vid)
 	if (upper) {
 		uv_offset = clamp_val(uv_offset, 12500, 200000);
 		return (u8)((uv_offset /  12500 - 1) << 4);
-	} else {
-		uv_offset = clamp_val(uv_offset, -400000, -25000);
-		return (u8)((uv_offset / -25000 - 1) << 0);
 	}
+	uv_offset = clamp_val(uv_offset, -400000, -25000);
+	return (u8)((uv_offset / -25000 - 1) << 0);
 }
 
 /*
@@ -811,15 +810,12 @@ static u8 lm93_read_byte(struct i2c_client *client, u8 reg)
 	/* retry in case of read errors */
 	for (i = 1; i <= MAX_RETRIES; i++) {
 		value = i2c_smbus_read_byte_data(client, reg);
-		if (value >= 0) {
+		if (value >= 0)
 			return value;
-		} else {
-			dev_warn(&client->dev,
+		dev_warn(&client->dev,
 				 "lm93: read byte data failed, address 0x%02x.\n",
 				 reg);
-			mdelay(i + 3);
-		}
-
+		mdelay(i + 3);
 	}
 
 	/* <TODO> what to return in case of error? */
@@ -849,15 +845,12 @@ static u16 lm93_read_word(struct i2c_client *client, u8 reg)
 	/* retry in case of read errors */
 	for (i = 1; i <= MAX_RETRIES; i++) {
 		value = i2c_smbus_read_word_data(client, reg);
-		if (value >= 0) {
+		if (value >= 0)
 			return value;
-		} else {
-			dev_warn(&client->dev,
-				 "lm93: read word data failed, address 0x%02x.\n",
-				 reg);
-			mdelay(i + 3);
-		}
-
+		dev_warn(&client->dev,
+			 "lm93: read word data failed, address 0x%02x.\n",
+			 reg);
+		mdelay(i + 3);
 	}
 
 	/* <TODO> what to return in case of error? */
@@ -895,14 +888,12 @@ static void lm93_read_block(struct i2c_client *client, u8 fbn, u8 *values)
 		result = i2c_smbus_read_block_data(client,
 			lm93_block_read_cmds[fbn].cmd, lm93_block_buffer);
 
-		if (result == lm93_block_read_cmds[fbn].len) {
+		if (result == lm93_block_read_cmds[fbn].len)
 			break;
-		} else {
-			dev_warn(&client->dev,
-				 "lm93: block read data failed, command 0x%02x.\n",
-				 lm93_block_read_cmds[fbn].cmd);
-			mdelay(i + 3);
-		}
+		dev_warn(&client->dev,
+			 "lm93: block read data failed, command 0x%02x.\n",
+			 lm93_block_read_cmds[fbn].cmd);
+		mdelay(i + 3);
 	}
 
 	if (result == lm93_block_read_cmds[fbn].len) {
-- 
2.54.0


  parent reply	other threads:[~2026-05-07 10:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-07 10:11 [PATCH 0/3] hwmon: lm93: clean up coding style issues Ninad Naik
2026-05-07 10:11 ` [PATCH 1/3] hwmon: lm93: Add missing blank lines after declarations Ninad Naik
2026-05-07 10:11 ` [PATCH 2/3] hwmon: lm93: Change unsigned to unsigned int for clarity Ninad Naik
2026-05-07 10:11 ` Ninad Naik [this message]
2026-05-08 16:27 ` [PATCH 0/3] hwmon: lm93: clean up coding style issues Guenter Roeck

Reply instructions:

You may reply publicly 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=20260507101143.559475-4-ninadnaik07@gmail.com \
    --to=ninadnaik07@gmail.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel-mentees@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=me@brighamcampbell.com \
    --cc=skhan@linuxfoundation.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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox