* [PATCH -next] advansys: remove set but not used variable 'srb_tag' in adv_isr_callback
@ 2018-10-17 12:34 YueHaibing
2018-10-17 12:49 ` Johannes Thumshirn
2018-10-18 1:02 ` Martin K. Petersen
0 siblings, 2 replies; 5+ messages in thread
From: YueHaibing @ 2018-10-17 12:34 UTC (permalink / raw)
To: willy, hare, jejb, martin.petersen; +Cc: linux-kernel, linux-scsi, YueHaibing
drivers/scsi/advansys.c: In function 'adv_isr_callback':
drivers/scsi/advansys.c:5952:6: warning:
variable 'srb_tag' set but not used [-Wunused-but-set-variable]
It never used since introduction in
commit 9c17c62aedb0 ("advansys: use shared host tag map for command lookup")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
drivers/scsi/advansys.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c
index 44c9619..223ef6f 100644
--- a/drivers/scsi/advansys.c
+++ b/drivers/scsi/advansys.c
@@ -5949,7 +5949,6 @@ static void adv_async_callback(ADV_DVC_VAR *adv_dvc_varp, uchar code)
static void adv_isr_callback(ADV_DVC_VAR *adv_dvc_varp, ADV_SCSI_REQ_Q *scsiqp)
{
struct asc_board *boardp = adv_dvc_varp->drv_ptr;
- u32 srb_tag;
adv_req_t *reqp;
adv_sgblk_t *sgblkp;
struct scsi_cmnd *scp;
@@ -5965,7 +5964,6 @@ static void adv_isr_callback(ADV_DVC_VAR *adv_dvc_varp, ADV_SCSI_REQ_Q *scsiqp)
* completed. The adv_req_t structure actually contains the
* completed ADV_SCSI_REQ_Q structure.
*/
- srb_tag = le32_to_cpu(scsiqp->srb_tag);
scp = scsi_host_find_tag(boardp->shost, scsiqp->srb_tag);
ASC_DBG(1, "scp 0x%p\n", scp);
--
2.7.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH -next] advansys: remove set but not used variable 'srb_tag' in adv_isr_callback
2018-10-17 12:34 [PATCH -next] advansys: remove set but not used variable 'srb_tag' in adv_isr_callback YueHaibing
@ 2018-10-17 12:49 ` Johannes Thumshirn
2018-10-17 13:00 ` Matthew Wilcox
2018-10-18 1:02 ` Martin K. Petersen
1 sibling, 1 reply; 5+ messages in thread
From: Johannes Thumshirn @ 2018-10-17 12:49 UTC (permalink / raw)
To: YueHaibing, willy, hare, jejb, martin.petersen; +Cc: linux-kernel, linux-scsi
On 17/10/18 14:34, YueHaibing wrote:
> drivers/scsi/advansys.c: In function 'adv_isr_callback':
> drivers/scsi/advansys.c:5952:6: warning:
> variable 'srb_tag' set but not used [-Wunused-but-set-variable]
>
> It never used since introduction in
> commit 9c17c62aedb0 ("advansys: use shared host tag map for command lookup")
>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
> drivers/scsi/advansys.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c
> index 44c9619..223ef6f 100644
> --- a/drivers/scsi/advansys.c
> +++ b/drivers/scsi/advansys.c
> @@ -5949,7 +5949,6 @@ static void adv_async_callback(ADV_DVC_VAR *adv_dvc_varp, uchar code)
> static void adv_isr_callback(ADV_DVC_VAR *adv_dvc_varp, ADV_SCSI_REQ_Q *scsiqp)
> {
> struct asc_board *boardp = adv_dvc_varp->drv_ptr;
> - u32 srb_tag;
> adv_req_t *reqp;
> adv_sgblk_t *sgblkp;
> struct scsi_cmnd *scp;
> @@ -5965,7 +5964,6 @@ static void adv_isr_callback(ADV_DVC_VAR *adv_dvc_varp, ADV_SCSI_REQ_Q *scsiqp)
> * completed. The adv_req_t structure actually contains the
> * completed ADV_SCSI_REQ_Q structure.
> */
> - srb_tag = le32_to_cpu(scsiqp->srb_tag);
> scp = scsi_host_find_tag(boardp->shost, scsiqp->srb_tag);
Shouldn't this be:
scp = scsi_host_find_tag(boardp->shost,
le32_to_cpu(scsiqp->srb_tag));
--
Johannes Thumshirn SUSE Labs
jthumshirn@suse.de +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH -next] advansys: remove set but not used variable 'srb_tag' in adv_isr_callback
2018-10-17 12:49 ` Johannes Thumshirn
@ 2018-10-17 13:00 ` Matthew Wilcox
2018-10-17 13:04 ` Johannes Thumshirn
0 siblings, 1 reply; 5+ messages in thread
From: Matthew Wilcox @ 2018-10-17 13:00 UTC (permalink / raw)
To: Johannes Thumshirn
Cc: YueHaibing, hare, jejb, martin.petersen, linux-kernel, linux-scsi
On Wed, Oct 17, 2018 at 02:49:50PM +0200, Johannes Thumshirn wrote:
> On 17/10/18 14:34, YueHaibing wrote:
> > - srb_tag = le32_to_cpu(scsiqp->srb_tag);
> > scp = scsi_host_find_tag(boardp->shost, scsiqp->srb_tag);
>
> Shouldn't this be:
> scp = scsi_host_find_tag(boardp->shost,
> le32_to_cpu(scsiqp->srb_tag));
I don't think so. Look at how scsiqp->srb_tag is set:
adv_build_req(struct asc_board *boardp, struct scsi_cmnd *scp,
ADV_SCSI_REQ_Q **adv_scsiqpp)
{
+ u32 srb_tag = scp->request->tag;
...
+ scsiqp->srb_tag = srb_tag;
If we're not converting it to le32 on the way in, we probably don't want
to convert it back on the way out.
Please don't make me power up my PA-RISC machine with an Advansys card
in it, just to find out ...
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH -next] advansys: remove set but not used variable 'srb_tag' in adv_isr_callback
2018-10-17 13:00 ` Matthew Wilcox
@ 2018-10-17 13:04 ` Johannes Thumshirn
0 siblings, 0 replies; 5+ messages in thread
From: Johannes Thumshirn @ 2018-10-17 13:04 UTC (permalink / raw)
To: Matthew Wilcox
Cc: YueHaibing, hare, jejb, martin.petersen, linux-kernel, linux-scsi
On 17/10/18 15:00, Matthew Wilcox wrote:
> On Wed, Oct 17, 2018 at 02:49:50PM +0200, Johannes Thumshirn wrote:
>> On 17/10/18 14:34, YueHaibing wrote:
>>> - srb_tag = le32_to_cpu(scsiqp->srb_tag);
>>> scp = scsi_host_find_tag(boardp->shost, scsiqp->srb_tag);
>>
>> Shouldn't this be:
>> scp = scsi_host_find_tag(boardp->shost,
>> le32_to_cpu(scsiqp->srb_tag));
>
> I don't think so. Look at how scsiqp->srb_tag is set:
>
> adv_build_req(struct asc_board *boardp, struct scsi_cmnd *scp,
> ADV_SCSI_REQ_Q **adv_scsiqpp)
> {
> + u32 srb_tag = scp->request->tag;
> ...
> + scsiqp->srb_tag = srb_tag;
>
> If we're not converting it to le32 on the way in, we probably don't want
> to convert it back on the way out.
Yeah right, didn't check the submission path. It was just the removed
srb_tag = le32_to_cpu(scsiqp->srb_tag);
that triggered here.
> Please don't make me power up my PA-RISC machine with an Advansys card
> in it, just to find out ...
Now that your saying it...
--
Johannes Thumshirn SUSE Labs
jthumshirn@suse.de +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH -next] advansys: remove set but not used variable 'srb_tag' in adv_isr_callback
2018-10-17 12:34 [PATCH -next] advansys: remove set but not used variable 'srb_tag' in adv_isr_callback YueHaibing
2018-10-17 12:49 ` Johannes Thumshirn
@ 2018-10-18 1:02 ` Martin K. Petersen
1 sibling, 0 replies; 5+ messages in thread
From: Martin K. Petersen @ 2018-10-18 1:02 UTC (permalink / raw)
To: YueHaibing; +Cc: willy, hare, jejb, martin.petersen, linux-kernel, linux-scsi
YueHaibing,
> drivers/scsi/advansys.c: In function 'adv_isr_callback':
> drivers/scsi/advansys.c:5952:6: warning:
> variable 'srb_tag' set but not used [-Wunused-but-set-variable]
>
> It never used since introduction in
> commit 9c17c62aedb0 ("advansys: use shared host tag map for command lookup")
Applied to 4.20/scsi-queue. Thanks!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-10-18 1:03 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-17 12:34 [PATCH -next] advansys: remove set but not used variable 'srb_tag' in adv_isr_callback YueHaibing
2018-10-17 12:49 ` Johannes Thumshirn
2018-10-17 13:00 ` Matthew Wilcox
2018-10-17 13:04 ` Johannes Thumshirn
2018-10-18 1:02 ` 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).