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