]> git.proxmox.com Git - mirror_qemu.git/commitdiff
ccid-card-emulated: fix cast warning/error
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Tue, 3 Jan 2023 11:08:05 +0000 (15:08 +0400)
committerLaurent Vivier <laurent@vivier.eu>
Mon, 16 Jan 2023 17:46:03 +0000 (18:46 +0100)
../hw/usb/ccid-card-emulated.c: In function 'handle_apdu_thread':
../hw/usb/ccid-card-emulated.c:251:24: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
  251 |                 assert((unsigned long)event > 1000);

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20230103110814.3726795-2-marcandre.lureau@redhat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
hw/usb/ccid-card-emulated.c

index ee41a818014b832e6ae8c9becec148faf61c2edb..c328660075499f04617ab68815cdedd28250ebcf 100644 (file)
@@ -248,7 +248,7 @@ static void *handle_apdu_thread(void* arg)
         WITH_QEMU_LOCK_GUARD(&card->vreader_mutex) {
             while (!QSIMPLEQ_EMPTY(&card->guest_apdu_list)) {
                 event = QSIMPLEQ_FIRST(&card->guest_apdu_list);
-                assert((unsigned long)event > 1000);
+                assert(event != NULL);
                 QSIMPLEQ_REMOVE_HEAD(&card->guest_apdu_list, entry);
                 if (event->p.data.type != EMUL_GUEST_APDU) {
                     DPRINTF(card, 1, "unexpected message in handle_apdu_thread\n");