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
  • linux
  • net
  • core
  • dev.c
Find file BlameHistoryPermalink
  • Alexander Lobakin's avatar
    netdevice: convert private flags > BIT(31) to bitfields · beb5a9be
    Alexander Lobakin authored Aug 29, 2024
    
    
    Make dev->priv_flags `u32` back and define bits higher than 31 as
    bitfield booleans as per Jakub's suggestion. This simplifies code
    which accesses these bits with no optimization loss (testb both
    before/after), allows to not extend &netdev_priv_flags each time,
    but also scales better as bits > 63 in the future would only add
    a new u64 to the structure with no complications, comparing to
    that extending ::priv_flags would require converting it to a bitmap.
    Note that I picked `unsigned long :1` to not lose any potential
    optimizations comparing to `bool :1` etc.
    
    Suggested-by: default avatarJakub Kicinski <kuba@kernel.org>
    Signed-off-by: default avatarAlexander Lobakin <aleksander.lobakin@intel.com>
    Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
    beb5a9be
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7