[U-Boot] [PATCH] common: Fix logic in fpga programming

Michal Simek michal.simek at xilinx.com
Wed Dec 21 08:03:42 CET 2016


Dear Wolfgang,

On 21.12.2016 00:19, Wolfgang Denk wrote:
> Dear Michal,
> 
> In message <0e8b363f-f84f-cea2-7784-8cc10e1e751b at xilinx.com> you wrote:
>>
>>> Good old U-Boot style says we print a message when we start an
>>> operation, and then an OK / failed when done.  When the system crashes
>>> in this command, you can see at last where it crashed, i. e. what the
>>> last running command was.
>>
>> Based on this style the first part of this message should be called at
>> the beginning of this function not in this possition.
> 
> True,,,
> 
>> 255         if (ret) {
>> 256                 printf("FPGA image is corrupted or invalid\n");
>> 257                 return 1;
>> 258         }
>>
>> There is already printf for error.
> 
> Hm... Sorry, I did not follow all brachnes thrugh the code this i snot
> exactly obvious from the patch.

ok.

> 
>>> This is even worse, as even though the system keeps running the user
>>> has no indication of what failed...
>>
>> Isn't it message above enough?
> 
> In the patch, I see only a "return 1;".

Like in every patch which error out in the middle of function and return
0 at the end.
Please look at that function and you will see that at the end there is
return 0.

Thanks,
Michal


More information about the U-Boot mailing list