All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] scsi: qla1280: Resolve some compilation issues
@ 2021-08-19  9:32 John Garry
  2021-08-19  9:32 ` [PATCH v2 1/2] scsi: qla1280: Stop using scsi_cmnd.tag John Garry
  2021-08-19  9:32 ` [PATCH v2 2/2] scsi: qla1280: Fix DEBUG_QLA1280 compilation issues John Garry
  0 siblings, 2 replies; 7+ messages in thread
From: John Garry @ 2021-08-19  9:32 UTC (permalink / raw)
  To: mdr, jejb, martin.petersen
  Cc: linux-scsi, linux-kernel, bvanassche, hare, John Garry

As another follow-up to removing scsi_cmnd.tag in [0], remove its usage in
the qla1280 driver lurking under a local build switch. Also fix
pre-existing compilation issues under the same switch.

Based on mkp-scsi 5.15 staging at 848ade90ba9c

[0] https://lore.kernel.org/linux-scsi/yq14kbppa42.fsf@ca-mkp.ca.oracle.com/T/#mb47909f38f35837686734369600051b278d124af

Changes to v1:
- Make SCSI_LUN_32() cast to int

John Garry (2):
  scsi: qla1280: Stop using scsi_cmnd.tag
  scsi: qla1280: Fix DEBUG_QLA1280 compilation issues

 drivers/scsi/qla1280.c | 29 +++--------------------------
 1 file changed, 3 insertions(+), 26 deletions(-)

-- 
2.17.1


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

* [PATCH v2 1/2] scsi: qla1280: Stop using scsi_cmnd.tag
  2021-08-19  9:32 [PATCH v2 0/2] scsi: qla1280: Resolve some compilation issues John Garry
@ 2021-08-19  9:32 ` John Garry
  2021-08-19 10:38   ` Hannes Reinecke
  2021-08-19  9:32 ` [PATCH v2 2/2] scsi: qla1280: Fix DEBUG_QLA1280 compilation issues John Garry
  1 sibling, 1 reply; 7+ messages in thread
From: John Garry @ 2021-08-19  9:32 UTC (permalink / raw)
  To: mdr, jejb, martin.petersen
  Cc: linux-scsi, linux-kernel, bvanassche, hare, John Garry

Use scsi_cmd_to_rq(cmd)->tag instead of scsi_cmnd.tag as preference.

Signed-off-by: John Garry <john.garry@huawei.com>
---
 drivers/scsi/qla1280.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c
index aec92471c5f2..b4f7d8d7a01c 100644
--- a/drivers/scsi/qla1280.c
+++ b/drivers/scsi/qla1280.c
@@ -3980,7 +3980,7 @@ __qla1280_print_scsi_cmd(struct scsi_cmnd *cmd)
 	   qla1280_dump_buffer(1, (char *)sg, (cmd->use_sg*sizeof(struct scatterlist)));
 	   } */
 	printk("  tag=%d, transfersize=0x%x \n",
-	       cmd->tag, cmd->transfersize);
+	       scsi_cmd_to_rq(cmd)->tag, cmd->transfersize);
 	printk("  SP=0x%p\n", CMD_SP(cmd));
 	printk(" underflow size = 0x%x, direction=0x%x\n",
 	       cmd->underflow, cmd->sc_data_direction);
-- 
2.17.1


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

* [PATCH v2 2/2] scsi: qla1280: Fix DEBUG_QLA1280 compilation issues
  2021-08-19  9:32 [PATCH v2 0/2] scsi: qla1280: Resolve some compilation issues John Garry
  2021-08-19  9:32 ` [PATCH v2 1/2] scsi: qla1280: Stop using scsi_cmnd.tag John Garry
