lkml.org 
[lkml]   [2013]   [Nov]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] drivers: w1: make w1_slave::flags long to avoid casts
On Fri, 01 Nov 2013 20:01:39 +0400 Evgeniy Polyakov <zbr@ioremap.net> wrote:

> > Now that I look at documentation, I think you are correct, but the
> > problem is on big-endian 64-bit architectures. __The fix is still
> > valid, but the commit message not so much. __Something along the
> > lines of the following would be better:
>
> Guys, you so much overcomplicate things - this field is basically a set of in-memory flags
> for attached device, there is no need to even think about how it is present in different endianess
>
> Or do I miss something fundamental there? I wrote it gazillions years ago and probably already forgot something

set_bit() operates on longs. So if we do

struct foo {
u32 a;
u32 b;
} f;

...
set_bit(0, (long *)&f.a);
...

then we'll scribble on f.b on a big-endian 64-bit machine.


\
 
 \ /
  Last update: 2013-11-01 20:41    [W:0.044 / U:0.648 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site