[flashrom] [PATCH] remove exit calls from sp_docommand
Stefan Tauner
stefan.tauner at student.tuwien.ac.at
Mon Jul 30 22:16:44 CEST 2012
On Wed, 6 Jun 2012 10:18:00 +0200
Niklas Söderlund <niso at kth.se> wrote:
> @@ -491,7 +499,8 @@ int serprog_init(void)
> the programmer to tell us its limits, but if it doesn't, we
> will assume stuff, so it's in the programmers best interest
> to tell us. */
> - sp_docommand(S_CMD_S_BUSTYPE, 1, &bt, 0, NULL);
> + if (sp_docommand(S_CMD_S_BUSTYPE, 1, &bt, 0, NULL))
> + return 1;
> if (!sp_docommand(S_CMD_Q_WRNMAXLEN, 0, NULL, 3, rbuf)) {
> uint32_t v;
> v = ((unsigned int)(rbuf[0]) << 0);
> @@ -513,7 +522,8 @@ int serprog_init(void)
> msg_pdbg(MSGHEADER "Maximum read-n length is %d\n", v);
> }
> bt = serprog_buses_supported;
> - sp_docommand(S_CMD_S_BUSTYPE, 1, &bt, 0, NULL);
> + if (sp_docommand(S_CMD_S_BUSTYPE, 1, &bt, 0, NULL))
> + return 1;
> }
those calls actually change the behavior, because it was previously ok
if they fail (which is arguably correct), i decided to change them
anyway because the if before guards older correct implementations
against this anyway. i just moved the first one above the comment
because it would contradict it otherwise.
thanks!
Acked-by: Stefan Tauner <stefan.tauner at student.tuwien.ac.at>
and applied in r1557
--
Kind regards/Mit freundlichen Grüßen, Stefan Tauner
More information about the flashrom
mailing list