From: Arnd Bergmann <arnd@arndb.de>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>, Daniel Mack <daniel@zonque.org>,
Haojian Zhuang <haojian.zhuang@gmail.com>,
Robert Jarzmik <robert.jarzmik@free.fr>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: [PATCH] ARM: pxa/raumfeld: use PROPERTY_ENTRY_INTEGER to define props
Date: Tue, 15 Mar 2016 22:31:17 +0100 [thread overview]
Message-ID: <1458077493-350816-1-git-send-email-arnd@arndb.de> (raw)
gcc-6.0 notices that the use of the property_entry in this file that
was recently introduced cannot work right, as we initialize the wrong
field:
raumfeld.c:387:3: error: the address of 'raumfeld_rotary_encoder_steps' will always evaluate as 'true' [-Werror=address]
DEV_PROP_U32, 1, &raumfeld_rotary_encoder_steps, },
^~~~~~~~~~~~
raumfeld.c:389:3: error: the address of 'raumfeld_rotary_encoder_axis' will always evaluate as 'true' [-Werror=address]
DEV_PROP_U32, 1, &raumfeld_rotary_encoder_axis, },
^~~~~~~~~~~~
raumfeld.c:391:3: error: the address of 'raumfeld_rotary_encoder_relative_axis' will always evaluate as 'true' [-Werror=address]
DEV_PROP_U32, 1, &raumfeld_rotary_encoder_relative_axis, },
^~~~~~~~~~~~
The problem appears to stem from relying on an old definition of
'struct property', but it has changed several times since the code
could have last been correct.
This changes the code to use the PROPERTY_ENTRY_INTEGER() macro instead,
which works fine for the current definition and is a safer way of doing
the initialization.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: a9e340dce3c3 ("Input: rotary_encoder - move away from platform data structure")
---
The broken patch is currently in the input-next tree, please apply this
fixup on top.
arch/arm/mach-pxa/raumfeld.c | 15 ++++-----------
1 file changed, 4 insertions(+), 11 deletions(-)
diff --git a/arch/arm/mach-pxa/raumfeld.c b/arch/arm/mach-pxa/raumfeld.c
index 16ffd01daff1..5a941bd3dbed 100644
--- a/arch/arm/mach-pxa/raumfeld.c
+++ b/arch/arm/mach-pxa/raumfeld.c
@@ -378,18 +378,11 @@ static struct gpiod_lookup_table raumfeld_rotary_gpios_table = {
},
};
-static u32 raumfeld_rotary_encoder_steps = 24;
-static u32 raumfeld_rotary_encoder_axis = REL_X;
-static u32 raumfeld_rotary_encoder_relative_axis = 1;
-
static struct property_entry raumfeld_rotary_properties[] = {
- { "rotary-encoder,steps-per-period",
- DEV_PROP_U32, 1, &raumfeld_rotary_encoder_steps, },
- { "linux,axis",
- DEV_PROP_U32, 1, &raumfeld_rotary_encoder_axis, },
- { "rotary-encoder,relative_axis",
- DEV_PROP_U32, 1, &raumfeld_rotary_encoder_relative_axis, },
- { NULL }
+ PROPERTY_ENTRY_INTEGER("rotary-encoder,steps-per-period", u32, 24),
+ PROPERTY_ENTRY_INTEGER("linux,axis", u32, REL_X),
+ PROPERTY_ENTRY_INTEGER("rotary-encoder,relative_axis", u32, 1),
+ { },
};
static struct property_set raumfeld_rotary_property_set = {
--
2.7.0
next reply other threads:[~2016-03-15 21:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-15 21:31 Arnd Bergmann [this message]
2016-03-15 23:48 ` Dmitry Torokhov
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=1458077493-350816-1-git-send-email-arnd@arndb.de \
--to=arnd@arndb.de \
--cc=daniel@zonque.org \
--cc=dmitry.torokhov@gmail.com \
--cc=haojian.zhuang@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robert.jarzmik@free.fr \
/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®