From 18fe330413f747f8604ce78caf1624b6f201846a Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Wed, 3 Jul 2013 00:59:53 +0200 Subject: [PATCH] Fix warning Function call argument is an uninitialized value acr122_usb.c:237:3: warning: Function call argument is an uninitialized value LOG_HEX(NFC_LOG_GROUP_COM, "TX", abtTx, szTx); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../libnfc/log.h:107:7: note: expanded from macro 'LOG_HEX' snprintf (__acBuf + __szBuf, sizeof(__acBuf) - __szBuf, "%02x ",((uint8_t *)(pbtData))[__szPos]); \ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Maybe a side effect of the #pragma pack not properly understood by the static analyser but anyway acr122_usb_frame_template is also used the same way to initialize the other frames --- libnfc/drivers/acr122_usb.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/libnfc/drivers/acr122_usb.c b/libnfc/drivers/acr122_usb.c index 9d6f5c4..f8c63f6 100644 --- a/libnfc/drivers/acr122_usb.c +++ b/libnfc/drivers/acr122_usb.c @@ -782,15 +782,11 @@ acr122_usb_init(nfc_device *pnd) return res; // Power On ICC - struct ccid_header ccid_frame = { - .bMessageType = PC_to_RDR_IccPowerOn, - .dwLength = 0, - .bSlot = 0, - .bSeq = 0, - .bMessageSpecific = { 0x01, 0x00, 0x00 }, + uint8_t ccid_frame[] = { + PC_to_RDR_IccPowerOn, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 }; - if ((res = acr122_usb_bulk_write(DRIVER_DATA(pnd), (unsigned char *)&ccid_frame, sizeof(struct ccid_header), 1000)) < 0) + if ((res = acr122_usb_bulk_write(DRIVER_DATA(pnd), ccid_frame, sizeof(struct ccid_header), 1000)) < 0) return res; if ((res = acr122_usb_bulk_read(DRIVER_DATA(pnd), abtRxBuf, sizeof(abtRxBuf), 1000)) < 0) return res;