Message ID | 1313846925-31212-3-git-send-email-marek.vasut@gmail.com |
---|---|
State | Changes Requested |
Headers | show |
On Saturday, August 20, 2011 03:28:43 PM Marek Vasut wrote: > Signed-off-by: Marek Vasut <marek.vasut@gmail.com> Dang, I mistyped Remy's address ... fixed. > --- > drivers/usb/host/ohci-hcd.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c > index bc8bb20..dcd8fc8 100644 > --- a/drivers/usb/host/ohci-hcd.c > +++ b/drivers/usb/host/ohci-hcd.c > @@ -1262,7 +1262,7 @@ static int ohci_submit_rh_msg(struct usb_device *dev, > unsigned long pipe, int leni = transfer_len; > int len = 0; > int stat = 0; > - __u32 datab[4]; > + __u8 datab[16] __attribute__((aligned(4))); > __u8 *data_buf = (__u8 *)datab; > __u16 bmRType_bReq; > __u16 wValue;
On Saturday, August 20, 2011 09:28:43 Marek Vasut wrote: > - __u32 datab[4]; > + __u8 datab[16] __attribute__((aligned(4))); > __u8 *data_buf = (__u8 *)datab; leverage a union to avoid attributes: union { __u32 u32[4]; __u8 u8[16]; } datab; __u8 *data_buf = datab.u8; also, it isn't "anti-aliasing complaints", it's "fix strict aliasing violations". "anti-aliasing" is something completely different in the computing world :p. -mike
On Saturday, August 20, 2011 08:07:49 PM Mike Frysinger wrote: > On Saturday, August 20, 2011 09:28:43 Marek Vasut wrote: > > - __u32 datab[4]; > > + __u8 datab[16] __attribute__((aligned(4))); > > > > __u8 *data_buf = (__u8 *)datab; > > leverage a union to avoid attributes: > union { > __u32 u32[4]; > __u8 u8[16]; > } datab; > __u8 *data_buf = datab.u8; > > also, it isn't "anti-aliasing complaints", it's "fix strict aliasing > violations". "anti-aliasing" is something completely different in the > computing world :p. Well I guess my brain just saw the compiler output differently ... thanks for the catch. > -mike
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c index bc8bb20..dcd8fc8 100644 --- a/drivers/usb/host/ohci-hcd.c +++ b/drivers/usb/host/ohci-hcd.c @@ -1262,7 +1262,7 @@ static int ohci_submit_rh_msg(struct usb_device *dev, unsigned long pipe, int leni = transfer_len; int len = 0; int stat = 0; - __u32 datab[4]; + __u8 datab[16] __attribute__((aligned(4))); __u8 *data_buf = (__u8 *)datab; __u16 bmRType_bReq; __u16 wValue;
Signed-off-by: Marek Vasut <marek.vasut@gmail.com> --- drivers/usb/host/ohci-hcd.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)