[Skiboot] [PATCH] hw/ipmi: Fix misleading-indentation failures
Vasant Hegde
hegdevasant at linux.vnet.ibm.com
Mon Apr 5 21:13:47 AEST 2021
Hitting below issue on recent distro (fedora-rawhide).
sample failure:
---------------
[ HOSTCC ] hw/ipmi/test/run-fru.c
In file included from hw/ipmi/test/run-fru.c:10:
hw/ipmi/test/../ipmi-fru.c: In function 'fru_fill_product_info':
hw/ipmi/test/../ipmi-fru.c:80:17: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
80 | if (rc < 1) return OPAL_PARAMETER; rc; })
| ^~
hw/ipmi/test/../ipmi-fru.c:102:18: note: in expansion of macro 'FRU_INSERT_STRING'
102 | index += FRU_INSERT_STRING(&buf[index], info->manufacturer);
| ^~~~~~~~~~~~~~~~~
hw/ipmi/test/../ipmi-fru.c:80:52: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
80 | if (rc < 1) return OPAL_PARAMETER; rc; })
| ^~
hw/ipmi/test/../ipmi-fru.c:102:18: note: in expansion of macro 'FRU_INSERT_STRING'
102 | index += FRU_INSERT_STRING(&buf[index], info->manufacturer);
| ^~~~~~~~~~~~~~~~~
Signed-off-by: Vasant Hegde <hegdevasant at linux.vnet.ibm.com>
---
hw/ipmi/ipmi-fru.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/ipmi/ipmi-fru.c b/hw/ipmi/ipmi-fru.c
index da866adb5..86c9ca0ce 100644
--- a/hw/ipmi/ipmi-fru.c
+++ b/hw/ipmi/ipmi-fru.c
@@ -77,7 +77,7 @@ static u8 fru_checksum(u8 *buf, int len)
#define FRU_INSERT_STRING(x, y) \
({ rc = fru_insert_string(x, y); \
- if (rc < 1) return OPAL_PARAMETER; rc; })
+ { if (rc < 1) return OPAL_PARAMETER; } rc; })
static int fru_fill_product_info(u8 *buf, struct product_info *info, size_t size)
{
--
2.26.2
More information about the Skiboot
mailing list