mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Evgeniy Polyakov <zbr@ioremap.net>
Cc: Michal Nazarewicz <mina86@mina86.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] drivers: w1: make w1_slave::flags long to avoid casts
Date: Fri, 1 Nov 2013 12:30:41 -0700	[thread overview]
Message-ID: <20131101123041.d08adc9739cf6e733d822770@linux-foundation.org> (raw)
In-Reply-To: <212981383321699@web5m.yandex.ru>

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.

  reply	other threads:[~2013-11-01 19:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-26 11:56 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 [this message]
2013-11-02  4:10         ` Рустафа Джамурахметов
2013-11-02 16:58           ` Michal Nazarewicz
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=20131101123041.d08adc9739cf6e733d822770@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mina86@mina86.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®