@ 2021-08-19  9:32 ` John Garry
  2021-08-19 10:39   ` Hannes Reinecke
  2021-08-19 18:07   ` Bart Van Assche
  1 sibling, 2 replies; 7+ messages in thread
From: John Garry @ 2021-08-19  9:32 UTC (permalink / raw)
  To: mdr, jejb, martin.petersen
  Cc: linux-scsi, linux-kernel, bvanassche, hare, John Garry

The driver does not compile under DEBUG_QLA1280 flag:
- Debug statements expect an integer for printing a SCSI lun value, but
  its size is 64b. So change SCSI_LUN_32() to cast to an int, as would be
  expected from a "_32" function.
- lower_32_bits() expects %x, as opposed to %lx, so fix that.

Also delete ql1280_dump_device(), which looks to have never been
referenced.

Signed-off-by: John Garry <john.garry@huawei.com>
---
 drivers/scsi/qla1280.c | 27 ++-------------------------
 1 file changed, 2 insertions(+), 25 deletions(-)

diff --git a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c
index b4f7d8d7a01c..9a7e84b49d41 100644
--- a/drivers/scsi/qla1280.c
+++ b/drivers/scsi/qla1280.c
@@ -494,7 +494,7 @@ __setup("qla1280=", qla1280_setup);
 #define CMD_HOST(Cmnd)		Cmnd->device->host
 #define SCSI_BUS_32(Cmnd)	Cmnd->device->channel
 #define SCSI_TCN_32(Cmnd)	Cmnd->device->id
-#define SCSI_LUN_32(Cmnd)	Cmnd->device->lun
+#define SCSI_LUN_32(Cmnd)	((int)Cmnd->device->lun)
 
 
 /*****************************************/
@@ -3126,7 +3126,7 @@ qla1280_32bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp)
 			*dword_ptr++ =
 				cpu_to_le32(lower_32_bits(sg_dma_address(s)));
 			*dword_ptr++ = cpu_to_le32(sg_dma_len(s));
-			dprintk(3, "S/G Segment phys_addr=0x%lx, len=0x%x\n",
+			dprintk(3, "S/G Segment phys_addr=0x%x, len=0x%x\n",
 				(lower_32_bits(sg_dma_address(s))),
 				(sg_dma_len(s)));
 			remseg--;
@@ -3985,29 +3985,6 @@ __qla1280_print_scsi_cmd(struct scsi_cmnd *cmd)
 	printk(" underflow size = 0x%x, direction=0x%x\n",
 	       cmd->underflow, cmd->sc_data_direction);
 }
-
-/**************************************************************************
- *   ql1280_dump_device
- *
- **************************************************************************/
-static void
-ql1280_dump_device(struct scsi_qla_host *ha)
-{
-
-	struct scsi_cmnd *cp;
-	struct srb *sp;
-	int i;
-
-	printk(KERN_DEBUG "Outstanding Commands on controller:\n");
-
-	for (i = 0; i < MAX_OUTSTANDING_COMMANDS; i++) {
-		if ((sp = ha->outstanding_cmds[i]) == NULL)
-			continue;
-		if ((cp = sp->cmd) == NULL)
-			continue;
-		qla1280_print_scsi_cmd(1, cp);
-	}
-}
 #endif
 
 
-- 
2.17.1


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

* Re: [PATCH v2 1/2] scsi: qla1280: Stop using scsi_cmnd.tag
  2021-08-19  9:32 ` [PATCH v2 1/2] scsi: qla1280: Stop using scsi_cmnd.tag John Garry
@ 2021-08-19 10:38   ` Hannes Reinecke
  0 siblings, 0 replies; 7+ messages in thread
From: Hannes Reinecke @ 2021-08-19 10:38 UTC (permalink / raw)
  To: John Garry, mdr, jejb, martin.petersen
  Cc: linux-scsi, linux-kernel, bvanassche

On 8/19/21 11:32 AM, John Garry wrote:
> Use scsi_cmd_to_rq(cmd)->tag instead of scsi_cmnd.tag as preference.
> 
> Signed-off-by: John Garry <john.garry@huawei.com>
> ---
>   drivers/scsi/qla1280.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c
> index aec92471c5f2..b4f7d8d7a01c 100644
> --- a/drivers/scsi/qla1280.c
> +++ b/drivers/scsi/qla1280.c
> @@ -3980,7 +3980,7 @@ __qla1280_print_scsi_cmd(struct scsi_cmnd *cmd)
>   	   qla1280_dump_buffer(1, (char *)sg, (cmd->use_sg*sizeof(struct scatterlist)));
>   	   } */
>   	printk("  tag=%d, transfersize=0x%x \n",
> -	       cmd->tag, cmd->transfersize);
> +	       scsi_cmd_to_rq(cmd)->tag, cmd->transfersize);
>   	printk("  SP=0x%p\n", CMD_SP(cmd));
>   	printk(" underflow size = 0x%x, direction=0x%x\n",
>   	       cmd->underflow, cmd->sc_data_direction);
> 
Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                Kernel Storage Architect
hare@suse.de                              +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer

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

* Re: [PATCH v2 2/2] scsi: qla1280: Fix DEBUG_QLA1280 compilation issues
  2021-08-19  9:32 ` [PATCH v2 2/2] scsi: qla1280: Fix DEBUG_QLA1280 compilation issues John Garry
@ 2021-08-19 10:39   ` Hannes Reinecke
  2021-08-19 18:07   ` Bart Van Assche
  1 sibling, 0 replies; 7+ messages in thread
From: Hannes Reinecke @ 2021-08-19 10:39 UTC (permalink / raw)
  To: John Garry, mdr, jejb, martin.petersen
  Cc: linux-scsi, linux-kernel, bvanassche

On 8/19/21 11:32 AM, John Garry wrote:
> The driver does not compile under DEBUG_QLA1280 flag:
> - Debug statements expect an integer for printing a SCSI lun value, but
>    its size is 64b. So change SCSI_LUN_32() to cast to an int, as would be
>    expected from a "_32" function.
> - lower_32_bits() expects %x, as opposed to %lx, so fix that.
> 
> Also delete ql1280_dump_device(), which looks to have never been
> referenced.
> 
> Signed-off-by: John Garry <john.garry@huawei.com>
> ---
>   drivers/scsi/qla1280.c | 27 ++-------------------------
>   1 file changed, 2 insertions(+), 25 deletions(-)
> 
Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                Kernel Storage Architect
hare@suse.de                              +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer

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

