All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Nazarewicz <mina86@mina86.com>
To: "Рустафа Джамурахметов" <zbr@ioremap.net>,
	"Andrew Morton" <akpm@linux-foundation.org>
Cc: "linux-kernel\@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] drivers: w1: make w1_slave::flags long to avoid casts
Date: Sat, 02 Nov 2013 17:58:57 +0100	[thread overview]
Message-ID: <87y556wxim.fsf@mina86.com> (raw)
In-Reply-To: <7061383365433@web15j.yandex.ru>

[-- Attachment #1: Type: text/plain, Size: 699 bytes --]

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

On Sat, Nov 02 2013, Рустафа Джамурахметов <zbr@ioremap.net> wrote:
> 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 setting
and testing the flag, feel free to prepare a patch replacing the whole
thing with a plain bool.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 835 bytes --]

  reply	other threads:[~2013-11-02 16:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-26 11:56 [PATCH] drivers: w1: make w1_slave::flags long to avoid casts Michal Nazarewicz
2013-10-30 22:59 ` Andrew Morton
2013-10-31  9:11   ` Michal Nazarewicz
2013-11-01 16:01     ` Evgeniy Polyakov
2013-11-01 19:30       ` Andrew Morton
2013-11-02  4:10         ` Рустафа Джамурахметов
2013-11-02 16:58           ` Michal Nazarewicz [this message]
2013-11-02 17:19             ` Рустафа Джамурахметов

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y556wxim.fsf@mina86.com \
    --to=mina86@mina86.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zbr@ioremap.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.