[OS-BUILD PATCH 13/18] kabi: use fixed field name for extended part

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

 



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

kabi: use fixed field name for extended part

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2024595
Upstream Status: RHEL only

commit 620b222e839dc20ce33b86ed7657903335cfbad1
Author: Jiri Benc <jbenc@xxxxxxxxxx>
Author: Ivan Vecera <ivecera@xxxxxxxxxx>
Date: Wed, 1 Apr 2020 13:04:12 -0400

    The current RH_KABI_SIZE_AND_EXTEND* macros uses passed structure name
    as a prefix for the field used for access to the extended area.

    Example:

    struct napi_struct_extend {
        int ex_field;
    };
    struct napi_struct {
        ...
        RH_KABI_SIZE_AND_EXTEND(napi_struct_extend)
    };

    Unfortunately the generated field name is very long and when you need to
    access any field in extended part of napi_struct you need to use this
    horrible construct:

    napi->napi_struct_extend.ex_field;

    As RH_KABI_SIZE_AND_EXTEND* should not be used more than once in
    a structure we can use a short fixed name to access an extended area.
    The patch modifies the affected macros so '._rh' is used as a name
    for this field so the field from the previous example will be referenced
    as:

    napi->_rh.ex_field;

    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
@@ -378,13 +378,13 @@
  */
 #define _RH_KABI_SIZE_AND_EXTEND_PTR(_struct)				\
 	size_t _struct##_size_rh;					\
-	RH_KABI_EXCLUDE(struct _struct##_rh *_struct##_rh)
+	RH_KABI_EXCLUDE(struct _struct##_rh *_rh)
 #define RH_KABI_SIZE_AND_EXTEND_PTR(_struct)				\
 	_RH_KABI_SIZE_AND_EXTEND_PTR(_struct)
 
 #define _RH_KABI_SIZE_AND_EXTEND(_struct)				\
 	size_t _struct##_size_rh;					\
-	RH_KABI_EXCLUDE(struct _struct##_rh _struct##_rh)
+	RH_KABI_EXCLUDE(struct _struct##_rh _rh)
 #define RH_KABI_SIZE_AND_EXTEND(_struct)				\
 	_RH_KABI_SIZE_AND_EXTEND(_struct)
 

--
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