qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: qemu-trivial@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>,
	qemu-devel@nongnu.org
Subject: Re: [PATCH 3/6] hw/usb/quirks: Use smaller types to reduce .rodata by 10KiB
Date: Thu, 5 Mar 2020 11:41:24 +0100	[thread overview]
Message-ID: <a5b6cddf-5887-be27-db76-2e515daa2c11@redhat.com> (raw)
In-Reply-To: <20200305080237.j2a7waokxominirn@sirius.home.kraxel.org>

On 3/5/20 9:02 AM, Gerd Hoffmann wrote:
>>   struct usb_device_id {
>> -    int vendor_id;
>> -    int product_id;
>> -    int interface_class;
>> -    int interface_subclass;
>> -    int interface_protocol;
>> +    int16_t vendor_id;
>> +    int16_t product_id;
>> +    int8_t interface_class;
>> +    int8_t interface_subclass;
>> +    int8_t interface_protocol;
> 
> I guess we should better use the uint variants here ...

I tried it first but I got:

   CC      hw/usb/quirks.o
hw/usb/quirks.c:25:34: error: result of comparison of constant -1 with 
expression of type 'const uint16_t' (aka 'const unsigned short') is 
always true [-Werror,-Wtautological-constant-out-of-range-compare]
     for (i = 0; ids[i].vendor_id != -1; i++) {
                 ~~~~~~~~~~~~~~~~ ^  ~~
hw/usb/quirks.c:28:37: error: result of comparison of constant -1 with 
expression of type 'const uint8_t' (aka 'const unsigned char') is always 
false [-Werror,-Wtautological-constant-out-of-range-compare]
             (ids[i].interface_class == -1 ||
              ~~~~~~~~~~~~~~~~~~~~~~ ^  ~~

And went this less intrusive way.

I'll respin with s/-1/UINT8_MAX/.



  reply	other threads:[~2020-03-05 10:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-04 22:18 [PATCH 0/6] hw,ui: Reduce QEMU .rodata/.bss footprint Philippe Mathieu-Daudé
2020-03-04 22:18 ` [PATCH 1/6] hw/audio/fmopl: Fix a typo twice Philippe Mathieu-Daudé
2020-03-05 10:06   ` Laurent Vivier
2020-03-04 22:18 ` [PATCH 2/6] hw/audio/fmopl: Move ENV_CURVE to .heap to save 32KiB of .bss Philippe Mathieu-Daudé
2020-03-04 22:18 ` [PATCH 3/6] hw/usb/quirks: Use smaller types to reduce .rodata by 10KiB Philippe Mathieu-Daudé
2020-03-05  8:02   ` Gerd Hoffmann
2020-03-05 10:41     ` Philippe Mathieu-Daudé [this message]
2020-03-05 10:49       ` Philippe Mathieu-Daudé
2020-03-05 11:59         ` Gerd Hoffmann
2020-03-05 12:01           ` Philippe Mathieu-Daudé
2020-03-04 22:18 ` [PATCH 4/6] hw/audio/intel-hda: Use memory region alias to reduce .rodata by 4.34MB Philippe Mathieu-Daudé
2020-03-04 22:18 ` [PATCH 5/6] ui/curses: Make control_characters[] array const Philippe Mathieu-Daudé
2020-03-04 22:18 ` [PATCH 6/6] ui/curses: Move arrays to .heap to save 74KiB of .bss Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a5b6cddf-5887-be27-db76-2e515daa2c11@redhat.com \
    --to=philmd@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).