lkml.org 
[lkml]   [2021]   [Jul]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [Question] Alignment requirement for readX() and writeX()
On Fri, Jul 30, 2021 at 7:31 PM Boqun Feng <boqun.feng@gmail.com> wrote:
> On Fri, Jul 30, 2021 at 06:58:30PM +0200, Arnd Bergmann wrote:
>
> If we want to check, I'd expect we do the checks inside
> readX()/writeX(), for example, readl() could be implemented as:
>
> #define readl(c) \
> ({ \
> u32 __v; \
> \
> /* alignment checking */ \
> BUG_ON(c & (sizeof(__v) - 1)); \
> __v = readl_relaxed(c); \
> __iormb(__v); \
> __v; \
> })
>
> It's a runtime check, so if anyone hates it I can understand ;-)

Right, I really don't think that adds any value, this just replaces one
oops message with a more different oops message, while adding
some overhead.

Arnd

\
 
 \ /
  Last update: 2021-07-30 22:25    [W:0.089 / U:0.616 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site