From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wolfgang Denk Date: Tue, 20 Dec 2016 18:30:00 +0100 Subject: [U-Boot] [PATCH] common: Fix logic in fpga programming In-Reply-To: <1e029d3a67722c20d8b6194d3388efe5ca92f5bf.1481881501.git.michal.simek@xilinx.com> References: <1e029d3a67722c20d8b6194d3388efe5ca92f5bf.1481881501.git.michal.simek@xilinx.com> Message-ID: <20161220173000.6D5E5100B38@atlas.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Michal... In message <1e029d3a67722c20d8b6194d3388efe5ca92f5bf.1481881501.git.michal.simek@xilinx.com> you wrote: > Stop boot process if fpga programming fails. > > Signed-off-by: Michal Simek > --- > > common/image.c | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) > > diff --git a/common/image.c b/common/image.c > index bd07e86701a4..e3486e46a459 100644 > --- a/common/image.c > +++ b/common/image.c > @@ -1375,11 +1375,10 @@ int boot_get_fpga(int argc, char * const argv[], bootm_headers_t *images, > img_len, BIT_PARTIAL); > } > > - printf(" Programming %s bitstream... ", name); > if (err) > - printf("failed\n"); > - else > - printf("OK\n"); > + return 1; > + > + printf(" Programming %s bitstream... OK", name); 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. Your change breaks this - in the error path nothing gets printed. This is even worse, as even though the system keeps running the user has no indication of what failed... I suggest to keep the printf() as before, and just fix the return code thing. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Anarchy may not be the best form of government, but it's better than no government at all.