On 01/22/2018 08:26 AM, Corey Minyard wrote:
On 01/22/2018 06:56 AM, Andy Shevchenko wrote:
Replace home grown set_prop_entry() macro by generic
PROPERTY_ENTRY_INTEGER()-like ones.

Cc: Corey Minyard <cminy...@mvista.com>
Signed-off-by: Andy Shevchenko <andriy.shevche...@linux.intel.com>

Looks good, queued for next release.


Well, I take that back:

   In file included from ../include/linux/acpi.h:28:0,
                     from ../include/linux/ipmi.h:40,
                     from ../drivers/char/ipmi/ipmi_dmi.c:7:
   ../drivers/char/ipmi/ipmi_dmi.c: In function ‘dmi_add_platform_ipmi’:
   ../include/linux/property.h:236:1: error: expected expression before
   ‘{’ token
     {       \
     ^
   ../include/linux/property.h:244:2: note: in expansion of macro
   ‘PROPERTY_ENTRY_INTEGER’
      PROPERTY_ENTRY_INTEGER(_name_, u8, _val_)
      ^
   ../drivers/char/ipmi/ipmi_dmi.c:79:15: note: in expansion of macro
   ‘PROPERTY_ENTRY_U8’
       p[pidx++] = PROPERTY_ENTRY_U8("ipmi-type", si_type);
                   ^
   ../include/linux/property.h:236:1: error: expected expression before
   ‘{’ token
     {       \
     ^
   ../include/linux/property.h:244:2: note: in expansion of macro
   ‘PROPERTY_ENTRY_INTEGER’
      PROPERTY_ENTRY_INTEGER(_name_, u8, _val_)
      ^
   ../drivers/char/ipmi/ipmi_dmi.c:81:14: note: in expansion of macro
   ‘PROPERTY_ENTRY_U8’
      p[pidx++] = PROPERTY_ENTRY_U8("slave-addr", slave_addr);

You can't make that assignment, at least with the compiler that I'm using.

Maybe my macro should be added to property.h?

-corey

-corey

---
  drivers/char/ipmi/ipmi_dmi.c | 18 +++++-------------
  1 file changed, 5 insertions(+), 13 deletions(-)

diff --git a/drivers/char/ipmi/ipmi_dmi.c b/drivers/char/ipmi/ipmi_dmi.c
index ab78b3be7e33..d29e7f8e4376 100644
--- a/drivers/char/ipmi/ipmi_dmi.c
+++ b/drivers/char/ipmi/ipmi_dmi.c
@@ -29,15 +29,6 @@ static struct ipmi_dmi_info *ipmi_dmi_infos;
    static int ipmi_dmi_nr __initdata;
  -#define set_prop_entry(_p_, _name_, type, val)    \
-do {                    \
-    struct property_entry *_p = &_p_;    \
-    _p->name = _name_;            \
-    _p->length = sizeof(type);        \
-    _p->is_string = false;            \
-    _p->value.type##_data = val;        \
-} while(0)
-
  static void __init dmi_add_platform_ipmi(unsigned long base_addr,
                       u32 flags,
                       u8 slave_addr,
@@ -85,9 +76,10 @@ static void __init dmi_add_platform_ipmi(unsigned long base_addr,
      }
        if (si_type != SI_TYPE_INVALID)
-        set_prop_entry(p[pidx++], "ipmi-type", u8, si_type);
-    set_prop_entry(p[pidx++], "slave-addr", u8, slave_addr);
-    set_prop_entry(p[pidx++], "addr-source", u8, SI_SMBIOS);
+        p[pidx++] = PROPERTY_ENTRY_U8("ipmi-type", si_type);
+
+    p[pidx++] = PROPERTY_ENTRY_U8("slave-addr", slave_addr);
+    p[pidx++] = PROPERTY_ENTRY_U8("addr-source", SI_SMBIOS);
        info = kmalloc(sizeof(*info), GFP_KERNEL);
      if (!info) {
@@ -109,7 +101,7 @@ static void __init dmi_add_platform_ipmi(unsigned long base_addr,
      pdev->driver_override = override;
        if (type == IPMI_DMI_TYPE_SSIF) {
-        set_prop_entry(p[pidx++], "i2c-addr", u16, base_addr);
+        p[pidx++] = PROPERTY_ENTRY_U16("i2c-addr", base_addr);
          goto add_properties;
      }



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Openipmi-developer mailing list
Openipmi-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openipmi-developer



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Openipmi-developer mailing list
Openipmi-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openipmi-developer

Reply via email to