diff mbox series

cxl/pci: Drop shadowed variable

Message ID 164944636936.455177.14136200464724208233.stgit@dwillia2-desk3.amr.corp.intel.com
State Accepted
Commit d28820419ca332f856cdf8bef0cafed79c29ed05
Headers show
Series cxl/pci: Drop shadowed variable | expand

Commit Message

Dan Williams April 8, 2022, 7:32 p.m. UTC
0day notices that wait_for_media_ready() declares an @rc variable twice.


>> drivers/cxl/pci.c:439:7: warning: Local variable 'rc' shadows outer variable [shadowVariable]
     int rc;
         ^
   drivers/cxl/pci.c:431:6: note: Shadowed declaration
    int rc, i;
        ^
   drivers/cxl/pci.c:439:7: note: Shadow variable
     int rc;
         ^

Cc: Randy Dunlap <rdunlap@infradead.org>
Fixes: 523e594d9cc0 ("cxl/pci: Implement wait for media active")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 drivers/cxl/pci.c |    1 -
 1 file changed, 1 deletion(-)

Comments

Verma, Vishal L April 8, 2022, 7:39 p.m. UTC | #1
On Fri, 2022-04-08 at 12:32 -0700, Dan Williams wrote:
> 0day notices that wait_for_media_ready() declares an @rc variable twice.

s/notices/noticed/ ?

Other than that, looks good.

Reviewed-by: Vishal Verma <vishal.l.verma@intel.com>

> 
> > > drivers/cxl/pci.c:439:7: warning: Local variable 'rc' shadows outer variable [shadowVariable]
>      int rc;
>          ^
>    drivers/cxl/pci.c:431:6: note: Shadowed declaration
>     int rc, i;
>         ^
>    drivers/cxl/pci.c:439:7: note: Shadow variable
>      int rc;
>          ^
> 
> Cc: Randy Dunlap <rdunlap@infradead.org>
> Fixes: 523e594d9cc0 ("cxl/pci: Implement wait for media active")
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
> ---
>  drivers/cxl/pci.c |    1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/cxl/pci.c b/drivers/cxl/pci.c
> index 077ea064bddd..e7ab9a34d718 100644
> --- a/drivers/cxl/pci.c
> +++ b/drivers/cxl/pci.c
> @@ -437,7 +437,6 @@ static int wait_for_media_ready(struct cxl_dev_state *cxlds)
>  
>         for (i = mbox_ready_timeout; i; i--) {
>                 u32 temp;
> -               int rc;
>  
>                 rc = pci_read_config_dword(
>                         pdev, d + CXL_DVSEC_RANGE_SIZE_LOW(0), &temp);
>
Randy Dunlap April 8, 2022, 8:39 p.m. UTC | #2
On 4/8/22 12:39, Verma, Vishal L wrote:
> On Fri, 2022-04-08 at 12:32 -0700, Dan Williams wrote:
>> 0day notices that wait_for_media_ready() declares an @rc variable twice.
> 
> s/notices/noticed/ ?
> 
> Other than that, looks good.
> 
> Reviewed-by: Vishal Verma <vishal.l.verma@intel.com>
> 
>>
>>>> drivers/cxl/pci.c:439:7: warning: Local variable 'rc' shadows outer variable [shadowVariable]
>>      int rc;
>>          ^
>>    drivers/cxl/pci.c:431:6: note: Shadowed declaration
>>     int rc, i;
>>         ^
>>    drivers/cxl/pci.c:439:7: note: Shadow variable
>>      int rc;
>>          ^
>>
>> Cc: Randy Dunlap <rdunlap@infradead.org>
>> Fixes: 523e594d9cc0 ("cxl/pci: Implement wait for media active")
>> Reported-by: kernel test robot <lkp@intel.com>
>> Signed-off-by: Dan Williams <dan.j.williams@intel.com>

Acked-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>


Thanks.

>> ---
>>  drivers/cxl/pci.c |    1 -
>>  1 file changed, 1 deletion(-)
>>
>> diff --git a/drivers/cxl/pci.c b/drivers/cxl/pci.c
>> index 077ea064bddd..e7ab9a34d718 100644
>> --- a/drivers/cxl/pci.c
>> +++ b/drivers/cxl/pci.c
>> @@ -437,7 +437,6 @@ static int wait_for_media_ready(struct cxl_dev_state *cxlds)
>>  
>>         for (i = mbox_ready_timeout; i; i--) {
>>                 u32 temp;
>> -               int rc;
>>  
>>                 rc = pci_read_config_dword(
>>                         pdev, d + CXL_DVSEC_RANGE_SIZE_LOW(0), &temp);
>>
>
diff mbox series

Patch

diff --git a/drivers/cxl/pci.c b/drivers/cxl/pci.c
index 077ea064bddd..e7ab9a34d718 100644
--- a/drivers/cxl/pci.c
+++ b/drivers/cxl/pci.c
@@ -437,7 +437,6 @@  static int wait_for_media_ready(struct cxl_dev_state *cxlds)
 
 	for (i = mbox_ready_timeout; i; i--) {
 		u32 temp;
-		int rc;
 
 		rc = pci_read_config_dword(
 			pdev, d + CXL_DVSEC_RANGE_SIZE_LOW(0), &temp);