mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] scsi: a100u2w: remove useless variable
@ 2021-04-12  3:22 Jiapeng Chong
  2021-04-17  6:34 ` Julian Calaby
  0 siblings, 1 reply; 3+ messages in thread
From: Jiapeng Chong @ 2021-04-12  3:22 UTC (permalink / raw)
  To: jejb; +Cc: martin.petersen, linux-scsi, linux-kernel, Jiapeng Chong

Fix the following gcc warning:

drivers/scsi/a100u2w.c:1092:8: warning: variable ‘bios_phys’ set but not
used [-Wunused-but-set-variable].

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 drivers/scsi/a100u2w.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/scsi/a100u2w.c b/drivers/scsi/a100u2w.c
index 66c5143..855a3fe 100644
--- a/drivers/scsi/a100u2w.c
+++ b/drivers/scsi/a100u2w.c
@@ -1089,7 +1089,6 @@ static int inia100_probe_one(struct pci_dev *pdev,
 	int error = -ENODEV;
 	u32 sz;
 	unsigned long biosaddr;
-	char *bios_phys;
 
 	if (pci_enable_device(pdev))
 		goto out;
@@ -1141,7 +1140,7 @@ static int inia100_probe_one(struct pci_dev *pdev,
 
 	biosaddr = host->BIOScfg;
 	biosaddr = (biosaddr << 4);
-	bios_phys = phys_to_virt(biosaddr);
+	phys_to_virt(biosaddr);
 	if (init_orchid(host)) {	/* Initialize orchid chip */
 		printk("inia100: initial orchid fail!!\n");
 		goto out_free_escb_array;
-- 
1.8.3.1


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

* Re: [PATCH] scsi: a100u2w: remove useless variable
  2021-04-12  3:22 [PATCH] scsi: a100u2w: remove useless variable Jiapeng Chong
@ 2021-04-17  6:34 ` Julian Calaby
  2021-04-21  2:16   ` 种嘉鹏
  0 siblings, 1 reply; 3+ messages in thread
From: Julian Calaby @ 2021-04-17  6:34 UTC (permalink / raw)
  To: Jiapeng Chong
  Cc: James E. J. Bottomley, Martin K. Petersen, Linux SCSI List, LKML

Hi Jiapeng,

On Mon, Apr 12, 2021 at 1:23 PM Jiapeng Chong
<jiapeng.chong@linux.alibaba.com> wrote:
>
> Fix the following gcc warning:
>
> drivers/scsi/a100u2w.c:1092:8: warning: variable ‘bios_phys’ set but not
> used [-Wunused-but-set-variable].
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> ---
>  drivers/scsi/a100u2w.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/scsi/a100u2w.c b/drivers/scsi/a100u2w.c
> index 66c5143..855a3fe 100644
> --- a/drivers/scsi/a100u2w.c
> +++ b/drivers/scsi/a100u2w.c
> @@ -1089,7 +1089,6 @@ static int inia100_probe_one(struct pci_dev *pdev,
>         int error = -ENODEV;
>         u32 sz;
>         unsigned long biosaddr;
> -       char *bios_phys;
>
>         if (pci_enable_device(pdev))
>                 goto out;
> @@ -1141,7 +1140,7 @@ static int inia100_probe_one(struct pci_dev *pdev,
>
>         biosaddr = host->BIOScfg;
>         biosaddr = (biosaddr << 4);
> -       bios_phys = phys_to_virt(biosaddr);
> +       phys_to_virt(biosaddr);

Does phys_to_virt() have side effects? If it doesn't, there's a lot
more stuff that can get deleted here.

Thanks,

-- 
Julian Calaby

Email: julian.calaby@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/

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

* Re: [PATCH] scsi: a100u2w: remove useless variable
  2021-04-17  6:34 ` Julian Calaby
@ 2021-04-21  2:16   ` 种嘉鹏
  0 siblings, 0 replies; 3+ messages in thread
From: 种嘉鹏 @ 2021-04-21  2:16 UTC (permalink / raw)
  To: Julian Calaby; +Cc: linux-scsi, linux-kernel

On 2021/4/17 14:34, Julian Calaby wrote:
> Hi Jiapeng,
> 
> On Mon, Apr 12, 2021 at 1:23 PM Jiapeng Chong
> <jiapeng.chong@linux.alibaba.com> wrote:
>>
>> Fix the following gcc warning:
>>
>> drivers/scsi/a100u2w.c:1092:8: warning: variable ‘bios_phys’ set but not
>> used [-Wunused-but-set-variable].
>>
>> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
>> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
>> ---
>>   drivers/scsi/a100u2w.c | 3 +--
>>   1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/drivers/scsi/a100u2w.c b/drivers/scsi/a100u2w.c
>> index 66c5143..855a3fe 100644
>> --- a/drivers/scsi/a100u2w.c
>> +++ b/drivers/scsi/a100u2w.c
>> @@ -1089,7 +1089,6 @@ static int inia100_probe_one(struct pci_dev *pdev,
>>          int error = -ENODEV;
>>          u32 sz;
>>          unsigned long biosaddr;
>> -       char *bios_phys;
>>
>>          if (pci_enable_device(pdev))
>>                  goto out;
>> @@ -1141,7 +1140,7 @@ static int inia100_probe_one(struct pci_dev *pdev,
>>
>>          biosaddr = host->BIOScfg;
>>          biosaddr = (biosaddr << 4);
>> -       bios_phys = phys_to_virt(biosaddr);
>> +       phys_to_virt(biosaddr);
> 
> Does phys_to_virt() have side effects? If it doesn't, there's a lot
> more stuff that can get deleted here.
> 
> Thanks,
> 
OK, I'll delete phys_to_virt() and send V2.

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

end of thread, other threads:[~2021-04-21  2:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-12  3:22 [PATCH] scsi: a100u2w: remove useless variable Jiapeng Chong
2021-04-17  6:34 ` Julian Calaby
2021-04-21  2:16   ` 种嘉鹏

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

all inboxes | Powered by JetHome®