lkml.org 
[lkml]   [2021]   [May]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v2 12/13] asm-generic: uaccess: 1-byte access is always aligned
On Sat, May 15, 2021 at 8:41 PM Randy Dunlap <rdunlap@infradead.org> wrote:
> On 5/14/21 3:01 AM, Arnd Bergmann wrote:
> > From: Arnd Bergmann <arnd@arndb.de>
> > diff --git a/include/asm-generic/uaccess.h b/include/asm-generic/uaccess.h
> > index 4973328f3c6e..7e903e450659 100644
> > --- a/include/asm-generic/uaccess.h
> > +++ b/include/asm-generic/uaccess.h
> > @@ -19,7 +19,7 @@ __get_user_fn(size_t size, const void __user *from, void *to)
> >
> > switch (size) {
> > case 1:
> > - *(u8 *)to = get_unaligned((u8 __force *)from);
> > + *(u8 *)to = *((u8 __force *)from);
> > return 0;
> > case 2:
> > *(u16 *)to = get_unaligned((u16 __force *)from);
> > @@ -45,7 +45,7 @@ __put_user_fn(size_t size, void __user *to, void *from)
> >
> > switch (size) {
> > case 1:
> > - put_unaligned(*(u8 *)from, (u8 __force *)to);
> > + *(*(u8 *)from, (u8 __force *)to);
>
> Should that be from =
> ?

Thanks a lot for catching the typo!

Changed now to

*(u8 __force *)to = *(u8 *)from;

For some reason neither my own build testing nor the kernel
build bot caught it so far.

Arnd

\
 
 \ /
  Last update: 2021-05-15 22:19    [W:0.195 / U:0.220 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site