Skip to contentSkip to conversation

Bluetooth: Wrong variable tested

PATCH In review Roel Kluin 1 participant 2 messages Jan 3, 2010 Bluetooth drivers

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 Bluetooth: Wrong variable tested

The return of the function sdio_readb() was not tested.

---
 drivers/bluetooth/btmrvl_sdio.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/bluetooth/btmrvl_sdio.c +2 -2
index f36defa..cac5b5e 100644
@@ -348,7 +348,7 @@ static int btmrvl_sdio_download_fw_w_helper(struct btmrvl_sdio_card *card)
 		for (tries = 0; tries < MAX_POLL_TRIES; tries++) {
 			base0 = sdio_readb(card->func,
 					SQ_READ_BASE_ADDRESS_A0_REG, &ret);
-			if (ret) {
+			if (base0) {
 				BT_ERR("BASE0 register read failed:"
 					" base0 = 0x%04X(%d)."
 					" Terminating download",
@@ -358,7 +358,7 @@ static int btmrvl_sdio_download_fw_w_helper(struct btmrvl_sdio_card *card)
 			}
 			base1 = sdio_readb(card->func,
 					SQ_READ_BASE_ADDRESS_A1_REG, &ret);
-			if (ret) {
+			if (base1) {
 				BT_ERR("BASE1 register read failed:"
 					" base1 = 0x%04X(%d)."
 					" Terminating download",
author
#1 lore raw
Quoted 1 line · Roel Kluin

The return of the function sdio_readb() was not tested.

Please ignore, as Joe Perches pointed out it's wrong.

Roel