lkml.org 
[lkml]   [2013]   [Nov]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] drivers: w1: make w1_slave::flags long to avoid casts
Date
Hi

01.11.2013, 23:30, "Andrew Morton" <akpm@linux-foundation.org>:

> 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.

Argh, why would we just don't do that? Its in-memory field, it can be anything,
I wouldn't be surprised if it even can be non-atomic because of proper locks already
being held
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2013-11-02 05:21    [W:0.257 / U:0.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site