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

Caleb Connolly caleb.connolly at linaro.org
Mon Dec 9 17:55:11 CET 2024



On 09/12/2024 17:51, J. Neuschäfer wrote:
> 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 */

Hmm, haven't seen that one before. fwiw I think you can leave the
indentation as-is and just add the brackets.

Kind regards,
> 
> What do you think?
> 
> 
> -- jn

-- 
// Caleb (they/them)



More information about the U-Boot mailing list