Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • L linux
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Kirill Smelkov
  • linux
  • Repository
You need to sign in or sign up before continuing.
  • linux
  • include
  • linux
  • moduleparam.h
Find file BlameHistoryPermalink
  • Johan Hovold's avatar
    params: use type alignment for kernel parameters · fe2f4fe1
    Johan Hovold authored Nov 23, 2020
    Specify type alignment for kernel parameters instead of sizeof(void *).
    
    The alignment attribute is used to prevent gcc from increasing the
    alignment of objects with static extent as an optimisation, something
    which would mess up the __param array stride.
    
    Using __alignof__(struct kernel_param) rather than sizeof(void *) is
    preferred since it better indicates why it is there and doesn't break
    should the type size or alignment change.
    
    Note that on m68k the alignment of struct kernel_param is actually two
    and that adding a 1- or 2-byte field to the 20-byte struct would cause a
    breakage with the current 4-byte alignment.
    
    Link: https://lore.kernel.org/lkml/20201103175711.10731-1-johan@kernel.org
    
    
    Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
    Signed-off-by: default avatarJessica Yu <jeyu@kernel.org>
    fe2f4fe1
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7