Re: [PATCH v3 4/4] p2sb: Do not scan and remove the P2SB device when it is unhidden

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Nov 27, 2024 / 10:55, Hans de Goede wrote:
> Hi,
> 
> Seems I was a bit too quick with reviewing at a second
> look I have found a small issue with this patch.
> 
> See my comment below.
> 
> On 27-Nov-24 7:00 AM, Shin'ichiro Kawasaki wrote:
[...]
> > @@ -167,7 +163,12 @@ static int p2sb_cache_resources(void)
> >  	pci_bus_read_config_dword(bus, devfn_p2sb, P2SBC, &value);
> >  	p2sb_hidden_by_bios = value & P2SBC_HIDE;
> >  
> > -	ret = p2sb_scan_and_cache(bus, devfn_p2sb);
> > +	/*
> > +	 * If the BIOS does not hide the P2SB device then its resources
> > +	 * are accesilble. Cache them only if the P2SB device is hidden.
> > +	 */
> > +	if (p2sb_hidden_by_bios)
> > +		ret = p2sb_scan_and_cache(bus, devfn_p2sb);
> 
> ret will be returned uninitialized now when p2sb_hidden_by_bios is false,
> so this patch also needs to initialize ret to 0 when declaring it.

Ah, right. Will fix it in v4. I compile tested with KCFLAGS=-Wall and expected
it would catch such mistakes, but it didn't. I found that -Wmaybe-uninitialized
does the check. Will use this check for my future patches.

> 
> With this fixed you can keep my Reviewed-by.

Thanks! Will send out v4 soon.




[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux