lkml.org 
[lkml]   [2020]   [Jul]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 05/18] gpiolib: cdev: support GPIO_GET_LINE_IOCTL and GPIOLINE_GET_VALUES_IOCTL
On Sun, Jul 26, 2020 at 09:12:44AM +0800, Kent Gibson wrote:
> On Sat, Jul 25, 2020 at 11:51:54PM +0300, Andy Shevchenko wrote:
> > On Sat, Jul 25, 2020 at 7:24 AM Kent Gibson <warthog618@gmail.com> wrote:
> > >

[ snip ]

> > > + test_bit(line_idx, (unsigned long *)lc->attrs[i].mask))
> >
> > This casting is not good. What about BE 32-bit architecture?
> >
>
> I agree the casting is hideous, but I thought the outcome was correct
> as it is manipulating addresses, not data.
> You think the address of a 64-bit differs based on endian??
> Happy to change it - but not sure what to.
>

You are right - using bitops on u64 is problematic for BE-32 - the 32-bit
words will be swapped if userspace treats the flags as the u64 it is
defined as.

I'll rework that for v3.

Cheers,
Kent.

\
 
 \ /
  Last update: 2020-07-29 04:29    [W:0.628 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site