linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] aha152x: Clean up struct scsi_pointer usage
@ 2022-02-21 23:09 Finn Thain
  2022-02-22  8:00 ` Christoph Hellwig
  0 siblings, 1 reply; 4+ messages in thread
From: Finn Thain @ 2022-02-21 23:09 UTC (permalink / raw)
  To: Juergen E. Fischer, James E.J. Bottomley, Martin K. Petersen
  Cc: linux-scsi, linux-kernel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1631 bytes --]

Bring aha152x into line with 10 other drivers which assign
scsi_host_template.cmd_size = sizeof(struct scsi_pointer)
and avoid the "struct foo { struct bar; };" silliness.

Remove a pointless scsi_pointer->have_data_in assignment.

Signed-off-by: Finn Thain <fthain@linux-m68k.org>
---
 drivers/scsi/aha152x.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c
index 34b2378075fd..70f49fba66be 100644
--- a/drivers/scsi/aha152x.c
+++ b/drivers/scsi/aha152x.c
@@ -316,15 +316,9 @@ enum {
 	check_condition = 0x0800,	/* requesting sense after CHECK CONDITION */
 };
 
-struct aha152x_cmd_priv {
-	struct scsi_pointer scsi_pointer;
-};
-
 static struct scsi_pointer *aha152x_scsi_pointer(struct scsi_cmnd *cmd)
 {
-	struct aha152x_cmd_priv *acmd = scsi_cmd_priv(cmd);
-
-	return &acmd->scsi_pointer;
+	return scsi_cmd_priv(cmd);
 }
 
 MODULE_AUTHOR("Jürgen Fischer");
@@ -931,7 +925,6 @@ static int aha152x_internal_queue(struct scsi_cmnd *SCpnt,
 	scsi_pointer->phase	   = not_issued | phase;
 	scsi_pointer->Status	   = 0x1; /* Ilegal status by SCSI standard */
 	scsi_pointer->Message	   = 0;
-	scsi_pointer->have_data_in = 0;
 	scsi_pointer->sent_command = 0;
 
 	if (scsi_pointer->phase & (resetting | check_condition)) {
@@ -2971,7 +2964,7 @@ static struct scsi_host_template aha152x_driver_template = {
 	.sg_tablesize			= SG_ALL,
 	.dma_boundary			= PAGE_SIZE - 1,
 	.slave_alloc			= aha152x_adjust_queue,
-	.cmd_size			= sizeof(struct aha152x_cmd_priv),
+	.cmd_size			= sizeof(struct scsi_pointer),
 };
 
 #if !defined(AHA152X_PCMCIA)
-- 
2.32.0


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

* Re: [PATCH] aha152x: Clean up struct scsi_pointer usage
  2022-02-21 23:09 [PATCH] aha152x: Clean up struct scsi_pointer usage Finn Thain
@ 2022-02-22  8:00 ` Christoph Hellwig
  2022-02-22 23:08   ` Finn Thain
  0 siblings, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2022-02-22  8:00 UTC (permalink / raw)
  To: Finn Thain
  Cc: Juergen E. Fischer, James E.J. Bottomley, Martin K. Petersen,
	linux-scsi, linux-kernel

On Tue, Feb 22, 2022 at 10:09:42AM +1100, Finn Thain wrote:
> Bring aha152x into line with 10 other drivers which assign
> scsi_host_template.cmd_size = sizeof(struct scsi_pointer)
> and avoid the "struct foo { struct bar; };" silliness.
> 
> Remove a pointless scsi_pointer->have_data_in assignment.

I think this going in the wrong direction.  The scsi_pointer should
go away entirelym and the fields actually used by the driver should move
into the aha152x_cmd_priv structure instead.

Same for all other drivers still using the scsi_pointer.

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

* Re: [PATCH] aha152x: Clean up struct scsi_pointer usage
  2022-02-22  8:00 ` Christoph Hellwig
@ 2022-02-22 23:08   ` Finn Thain
  2022-02-23  6:30     ` Christoph Hellwig
  0 siblings, 1 reply; 4+ messages in thread
From: Finn Thain @ 2022-02-22 23:08 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Juergen E. Fischer, James E.J. Bottomley, Martin K. Petersen,
	linux-scsi, linux-kernel

Hi Christoph,

On Tue, 22 Feb 2022, Christoph Hellwig wrote:

> On Tue, Feb 22, 2022 at 10:09:42AM +1100, Finn Thain wrote:
> > Bring aha152x into line with 10 other drivers which assign
> > scsi_host_template.cmd_size = sizeof(struct scsi_pointer)
> > and avoid the "struct foo { struct bar; };" silliness.
> > 
> > Remove a pointless scsi_pointer->have_data_in assignment.
> 
> I think this going in the wrong direction.  The scsi_pointer should go 
> away entirelym and the fields actually used by the driver should move 
> into the aha152x_cmd_priv structure instead.
> 
> Same for all other drivers still using the scsi_pointer.
> 

This patch is addressing an inconsistency in the patches already accepted 
into 5.18/scsi-staging in Martin's repo.

A number of Bart's patches had the same effect as the patch you're 
objecting to here. Hence,

$ git grep "cmd_size.*scsi_pointer"
drivers/scsi/a2091.c:               .cmd_size = sizeof(struct scsi_pointer),
drivers/scsi/a3000.c:	            .cmd_size = sizeof(struct scsi_pointer),
drivers/scsi/fdomain.c:             .cmd_size = sizeof(struct scsi_pointer),
drivers/scsi/gvp11.c:	            .cmd_size = sizeof(struct scsi_pointer),
drivers/scsi/imm.c:                 .cmd_size = sizeof(struct scsi_pointer),
drivers/scsi/mvme147.c:             .cmd_size = sizeof(struct scsi_pointer),
drivers/scsi/pcmcia/nsp_cs.c:       .cmd_size = sizeof(struct scsi_pointer),
drivers/scsi/pcmcia/sym53c500_cs.c: .cmd_size = sizeof(struct scsi_pointer),
drivers/scsi/ppa.c:                 .cmd_size = sizeof(struct scsi_pointer),
drivers/scsi/sgiwd93.c:             .cmd_size = sizeof(struct scsi_pointer),

Since that series was very popular with reviewers, and being that this 
patch is just more of the same, I have no idea as to how to proceed.

Are you asking me to rework Bart's series? Or are you asking Martin to 
drop it, or both, or neither...

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

* Re: [PATCH] aha152x: Clean up struct scsi_pointer usage
  2022-02-22 23:08   ` Finn Thain
@ 2022-02-23  6:30     ` Christoph Hellwig
  0 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2022-02-23  6:30 UTC (permalink / raw)
  To: Finn Thain
  Cc: Christoph Hellwig, Juergen E. Fischer, James E.J. Bottomley,
	Martin K. Petersen, linux-scsi, linux-kernel

On Wed, Feb 23, 2022 at 10:08:08AM +1100, Finn Thain wrote:
> Are you asking me to rework Bart's series? Or are you asking Martin to 
> drop it, or both, or neither...

Neither.  Either leave the as-far as I can tell harmless inconsistency
as-is, or if you want to fix it up send a patch that removes the usage
of scsi_pointer in aha152x entirely by adding the actually used members
to the private structure.

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

end of thread, other threads:[~2022-02-23  6:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-21 23:09 [PATCH] aha152x: Clean up struct scsi_pointer usage Finn Thain
2022-02-22  8:00 ` Christoph Hellwig
2022-02-22 23:08   ` Finn Thain
2022-02-23  6:30     ` Christoph Hellwig

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