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
  • kernel
  • profile.c
Find file BlameHistoryPermalink
  • Nathan Chancellor's avatar
    kernel/profile.c: use cpumask_available to check for NULL cpumask · ef70eff9
    Nathan Chancellor authored Dec 04, 2019
    When building with clang + -Wtautological-pointer-compare, these
    instances pop up:
    
      kernel/profile.c:339:6: warning: comparison of array 'prof_cpu_mask' not equal to a null pointer is always true [-Wtautological-pointer-compare]
              if (prof_cpu_mask != NULL)
                  ^~~~~~~~~~~~~    ~~~~
      kernel/profile.c:376:6: warning: comparison of array 'prof_cpu_mask' not equal to a null pointer is always true [-Wtautological-pointer-compare]
              if (prof_cpu_mask != NULL)
                  ^~~~~~~~~~~~~    ~~~~
      kernel/profile.c:406:26: warning: comparison of array 'prof_cpu_mask' not equal to a null pointer is always true [-Wtautological-pointer-compare]
              if (!user_mode(regs) && prof_cpu_mask != NULL &&
                                    ^~~~~~~~~~~~~    ~~~~
      3 warnings generated.
    
    This can be addressed with the cpumask_available helper, introduced in
    commit f7e30f01 ("cpumask: Add helper cpumask_available()") to fix
    warnings like this while keeping the code the same.
    
    Link: https://github.com/ClangBuiltLinux/linux/issues/747
    Link: http://lkml.kernel.org/r/20191022191957.9554-1-natechancellor@gmail.com
    
    
    Signed-off-by: default avatarNathan Chancellor <natechancellor@gmail.com>
    Reviewed-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    ef70eff9
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7