public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: pmcraid: Replace cpu_to_be64 + le64_to_cpu with swab64
@ 2025-12-10 14:33 Thorsten Blum
  2025-12-10 15:13 ` Christoph Hellwig
  0 siblings, 1 reply; 5+ messages in thread
From: Thorsten Blum @ 2025-12-10 14:33 UTC (permalink / raw)
  To: James E.J. Bottomley, Martin K. Petersen
  Cc: Thorsten Blum, linux-scsi, linux-kernel

Replace cpu_to_be64(le64_to_cpu()) with swab64() to simplify
pmcraid_prepare_cancel_cmd().

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 drivers/scsi/pmcraid.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c
index 33f403e307eb..68c2a10453fe 100644
--- a/drivers/scsi/pmcraid.c
+++ b/drivers/scsi/pmcraid.c
@@ -1213,7 +1213,7 @@ static void pmcraid_prepare_cancel_cmd(
 	 * cdb[2]..cdb[9] is Big-Endian format. Note that length bits in
 	 * IOARCB address are not masked.
 	 */
-	ioarcb_addr = cpu_to_be64(le64_to_cpu(cmd_to_cancel->ioa_cb->ioarcb.ioarcb_bus_addr));
+	ioarcb_addr = swab64(cmd_to_cancel->ioa_cb->ioarcb.ioarcb_bus_addr);
 
 	/* Get the resource handle to where the command to be aborted has been
 	 * sent.
-- 
Thorsten Blum <thorsten.blum@linux.dev>
GPG: 1D60 735E 8AEF 3BE4 73B6  9D84 7336 78FD 8DFE EAD4


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

* Re: [PATCH] scsi: pmcraid: Replace cpu_to_be64 + le64_to_cpu with swab64
  2025-12-10 14:33 [PATCH] scsi: pmcraid: Replace cpu_to_be64 + le64_to_cpu with swab64 Thorsten Blum
@ 2025-12-10 15:13 ` Christoph Hellwig
  2025-12-10 15:39   ` Thorsten Blum
  0 siblings, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2025-12-10 15:13 UTC (permalink / raw)
  To: Thorsten Blum
  Cc: James E.J. Bottomley, Martin K. Petersen, linux-scsi,
	linux-kernel

On Wed, Dec 10, 2025 at 03:33:21PM +0100, Thorsten Blum wrote:
> Replace cpu_to_be64(le64_to_cpu()) with swab64() to simplify
> pmcraid_prepare_cancel_cmd().

How does this not break the __le64/__be64 annotation checking?


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

* Re: [PATCH] scsi: pmcraid: Replace cpu_to_be64 + le64_to_cpu with swab64
  2025-12-10 15:13 ` Christoph Hellwig
@ 2025-12-10 15:39   ` Thorsten Blum
  2025-12-10 22:21     ` David Laight
  0 siblings, 1 reply; 5+ messages in thread
From: Thorsten Blum @ 2025-12-10 15:39 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: James E.J. Bottomley, Martin K. Petersen, linux-scsi,
	linux-kernel

On 10. Dec 2025, at 16:13, Christoph Hellwig wrote:
> On Wed, Dec 10, 2025 at 03:33:21PM +0100, Thorsten Blum wrote:
>> Replace cpu_to_be64(le64_to_cpu()) with swab64() to simplify
>> pmcraid_prepare_cancel_cmd().
> 
> How does this not break the __le64/__be64 annotation checking?

I'm not sure and didn't investigate, but it compiles without warnings.


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

* Re: [PATCH] scsi: pmcraid: Replace cpu_to_be64 + le64_to_cpu with swab64
  2025-12-10 15:39   ` Thorsten Blum
@ 2025-12-10 22:21     ` David Laight
  2025-12-10 22:45       ` Thorsten Blum
  0 siblings, 1 reply; 5+ messages in thread
From: David Laight @ 2025-12-10 22:21 UTC (permalink / raw)
  To: Thorsten Blum
  Cc: Christoph Hellwig, James E.J. Bottomley, Martin K. Petersen,
	linux-scsi, linux-kernel

On Wed, 10 Dec 2025 16:39:36 +0100
Thorsten Blum <thorsten.blum@linux.dev> wrote:

> On 10. Dec 2025, at 16:13, Christoph Hellwig wrote:
> > On Wed, Dec 10, 2025 at 03:33:21PM +0100, Thorsten Blum wrote:  
> >> Replace cpu_to_be64(le64_to_cpu()) with swab64() to simplify
> >> pmcraid_prepare_cancel_cmd().  
> > 
> > How does this not break the __le64/__be64 annotation checking?  
> 
> I'm not sure and didn't investigate, but it compiles without warnings.
> 
> 

You'd need to run sparse.

	David

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

* Re: [PATCH] scsi: pmcraid: Replace cpu_to_be64 + le64_to_cpu with swab64
  2025-12-10 22:21     ` David Laight
@ 2025-12-10 22:45       ` Thorsten Blum
  0 siblings, 0 replies; 5+ messages in thread
From: Thorsten Blum @ 2025-12-10 22:45 UTC (permalink / raw)
  To: David Laight
  Cc: Christoph Hellwig, James E.J. Bottomley, Martin K. Petersen,
	linux-scsi, linux-kernel

On 10. Dec 2025, at 23:21, David Laight wrote:
> 
> [...]
> 
> You'd need to run sparse.

I compiled it with C=1 and there are other, unrelated sparse warnings:

CC [M]  drivers/scsi/pmcraid.o
CHECK   drivers/scsi/pmcraid.c
drivers/scsi/pmcraid.c:73:1: error: bad constant expression
drivers/scsi/pmcraid.c:74:1: error: bad constant expression
drivers/scsi/pmcraid.c:75:1: error: bad constant expression
drivers/scsi/pmcraid.c:76:1: error: bad constant expression
drivers/scsi/pmcraid.c:78:1: error: bad constant expression
drivers/scsi/pmcraid.c:79:1: error: bad constant expression
drivers/scsi/pmcraid.c:84:1: error: bad constant expression
drivers/scsi/pmcraid.c:85:1: error: bad constant expression
drivers/scsi/pmcraid.c:89:1: error: bad constant expression
drivers/scsi/pmcraid.c:90:1: error: bad constant expression


Compiling with V=1 also confirms that sparse is running:

# CHECK   drivers/scsi/pmcraid.c
sparse -D__linux__ ... -D__KBUILD_MODNAME=pmcraid drivers/scsi/pmcraid.c


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

end of thread, other threads:[~2025-12-10 22:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-10 14:33 [PATCH] scsi: pmcraid: Replace cpu_to_be64 + le64_to_cpu with swab64 Thorsten Blum
2025-12-10 15:13 ` Christoph Hellwig
2025-12-10 15:39   ` Thorsten Blum
2025-12-10 22:21     ` David Laight
2025-12-10 22:45       ` Thorsten Blum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox