From: Arnd Bergmann <arnd@arndb.de>
To: linaro-kernel@lists.linaro.org
Cc: Viresh Kumar <viresh.kumar@linaro.org>,
gregkh@linuxfoundation.org, sboyd@codeaurora.org,
Rafael Wysocki <rjw@rjwysocki.net>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] debugfs: don't access 4 bytes for a boolean
Date: Mon, 14 Sep 2015 17:25:23 +0200 [thread overview]
Message-ID: <1499926.Jx7HlHxHXb@wuerfel> (raw)
In-Reply-To: <3d6f65fa15363650f2d10ca58b9d9d243e98980f.1441961769.git.viresh.kumar@linaro.org>
On Friday 11 September 2015 14:36:06 Viresh Kumar wrote:
>
> debugfs_create_bool() declares the pointer to be of type u32 *.
> Shouldn't that be changed to u8 *? There are many users which are
> typecasting the variables to make debugfs API happy
I'd say that the argument to debugfs_create_bool() has to match the
access in the functions you are modifying, as well as whatever
gets passed into it by callers.
By accessing only the first byte, you break all drivers that
call debugfs_create_bool() with a four-byte argument, at least
on big-endian systems!
If we change any part of this, we need to audit the existing 31 callers
of the function and change them all to use a bool type.
In the problem that you saw, what prevented gcc from printing a
compile-time warning about debugfs_create_bool() being called with
a bool argument?
Arnd
next prev parent reply other threads:[~2015-09-14 15:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-11 9:06 Viresh Kumar
2015-09-11 11:18 ` Rasmus Villemoes
2015-09-11 16:41 ` Greg KH
2015-09-14 15:25 ` Arnd Bergmann [this message]
2015-09-14 15:31 ` Viresh Kumar
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=1499926.Jx7HlHxHXb@wuerfel \
--to=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=linaro-kernel@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rjw@rjwysocki.net \
--cc=sboyd@codeaurora.org \
--cc=viresh.kumar@linaro.org \
/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®