linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] platform/x86: dell_rbu: fix assignment in if condition
@ 2025-08-01 10:47 darshanrathod475
  2025-08-11 12:55 ` Ilpo Järvinen
  0 siblings, 1 reply; 2+ messages in thread
From: darshanrathod475 @ 2025-08-01 10:47 UTC (permalink / raw)
  To: platform-driver-x86
  Cc: stuart.w.hayes, hansg, ilpo.jarvinen, linux-kernel,
	Darshan Rathod

From: Darshan Rathod <darshanrathod475@gmail.com>

Refactor to remove assignments from inside if conditions, as required
by kernel coding style. This improves code readability and resolves
checkpatch.pl warnings:

    ERROR: do not use assignment in if condition

Signed-off-by: Darshan Rathod <darshanrathod475@gmail.com>
---
 drivers/platform/x86/dell/dell_rbu.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/platform/x86/dell/dell_rbu.c b/drivers/platform/x86/dell/dell_rbu.c
index 2a140d1c656a..403df9bd9522 100644
--- a/drivers/platform/x86/dell/dell_rbu.c
+++ b/drivers/platform/x86/dell/dell_rbu.c
@@ -232,7 +232,8 @@ static int packetize_data(const u8 *data, size_t length)
 			done = 1;
 		}
 
-		if ((rc = create_packet(temp, packet_length)))
+		rc = create_packet(temp, packet_length);
+		if (rc)
 			return rc;
 
 		pr_debug("%p:%td\n", temp, (end - temp));
@@ -276,7 +277,7 @@ static int do_packet_read(char *data, struct packet_data *newpacket,
 	return bytes_copied;
 }
 
-static int packet_read_list(char *data, size_t * pread_length)
+static int packet_read_list(char *data, size_t *pread_length)
 {
 	struct packet_data *newpacket;
 	int temp_count = 0;
@@ -445,7 +446,8 @@ static ssize_t read_packet_data(char *buffer, loff_t pos, size_t count)
 	bytes_left = rbu_data.imagesize - pos;
 	data_length = min(bytes_left, count);
 
-	if ((retval = packet_read_list(ptempBuf, &data_length)) < 0)
+	retval = packet_read_list(ptempBuf, &data_length);
+	if (retval < 0)
 		goto read_rbu_data_exit;
 
 	if ((pos + count) > rbu_data.imagesize) {
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] platform/x86: dell_rbu: fix assignment in if condition
  2025-08-01 10:47 [PATCH] platform/x86: dell_rbu: fix assignment in if condition darshanrathod475
@ 2025-08-11 12:55 ` Ilpo Järvinen
  0 siblings, 0 replies; 2+ messages in thread
From: Ilpo Järvinen @ 2025-08-11 12:55 UTC (permalink / raw)
  To: platform-driver-x86, darshanrathod475; +Cc: stuart.w.hayes, hansg, linux-kernel

On Fri, 01 Aug 2025 16:17:05 +0530, darshanrathod475@gmail.com wrote:

> Refactor to remove assignments from inside if conditions, as required
> by kernel coding style. This improves code readability and resolves
> checkpatch.pl warnings:
> 
>     ERROR: do not use assignment in if condition
> 
> 
> [...]


Thank you for your contribution, it has been applied to my local
review-ilpo-next branch. Note it will show up in the public
platform-drivers-x86/review-ilpo-next branch only once I've pushed my
local branch there, which might take a while.

The list of commits applied:
[1/1] platform/x86: dell_rbu: fix assignment in if condition
      commit: 1ccc2e20fe1d3b91395de8ca9ce0efe070287534

--
 i.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-08-11 12:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-01 10:47 [PATCH] platform/x86: dell_rbu: fix assignment in if condition darshanrathod475
2025-08-11 12:55 ` Ilpo Järvinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).