[PATCH 2/3] cmd: Allow building ufetch without CONFIG_BLK

J. Neuschäfer j.ne at posteo.net
Mon Dec 9 17:51:52 CET 2024


On Mon, Dec 09, 2024 at 04:04:50PM +0100, Caleb Connolly wrote:
> On 05/12/2024 19:35, J. Neuschäfer via B4 Relay wrote:
> > From: "J. Neuschäfer" <j.ne at posteo.net>
> > 
> > The ufetch command is still quite useful on systems without block
> > device support; remove the CONFIG_BLK dependency and make sure the code
> > compiles/works with and without CONFIG_BLK.
> > 
> > Signed-off-by: J. Neuschäfer <j.ne at posteo.net>
> 
> Small nit below, but with that:
> 
> Reviewed-by: Caleb Connolly <caleb.connolly at linaro.org>
> > ---
[...]
> >  		default:
> > +#ifdef CONFIG_BLK
> > +			struct udevice *dev;
> 
> At least without the #ifdef, I see a warning "A label followed by a
> declaration is a C23 extension".

Ah, I wondered about this. Apparently I have a compiler that uses C23 as
the default, so I didn't see the warning. I'll fix it in the next revision.

> So to be on the safe side please put this section in a block:
> 
> 		default: {

An alternative that I prefer because it's a bit less intrusive with
regards to indentation, is to use a semicolon:

		default:;
			/* code with the same indentation as usual */
			/* and no closing brace to remember */

What do you think?


-- jn


More information about the U-Boot mailing list