Re: [PATCH] drivers: w1: make w1_slave::flags long to avoid casts

2013-11-02 Thread Рустафа Джамурахметов
Hi 02.11.2013, 20:59, "Michal Nazarewicz" : >>  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 > > If the driver does not require an atomic set_bit operation for

Re: [PATCH] drivers: w1: make w1_slave::flags long to avoid casts

2013-11-02 Thread Michal Nazarewicz
> 01.11.2013, 23:30, "Andrew Morton" : >> 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. On Sat, Nov 02 2013, Рустафа Джамурахметов wrote: > Argh, why would we just don't

Re: [PATCH] drivers: w1: make w1_slave::flags long to avoid casts

2013-11-01 Thread Рустафа Джамурахметов
Hi 01.11.2013, 23:30, "Andrew Morton" : > 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 d

Re: [PATCH] drivers: w1: make w1_slave::flags long to avoid casts

2013-11-01 Thread Andrew Morton
On Fri, 01 Nov 2013 20:01:39 +0400 Evgeniy Polyakov 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 w

Re: [PATCH] drivers: w1: make w1_slave::flags long to avoid casts

2013-11-01 Thread Evgeniy Polyakov
Hi everyone 31.10.2013, 13:12, "Michal Nazarewicz" : >>>   int ttl; >>  ... w1_slave.ttl? For noisy lines this was a 'timeout' after which system considered attached device as failed, the noisier line is the longer is timeout I experimented with meters-long w1 wires and it required seve

Re: [PATCH] drivers: w1: make w1_slave::flags long to avoid casts

2013-10-31 Thread Michal Nazarewicz
On Wed, Oct 30 2013, Andrew Morton wrote: > On Sat, 26 Oct 2013 12:56:11 +0100 Michal Nazarewicz wrote: > >> From: Michal Nazarewicz >> >> Changing flags field of the w1_slave to unsigned long may on >> some architectures increase the size of the structure, but >> otherwise makes the code more k

Re: [PATCH] drivers: w1: make w1_slave::flags long to avoid casts

2013-10-30 Thread Andrew Morton
On Sat, 26 Oct 2013 12:56:11 +0100 Michal Nazarewicz wrote: > From: Michal Nazarewicz > > Changing flags field of the w1_slave to unsigned long may on > some architectures increase the size of the structure, but > otherwise makes the code more kosher as casting is avoided > and *_bit family of

[PATCH] drivers: w1: make w1_slave::flags long to avoid casts

2013-10-26 Thread Michal Nazarewicz
From: Michal Nazarewicz Changing flags field of the w1_slave to unsigned long may on some architectures increase the size of the structure, but otherwise makes the code more kosher as casting is avoided and *_bit family of calls do not attempt to operate on an entity of bigger size than realy is