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

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

 



On 11/9/2016 4:18 AM, David Laight wrote:
> 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.

Good to know.

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

Doesn't 'packed' make that unnecessary as well?

Regards,
John
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



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

  Powered by Linux