qemu-trivial
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-trivial] [Qemu-devel] [PATCH v5 35/46] hw/usb: Use the IEC bin


From: Philippe Mathieu-Daudé
Subject: Re: [Qemu-trivial] [Qemu-devel] [PATCH v5 35/46] hw/usb: Use the IEC binary prefix definitions
Date: Wed, 27 Jun 2018 10:03:28 -0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0

On 06/27/2018 04:04 AM, Richard Henderson wrote:
> On 06/25/2018 05:42 AM, Philippe Mathieu-Daudé wrote:
>> -#define VSCARD_IN_SIZE 65536
>> +#define VSCARD_IN_SIZE      (64 * KiB)
>>  
>>  /* maximum size of ATR - from 7816-3 */
>>  #define MAX_ATR_SIZE        40
>> @@ -276,7 +277,7 @@ static void ccid_card_vscard_read(void *opaque, const 
>> uint8_t *buf, int size)
>>  
>>      if (card->vscard_in_pos + size > VSCARD_IN_SIZE) {
>>          error_report(
>> -            "no room for data: pos %d +  size %d > %d. dropping 
>> connection.",
>> +            "no room for data: pos %u +  size %d > %ld. dropping 
>> connection.",
>>              card->vscard_in_pos, size, VSCARD_IN_SIZE);
> 
> Did you test this with i686 host?  %ld doesn't look right.

Yes...

$ uname -m
x86_64
$ make hw/usb/ccid-card-passthru.o
  CC      hw/usb/ccid-card-passthru.o
$

If there are no other changes asked on this series, the maintainer
taking this can update to use PRId64 with:

-- >8 --
diff --git a/hw/usb/ccid-card-passthru.c b/hw/usb/ccid-card-passthru.c
--- a/hw/usb/ccid-card-passthru.c
+++ b/hw/usb/ccid-card-passthru.c
@@ -276,9 +276,9 @@ static void ccid_card_vscard_read(void *opaque,
const uint8_t *buf, int size)
     VSCMsgHeader *hdr;

     if (card->vscard_in_pos + size > VSCARD_IN_SIZE) {
-        error_report(
-            "no room for data: pos %u +  size %d > %ld. dropping
connection.",
-            card->vscard_in_pos, size, VSCARD_IN_SIZE);
+        error_report("no room for data: pos %u +  size %d > %" PRId64 "."
+                     " dropping connection.",
+                     card->vscard_in_pos, size, VSCARD_IN_SIZE);
         ccid_card_vscard_drop_connection(card);
         return;
     }
--

Or I can send as a cleanup patch once the series get merged.

Thanks for your review!

Phil.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]