mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Andrey Smirnov <andrew.smirnov@gmail.com>
To: barebox@lists.infradead.org
Cc: Andrey Smirnov <andrew.smirnov@gmail.com>
Subject: [PATCH 4/4] USB: gadget: Compile composite.c with -Wno-address-of-packed-member
Date: Sat,  7 Sep 2019 16:54:56 -0700	[thread overview]
Message-ID: <20190907235456.21535-4-andrew.smirnov@gmail.com> (raw)
In-Reply-To: <20190907235456.21535-1-andrew.smirnov@gmail.com>

GCC9 for ARM produces the following warnings:

drivers/usb/gadget/composite.c: In function 'bos_desc':
drivers/usb/gadget/composite.c:522:15: warning: taking address of packed member of 'struct usb_bos_descriptor' may result in an unaligned pointer value [-Waddress-of-packed-member]
  522 |  le16_add_cpu(&bos->wTotalLength, USB_DT_USB_EXT_CAP_SIZE);
      |               ^~~~~~~~~~~~~~~~~~
drivers/usb/gadget/composite.c:534:15: warning: taking address of packed member of 'struct usb_bos_descriptor' may result in an unaligned pointer value [-Waddress-of-packed-member]
  534 |  le16_add_cpu(&bos->wTotalLength, USB_DT_USB_SS_CAP_SIZE);
      |               ^~~~~~~~~~~~~~~~~~
drivers/usb/gadget/composite.c: In function 'get_string':
drivers/usb/gadget/composite.c:928:23: warning: taking address of packed member of 'struct usb_string_descriptor' may result in an unaligned pointer value [-Waddress-of-packed-member]
  928 |    collect_langs(sp, s->wData);
      |                      ~^~~~~~~
drivers/usb/gadget/composite.c:933:24: warning: taking address of packed member of 'struct usb_string_descriptor' may result in an unaligned pointer value [-Waddress-of-packed-member]
  933 |     collect_langs(sp, s->wData);
      |                       ~^~~~~~~
drivers/usb/gadget/composite.c:938:25: warning: taking address of packed member of 'struct usb_string_descriptor' may result in an unaligned pointer value [-Waddress-of-packed-member]
  938 |      collect_langs(sp, s->wData);
      |                        ~^~~~~~~
drivers/usb/gadget/composite.c:945:23: warning: taking address of packed member of 'struct usb_string_descriptor' may result in an unaligned pointer value [-Waddress-of-packed-member]
  945 |    collect_langs(sp, s->wData);
      |                      ~^~~~~~~

the offending code seems OK and there doesn't seem to be a way to fix
this in code, so disable the warning for that file.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 drivers/usb/gadget/Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/usb/gadget/Makefile b/drivers/usb/gadget/Makefile
index 9ef594575b..8d399e568f 100644
--- a/drivers/usb/gadget/Makefile
+++ b/drivers/usb/gadget/Makefile
@@ -1,4 +1,6 @@
 
+CFLAGS_composite.o := -Wno-address-of-packed-member
+
 obj-$(CONFIG_USB_GADGET) += composite.o config.o usbstring.o epautoconf.o udc-core.o functions.o config.o multi.o
 obj-$(CONFIG_USB_GADGET_SERIAL) += u_serial.o serial.o f_serial.o f_acm.o
 obj-$(CONFIG_USB_GADGET_DFU) += dfu.o
-- 
2.21.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      parent reply	other threads:[~2019-09-07 23:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-07 23:54 [PATCH 1/4] ratp: Mark struct ratp_bb as packed Andrey Smirnov
2019-09-07 23:54 ` [PATCH 2/4] net: Adjust net_copy_uint32's signature Andrey Smirnov
2019-09-07 23:54 ` [PATCH 3/4] mtd: ubi: Compile fastmap.c with -Wno-address-of-packed-member Andrey Smirnov
2019-09-09 10:23   ` Sascha Hauer
2019-09-10  4:28     ` Andrey Smirnov
2019-09-12  6:55       ` Sascha Hauer
2019-09-07 23:54 ` Andrey Smirnov [this message]

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=20190907235456.21535-4-andrew.smirnov@gmail.com \
    --to=andrew.smirnov@gmail.com \
    --cc=barebox@lists.infradead.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