[OS-BUILD PATCH 11/18] kabi: fix RH_KABI_SET_SIZE macro

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Čestmír Kalina <ckalina@xxxxxxxxxx>

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@xxxxxxxxxx>
Author: Ivan Vecera <ivecera@xxxxxxxxxx>
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@xxxxxxxxxx>

Signed-off-by: Čestmír Kalina <ckalina@xxxxxxxxxx>
Signed-off-by: Prarit Bhargava <prarit@xxxxxxxxxx>

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
_______________________________________________
kernel mailing list -- kernel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to kernel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/kernel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure




[Index of Archives]     [Fedora General Discussion]     [Older Fedora Users Archive]     [Fedora Advisory Board]     [Fedora Security]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Mentors]     [Fedora Package Announce]     [Fedora Package Review]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Coolkey]     [Yum Users]     [Tux]     [Yosemite News]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [USB]     [Asterisk PBX]

  Powered by Linux