From: Čestmír Kalina <ckalina(a)redhat.com>
kabi: fix RH_KABI_SET_SIZE macro
Bugzilla:
https://bugzilla.redhat.com/show_bug.cgi?id=2024595
Upstream Status: RHEL only
commit ce96bb000b3a603533f885485bd875eb7dfbfff2
Author: Jiri Benc <jbenc(a)redhat.com>
Author: Ivan Vecera <ivecera(a)redhat.com>
Date: Wed, 1 Apr 2020 13:04:10 -0400
The current implementation of RH_KABI_SET_SIZE() macro does not allow
to pass certain expressions as an argument.
E.g.
RH_KABI_SET_SIZE(&cq->napi, napi_struct_extended) is expanded to:
&cq->napi->napi_struct_extended_size_rh = sizeof(struct ...)
and this is not correct and should be:
(&cq->napi)->napi_struct_extended_size_rh = sizeof(struct ...)
The patch fixes the macro this way.
RH-Signed-off-by: Ivan Vecera <ivecera(a)redhat.com>
Signed-off-by: Čestmír Kalina <ckalina(a)redhat.com>
Signed-off-by: Prarit Bhargava <prarit(a)redhat.com>
diff --git a/include/linux/rh_kabi.h b/include/linux/rh_kabi.h
index blahblah..blahblah 100644
--- a/include/linux/rh_kabi.h
+++ b/include/linux/rh_kabi.h
@@ -398,7 +398,7 @@
* a semicolon is necessary at the end of the line where it is invoked.
*/
#define RH_KABI_SET_SIZE(_name, _struct) ({ \
- _name->_struct##_size_rh = sizeof(struct _struct##_rh); \
+ (_name)->_struct##_size_rh = sizeof(struct _struct##_rh); \
})
/*
--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1530