diff options
| author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2018-01-22 11:01:42 -0500 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-01-25 07:44:20 -0500 |
| commit | c505cbd45f6e9c539d57dd171d95ec7e5e9f9cd0 (patch) | |
| tree | beb3cf1e971cb806098aade74021e538b9f2a365 /include/linux | |
| parent | b2ca8bdff60c589e5cfd988e92cd7dbed4b116bd (diff) | |
device property: Define type of PROPERTY_ENRTY_*() macros
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 {
Acked-by: Corey Minyard <cminyard@mvista.com>
Cc: Corey Minyard <minyard@acm.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/property.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/include/linux/property.h b/include/linux/property.h index f6189a3ac63c..2e3a7c24659e 100644 --- a/include/linux/property.h +++ b/include/linux/property.h | |||
| @@ -206,7 +206,7 @@ struct property_entry { | |||
| 206 | */ | 206 | */ |
| 207 | 207 | ||
| 208 | #define PROPERTY_ENTRY_INTEGER_ARRAY(_name_, _type_, _val_) \ | 208 | #define PROPERTY_ENTRY_INTEGER_ARRAY(_name_, _type_, _val_) \ |
| 209 | { \ | 209 | (struct property_entry) { \ |
| 210 | .name = _name_, \ | 210 | .name = _name_, \ |
| 211 | .length = ARRAY_SIZE(_val_) * sizeof(_type_), \ | 211 | .length = ARRAY_SIZE(_val_) * sizeof(_type_), \ |
| 212 | .is_array = true, \ | 212 | .is_array = true, \ |
| @@ -224,7 +224,7 @@ struct property_entry { | |||
| 224 | PROPERTY_ENTRY_INTEGER_ARRAY(_name_, u64, _val_) | 224 | PROPERTY_ENTRY_INTEGER_ARRAY(_name_, u64, _val_) |
| 225 | 225 | ||
| 226 | #define PROPERTY_ENTRY_STRING_ARRAY(_name_, _val_) \ | 226 | #define PROPERTY_ENTRY_STRING_ARRAY(_name_, _val_) \ |
| 227 | { \ | 227 | (struct property_entry) { \ |
| 228 | .name = _name_, \ | 228 | .name = _name_, \ |
| 229 | .length = ARRAY_SIZE(_val_) * sizeof(const char *), \ | 229 | .length = ARRAY_SIZE(_val_) * sizeof(const char *), \ |
| 230 | .is_array = true, \ | 230 | .is_array = true, \ |
| @@ -233,7 +233,7 @@ struct property_entry { | |||
| 233 | } | 233 | } |
| 234 | 234 | ||
| 235 | #define PROPERTY_ENTRY_INTEGER(_name_, _type_, _val_) \ | 235 | #define PROPERTY_ENTRY_INTEGER(_name_, _type_, _val_) \ |
| 236 | { \ | 236 | (struct property_entry) { \ |
| 237 | .name = _name_, \ | 237 | .name = _name_, \ |
| 238 | .length = sizeof(_type_), \ | 238 | .length = sizeof(_type_), \ |
| 239 | .is_string = false, \ | 239 | .is_string = false, \ |
| @@ -250,7 +250,7 @@ struct property_entry { | |||
| 250 | PROPERTY_ENTRY_INTEGER(_name_, u64, _val_) | 250 | PROPERTY_ENTRY_INTEGER(_name_, u64, _val_) |
| 251 | 251 | ||
| 252 | #define PROPERTY_ENTRY_STRING(_name_, _val_) \ | 252 | #define PROPERTY_ENTRY_STRING(_name_, _val_) \ |
| 253 | { \ | 253 | (struct property_entry) { \ |
| 254 | .name = _name_, \ | 254 | .name = _name_, \ |
| 255 | .length = sizeof(_val_), \ | 255 | .length = sizeof(_val_), \ |
| 256 | .is_string = true, \ | 256 | .is_string = true, \ |
| @@ -258,7 +258,7 @@ struct property_entry { | |||
| 258 | } | 258 | } |
| 259 | 259 | ||
| 260 | #define PROPERTY_ENTRY_BOOL(_name_) \ | 260 | #define PROPERTY_ENTRY_BOOL(_name_) \ |
| 261 | { \ | 261 | (struct property_entry) { \ |
| 262 | .name = _name_, \ | 262 | .name = _name_, \ |
| 263 | } | 263 | } |
| 264 | 264 | ||
