mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-12-20 08:52:12 +01:00
tpm: tis_infineon: Cannot test unsigned for being negative
tpm_tis_i2c_get_burstcount returns a size_t but also returns -EBUSY if the TPM is surrently busy. As size_t is an unsigned type simply testing for < 0 will not work so change the test for being equal to -EBUSY which will work. Also remove the trivial comments. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
This commit is contained in:
parent
83b1c7fd71
commit
73b23838c4
@ -353,8 +353,7 @@ static int tpm_tis_i2c_recv_data(struct udevice *dev, u8 *buf, size_t count)
|
||||
while (size < count) {
|
||||
burstcnt = tpm_tis_i2c_get_burstcount(dev);
|
||||
|
||||
/* burstcount < 0 -> tpm is busy */
|
||||
if (burstcnt < 0)
|
||||
if (burstcnt == -EBUSY)
|
||||
return burstcnt;
|
||||
|
||||
/* Limit received data to max left */
|
||||
@ -449,8 +448,7 @@ static int tpm_tis_i2c_send(struct udevice *dev, const u8 *buf, size_t len)
|
||||
|
||||
burstcnt = tpm_tis_i2c_get_burstcount(dev);
|
||||
|
||||
/* burstcount < 0 -> tpm is busy */
|
||||
if (burstcnt < 0)
|
||||
if (burstcnt == -EBUSY)
|
||||
return burstcnt;
|
||||
|
||||
while (count < len) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user