On Wed, 6 Jun 2012 10:18:00 +0200 Niklas Söderlund niso@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))
if (!sp_docommand(S_CMD_Q_WRNMAXLEN, 0, NULL, 3, rbuf)) { uint32_t v; v = ((unsigned int)(rbuf[0]) << 0);return 1;
@@ -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@student.tuwien.ac.at and applied in r1557