RE: [PATCH 02/30] usb: dwc2: Update DMA descriptor structure

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

 



From: John Youn
> Sent: 08 November 2016 22:30
...
> >> Also make it __packed.
> >
> > why are you making it packed? Does it _have_ to be packed? If it must,
> > why wasn't it before?
> 
> We want to guarantee that it reflects the exact descriptor structure
> in memory, so probably yes. It was overlooked before and worked
> because the compiler likely packed it anyways. This is just to make
> sure it does.
...

That isn't all that 'packed' means.

'packed' also tells the compiler to access the structure with instructions that
will work if it isn't on the 'natural' boundary.

If you want to ensure the structure is the right size (pretty pointless here)
then add a compile time assert against the structure size.

	David

��.n��������+%������w��{.n�����{���)��jg��������ݢj����G�������j:+v���w�m������w�������h�����٥




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux