From: Corey Minyard <minyard@acm.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-kernel@vger.kernel.org,
"Rafael J . Wysocki" <rafael.j.wysocki@intel.com>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
mika.westerberg@linux.intel.com
Subject: Re: [PATCH v1] device property: Define type of PROPERTY_ENRTY_*() macros
Date: Mon, 22 Jan 2018 09:47:38 -0600 [thread overview]
Message-ID: <3c3d0155-b097-b9dd-ebf9-6698ff47c673@acm.org> (raw)
In-Reply-To: <20180122153317.75509-1-andriy.shevchenko@linux.intel.com>
On 01/22/2018 09:33 AM, Andy Shevchenko wrote:
> Some of the drivers may use the macro at runtime flow, like
>
> struct property_entry p[10];
> ...
> p[index++] = PROPERTY_ENTRY_U8("u8 property", u8_data);
>
> In that case and absence of the data type compiler fails the build:
>
> drivers/char/ipmi/ipmi_dmi.c:79:29: error: Expected ; at end of statement
> drivers/char/ipmi/ipmi_dmi.c:79:29: error: got {
>
> Cc: Corey Minyard <minyard@acm.org>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
This looks good to me.
Acked-by: Corey Minyard <cminyard@mvista.com>
> ---
> include/linux/property.h | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/include/linux/property.h b/include/linux/property.h
> index 7eefaf2f22b9..f144be4f99e0 100644
> --- a/include/linux/property.h
> +++ b/include/linux/property.h
> @@ -204,7 +204,7 @@ struct property_entry {
> */
>
> #define PROPERTY_ENTRY_INTEGER_ARRAY(_name_, _type_, _Type_, _val_) \
> -{ \
> +(struct property_entry) { \
> .name = _name_, \
> .length = ARRAY_SIZE(_val_) * sizeof(_type_), \
> .is_array = true, \
> @@ -222,7 +222,7 @@ struct property_entry {
> PROPERTY_ENTRY_INTEGER_ARRAY(_name_, u64, U64, _val_)
>
> #define PROPERTY_ENTRY_STRING_ARRAY(_name_, _val_) \
> -{ \
> +(struct property_entry) { \
> .name = _name_, \
> .length = ARRAY_SIZE(_val_) * sizeof(const char *), \
> .is_array = true, \
> @@ -231,7 +231,7 @@ struct property_entry {
> }
>
> #define PROPERTY_ENTRY_INTEGER(_name_, _type_, _Type_, _val_) \
> -{ \
> +(struct property_entry) { \
> .name = _name_, \
> .length = sizeof(_type_), \
> .type = DEV_PROP_##_Type_, \
> @@ -248,7 +248,7 @@ struct property_entry {
> PROPERTY_ENTRY_INTEGER(_name_, u64, U64, _val_)
>
> #define PROPERTY_ENTRY_STRING(_name_, _val_) \
> -{ \
> +(struct property_entry) { \
> .name = _name_, \
> .length = sizeof(_val_), \
> .type = DEV_PROP_STRING, \
> @@ -256,7 +256,7 @@ struct property_entry {
> }
>
> #define PROPERTY_ENTRY_BOOL(_name_) \
> -{ \
> +(struct property_entry) { \
> .name = _name_, \
> }
>
prev parent reply other threads:[~2018-01-22 15:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-22 15:33 Andy Shevchenko
2018-01-22 15:47 ` Corey Minyard [this message]
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=3c3d0155-b097-b9dd-ebf9-6698ff47c673@acm.org \
--to=minyard@acm.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=rafael.j.wysocki@intel.com \
--cc=sakari.ailus@linux.intel.com \
/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®