Thread (2 messages) 2 messages, 2 authors, 2016-01-22

Re: [PATCH 1/3] ata: sata_dwc_460ex: use "dmas" DT property to find dma channel

From: Måns Rullgård <hidden>
Date: 2016-01-20 20:07:08
Also in: lkml

Possibly related (same subject, not in this thread)

Andy Shevchenko [off-list ref] writes:
On Wed, Jan 20, 2016 at 9:46 PM, Måns Rullgård [off-list ref] wrote:
quoted
quoted
quoted
quoted
One comment still regarding to lli types. We can avoid warnings by
using (__force u32) in macros.
But that won't give the benefits of having the types checked.
You mean if we access the lli->field directly? I didn't quite get what
use case you are keeping in mind.
Yes, accessing any of those fields directly with my patch gives a sparse
warning.  It's situations like these those checks are intended for.
Defeating them seems foolish to me.
Otherwise it makes that struct looks ugly.
Why not union, though it still ugly, but less.
What's so ugly about it?  IMO data should be declared as the type it
actually is, and here we have fields that might have a different byte
order from the host CPU.  The __be32 and __le32 types were invented to
make such situations clear and allow automatic (sparse) checking.  I'd
say the price of one small typedef is well worth it.  The actual code is
not impacted since it must use the accessor macros anyhow.

-- 
Måns Rullgård
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help