* Re: [PATCH v2 2/2] scsi: qla1280: Fix DEBUG_QLA1280 compilation issues
  2021-08-19  9:32 ` [PATCH v2 2/2] scsi: qla1280: Fix DEBUG_QLA1280 compilation issues John Garry
  2021-08-19 10:39   ` Hannes Reinecke
@ 2021-08-19 18:07   ` Bart Van Assche
  2021-08-19 19:24     ` James Bottomley
  1 sibling, 1 reply; 7+ messages in thread
From: Bart Van Assche @ 2021-08-19 18:07 UTC (permalink / raw)
  To: John Garry, mdr, jejb, martin.petersen; +Cc: linux-scsi, linux-kernel, hare

On 8/19/21 2:32 AM, John Garry wrote:
> The driver does not compile under DEBUG_QLA1280 flag:
> - Debug statements expect an integer for printing a SCSI lun value, but
>    its size is 64b. So change SCSI_LUN_32() to cast to an int, as would be
>    expected from a "_32" function.
> - lower_32_bits() expects %x, as opposed to %lx, so fix that.
> 
> Also delete ql1280_dump_device(), which looks to have never been
> referenced.
> 
> Signed-off-by: John Garry <john.garry@huawei.com>
> ---
>   drivers/scsi/qla1280.c | 27 ++-------------------------
>   1 file changed, 2 insertions(+), 25 deletions(-)
> 
> diff --git a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c
> index b4f7d8d7a01c..9a7e84b49d41 100644
> --- a/drivers/scsi/qla1280.c
> +++ b/drivers/scsi/qla1280.c
> @@ -494,7 +494,7 @@ __setup("qla1280=", qla1280_setup);
>   #define CMD_HOST(Cmnd)		Cmnd->device->host
>   #define SCSI_BUS_32(Cmnd)	Cmnd->device->channel
>   #define SCSI_TCN_32(Cmnd)	Cmnd->device->id
> -#define SCSI_LUN_32(Cmnd)	Cmnd->device->lun
> +#define SCSI_LUN_32(Cmnd)	((int)Cmnd->device->lun)

How about using 'unsigned int' instead of 'int' since LUN numbers are 
positive integers?

Thanks,

Bart.

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

* Re: [PATCH v2 2/2] scsi: qla1280: Fix DEBUG_QLA1280 compilation issues
  2021-08-19 18:07   ` Bart Van Assche
@ 2021-08-19 19:24     ` James Bottomley
  0 siblings, 0 replies; 7+ messages in thread
From: James Bottomley @ 2021-08-19 19:24 UTC (permalink / raw)
  To: Bart Van Assche, John Garry, mdr, martin.petersen
  Cc: linux-scsi, linux-kernel, hare

On Thu, 2021-08-19 at 11:07 -0700, Bart Van Assche wrote:
> On 8/19/21 2:32 AM, John Garry wrote:
> > The driver does not compile under DEBUG_QLA1280 flag:
> > - Debug statements expect an integer for printing a SCSI lun value,
> > but
> >    its size is 64b. So change SCSI_LUN_32() to cast to an int, as
> > would be
> >    expected from a "_32" function.
> > - lower_32_bits() expects %x, as opposed to %lx, so fix that.
> > 
> > Also delete ql1280_dump_device(), which looks to have never been
> > referenced.
> > 
> > Signed-off-by: John Garry <john.garry@huawei.com>
> > ---
> >   drivers/scsi/qla1280.c | 27 ++-------------------------
> >   1 file changed, 2 insertions(+), 25 deletions(-)
> > 
> > diff --git a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c
> > index b4f7d8d7a01c..9a7e84b49d41 100644
> > --- a/drivers/scsi/qla1280.c
> > +++ b/drivers/scsi/qla1280.c
> > @@ -494,7 +494,7 @@ __setup("qla1280=", qla1280_setup);
> >   #define CMD_HOST(Cmnd)		Cmnd->device->host
> >   #define SCSI_BUS_32(Cmnd)	Cmnd->device->channel
> >   #define SCSI_TCN_32(Cmnd)	Cmnd->device->id
> > -#define SCSI_LUN_32(Cmnd)	Cmnd->device->lun
> > +#define SCSI_LUN_32(Cmnd)	((int)Cmnd->device->lun)
> 
> How about using 'unsigned int' instead of 'int' since LUN numbers
> are positive integers?

All the use points in the driver are ints currently so matching the use
makes more sense than matching the standard and risking signed to
unsigned conversion warnings.

James



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

end of thread, other threads:[~2021-08-19 19:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-19  9:32 [PATCH v2 0/2] scsi: qla1280: Resolve some compilation issues John Garry
2021-08-19  9:32 ` [PATCH v2 1/2] scsi: qla1280: Stop using scsi_cmnd.tag John Garry
2021-08-19 10:38   ` Hannes Reinecke
2021-08-19  9:32 ` [PATCH v2 2/2] scsi: qla1280: Fix DEBUG_QLA1280 compilation issues John Garry
2021-08-19 10:39   ` Hannes Reinecke
2021-08-19 18:07   ` Bart Van Assche
2021-08-19 19:24     ` James Bottomley

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.