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
  • switchdev
  • switchdev.c
Find file BlameHistoryPermalink
  • Minghao Chi (CGEL ZTE)'s avatar
    net/switchdev: use struct_size over open coded arithmetic · d8c28581
    Minghao Chi (CGEL ZTE) authored Feb 10, 2022
    
    
    Replace zero-length array with flexible-array member and make use
    of the struct_size() helper in kmalloc(). For example:
    
    struct switchdev_deferred_item {
        ...
        unsigned long data[];
    };
    
    Make use of the struct_size() helper instead of an open-coded version
    in order to avoid any potential type mistakes.
    
    Reported-by: default avatarZeal Robot <zealci@zte.com.cn>
    Signed-off-by: default avatarMinghao Chi (CGEL ZTE) <chi.minghao@zte.com.cn>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    d8c28581
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7