[linux-nfc] [neard][PATCH v2 30/73] mifare: use proper format for integers (-Wformat)

Krzysztof Kozlowski <[email protected]> Mon, 19 Jul 2021 13:07:36 +0200
Newsgroups org.01.lists.linux-nfc,dev.linux.lists.oe-linux-nfc
Message-ID <[email protected]>
Properly print signed and unsigned integers.  This fixes warnings like:

    plugins/mifare.c: In function ‘mifare_read’:
    plugins/mifare.c:836:33: error: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘unsigned int’ [-Werror=format=]
      836 |   near_error("Mifare tag type [%d] not supported.", tgt_subtype);
          |                                ~^                   ~~~~~~~~~~~
          |                                 |                   |
          |                                 int                 unsigned int
          |                                %d

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
 plugins/mifare.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/plugins/mifare.c b/plugins/mifare.c
index 3d376526735d..a4e4ba443995 100644
--- a/plugins/mifare.c
+++ b/plugins/mifare.c
@@ -833,7 +833,7 @@ int mifare_read(uint32_t adapter_idx, uint32_t target_idx,
 	case NEAR_TAG_NFC_T2_MIFARE_CLASSIC_4K:
 		break;
 	default:
-		near_error("Mifare tag type [%d] not supported.", tgt_subtype);
+		near_error("Mifare tag type [%u] not supported.", tgt_subtype);
 		return -1;
 	}
 
@@ -900,7 +900,7 @@ int mifare_check_presence(uint32_t adapter_idx, uint32_t target_idx,
 	case NEAR_TAG_NFC_T2_MIFARE_CLASSIC_4K:
 		break;
 	default:
-		near_error("Mifare tag type %d not supported.", tgt_subtype);
+		near_error("Mifare tag type %u not supported.", tgt_subtype);
 		return -1;
 	}
 
@@ -1228,7 +1228,7 @@ static int writing_not_permitted(void *data)
 		}
 	}
 
-	DBG("TAG writable sectors' size: [%d].", new_tag_size);
+	DBG("TAG writable sectors' size: [%u].", new_tag_size);
 
 	/* Check if there's enough space on tag */
 	if (new_tag_size < mf_ck->ndef->length) {
@@ -1293,7 +1293,7 @@ int mifare_write(uint32_t adapter_idx, uint32_t target_idx,
 	case NEAR_TAG_NFC_T2_MIFARE_CLASSIC_4K:
 		break;
 	default:
-		near_error("Mifare tag type %d not supported.", tgt_subtype);
+		near_error("Mifare tag type %u not supported.", tgt_subtype);
 		return -1;
 	}
 
-- 
2.27.0
_______________________________________________
Linux-nfc mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s