linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi/arm: Clean up coding style violations
@ 2025-11-07 12:34 Darshan Rathod
  2025-11-07 12:38 ` Russell King (Oracle)
  0 siblings, 1 reply; 3+ messages in thread
From: Darshan Rathod @ 2025-11-07 12:34 UTC (permalink / raw)
  To: linux, James.Bottomley, martin.petersen
  Cc: linux-arm-kernel, linux-scsi, linux-kernel, Darshan Rathod

Addressed checkpatch warnings by separating assignment from a conditional
statement and documenting the empty for loop. These updates improve code
clarity and maintain style consistency.

No functional change intended.

Signed-off-by: Darshan Rathod <darshanrathod475@gmail.com>
---
 drivers/scsi/arm/msgqueue.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/arm/msgqueue.c b/drivers/scsi/arm/msgqueue.c
index 58115831362f..7e09624e5505 100644
--- a/drivers/scsi/arm/msgqueue.c
+++ b/drivers/scsi/arm/msgqueue.c
@@ -23,7 +23,8 @@ static struct msgqueue_entry *mqe_alloc(MsgQueue_t *msgq)
 {
 	struct msgqueue_entry *mq;
 
-	if ((mq = msgq->free) != NULL)
+	mq = msgq->free;
+	if (mq)
 		msgq->free = mq->next;
 
 	return mq;
@@ -99,7 +100,8 @@ struct message *msgqueue_getmsg(MsgQueue_t *msgq, int msgno)
 {
 	struct msgqueue_entry *mq;
 
-	for (mq = msgq->qe; mq && msgno; mq = mq->next, msgno--);
+	for (mq = msgq->qe; mq && msgno; mq = mq->next, msgno--)
+		; /* intentional: iterate to the msgno-th entry */
 
 	return mq ? &mq->msg : NULL;
 }
-- 
2.43.0



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

* Re: [PATCH] scsi/arm: Clean up coding style violations
  2025-11-07 12:34 [PATCH] scsi/arm: Clean up coding style violations Darshan Rathod
@ 2025-11-07 12:38 ` Russell King (Oracle)
  2025-11-08 17:33   ` Martin K. Petersen
  0 siblings, 1 reply; 3+ messages in thread
From: Russell King (Oracle) @ 2025-11-07 12:38 UTC (permalink / raw)
  To: Darshan Rathod
  Cc: James.Bottomley, martin.petersen, linux-arm-kernel, linux-scsi,
	linux-kernel

On Fri, Nov 07, 2025 at 12:34:34PM +0000, Darshan Rathod wrote:
> Addressed checkpatch warnings by separating assignment from a conditional
> statement and documenting the empty for loop. These updates improve code
> clarity and maintain style consistency.
> 
> No functional change intended.
> 
> Signed-off-by: Darshan Rathod <darshanrathod475@gmail.com>

Up to the SCSI maintainers, but this code pre-dates many of the coding
style updates, and I believe there is a general policy not to "fix"
old code for such things. It creates noise and additional churn.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!


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

* Re: [PATCH] scsi/arm: Clean up coding style violations
  2025-11-07 12:38 ` Russell King (Oracle)
@ 2025-11-08 17:33   ` Martin K. Petersen
  0 siblings, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2025-11-08 17:33 UTC (permalink / raw)
  To: Russell King (Oracle)
  Cc: Darshan Rathod, James.Bottomley, martin.petersen,
	linux-arm-kernel, linux-scsi, linux-kernel


Russell,

> Up to the SCSI maintainers, but this code pre-dates many of the coding
> style updates, and I believe there is a general policy not to "fix"
> old code for such things. It creates noise and additional churn.

Correct. checkpatch is for validating *new* code.

-- 
Martin K. Petersen


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

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

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-07 12:34 [PATCH] scsi/arm: Clean up coding style violations Darshan Rathod
2025-11-07 12:38 ` Russell King (Oracle)
2025-11-08 17:33   ` Martin K. Petersen

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).