From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-dm3nam03on0092.outbound.protection.outlook.com ([104.47.41.92]:13920 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754958AbeDIAXy (ORCPT ); Sun, 8 Apr 2018 20:23:54 -0400 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Andy Shevchenko , Corey Minyard , Greg Kroah-Hartman , Sasha Levin Subject: [PATCH AUTOSEL for 4.14 077/161] device property: Define type of PROPERTY_ENRTY_*() macros Date: Mon, 9 Apr 2018 00:20:49 +0000 Message-ID: <20180409001936.162706-77-alexander.levin@microsoft.com> References: <20180409001936.162706-1-alexander.levin@microsoft.com> In-Reply-To: <20180409001936.162706-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Andy Shevchenko [ Upstream commit c505cbd45f6e9c539d57dd171d95ec7e5e9f9cd0 ] Some of the drivers may use the macro at runtime flow, like struct property_entry p[10]; ... p[index++] =3D 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 Cc: Corey Minyard Signed-off-by: Andy Shevchenko Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- 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 6bebee13c5e0..89d94b349912 100644 --- a/include/linux/property.h +++ b/include/linux/property.h @@ -206,7 +206,7 @@ struct property_entry { */ =20 #define PROPERTY_ENTRY_INTEGER_ARRAY(_name_, _type_, _val_) \ -{ \ +(struct property_entry) { \ .name =3D _name_, \ .length =3D ARRAY_SIZE(_val_) * sizeof(_type_), \ .is_array =3D true, \ @@ -224,7 +224,7 @@ struct property_entry { PROPERTY_ENTRY_INTEGER_ARRAY(_name_, u64, _val_) =20 #define PROPERTY_ENTRY_STRING_ARRAY(_name_, _val_) \ -{ \ +(struct property_entry) { \ .name =3D _name_, \ .length =3D ARRAY_SIZE(_val_) * sizeof(const char *), \ .is_array =3D true, \ @@ -233,7 +233,7 @@ struct property_entry { } =20 #define PROPERTY_ENTRY_INTEGER(_name_, _type_, _val_) \ -{ \ +(struct property_entry) { \ .name =3D _name_, \ .length =3D sizeof(_type_), \ .is_string =3D false, \ @@ -250,7 +250,7 @@ struct property_entry { PROPERTY_ENTRY_INTEGER(_name_, u64, _val_) =20 #define PROPERTY_ENTRY_STRING(_name_, _val_) \ -{ \ +(struct property_entry) { \ .name =3D _name_, \ .length =3D sizeof(_val_), \ .is_string =3D true, \ @@ -258,7 +258,7 @@ struct property_entry { } =20 #define PROPERTY_ENTRY_BOOL(_name_) \ -{ \ +(struct property_entry) { \ .name =3D _name_, \ } =20 --=20 2.15.1