Skip to content

Commit 592ea37

Browse files
andy-shevgregkh
authored andcommitted
device property: Define type of PROPERTY_ENRTY_*() macros
[ Upstream commit c505cbd ] 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 <[email protected]> Cc: Corey Minyard <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent c5fda2b commit 592ea37

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

include/linux/property.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ struct property_entry {
206206
*/
207207

208208
#define PROPERTY_ENTRY_INTEGER_ARRAY(_name_, _type_, _val_) \
209-
{ \
209+
(struct property_entry) { \
210210
.name = _name_, \
211211
.length = ARRAY_SIZE(_val_) * sizeof(_type_), \
212212
.is_array = true, \
@@ -224,7 +224,7 @@ struct property_entry {
224224
PROPERTY_ENTRY_INTEGER_ARRAY(_name_, u64, _val_)
225225

226226
#define PROPERTY_ENTRY_STRING_ARRAY(_name_, _val_) \
227-
{ \
227+
(struct property_entry) { \
228228
.name = _name_, \
229229
.length = ARRAY_SIZE(_val_) * sizeof(const char *), \
230230
.is_array = true, \
@@ -233,7 +233,7 @@ struct property_entry {
233233
}
234234

235235
#define PROPERTY_ENTRY_INTEGER(_name_, _type_, _val_) \
236-
{ \
236+
(struct property_entry) { \
237237
.name = _name_, \
238238
.length = sizeof(_type_), \
239239
.is_string = false, \
@@ -250,15 +250,15 @@ struct property_entry {
250250
PROPERTY_ENTRY_INTEGER(_name_, u64, _val_)
251251

252252
#define PROPERTY_ENTRY_STRING(_name_, _val_) \
253-
{ \
253+
(struct property_entry) { \
254254
.name = _name_, \
255255
.length = sizeof(_val_), \
256256
.is_string = true, \
257257
{ .value = { .str = _val_ } }, \
258258
}
259259

260260
#define PROPERTY_ENTRY_BOOL(_name_) \
261-
{ \
261+
(struct property_entry) { \
262262
.name = _name_, \
263263
}
264264

0 commit comments

Comments
 (0)