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
  • include
  • linux
  • intel_rapl.h
Find file BlameHistoryPermalink
  • Zhang Rui's avatar
    powercap: intel_rapl: Fix a sparse warning in TPMI interface · 16e95a62
    Zhang Rui authored Jul 25, 2023
    
    
    Depends on the interface used, the RAPL registers can be either MSR
    indexes or memory mapped IO addresses. Current RAPL common code uses u64
    to save both MSR and memory mapped IO registers. With this, when
    handling register address with an __iomem annotation, it triggers a
    sparse warning like below:
    
    sparse warnings: (new ones prefixed by >>)
    >> drivers/powercap/intel_rapl_tpmi.c:141:41: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected unsigned long long [usertype] *tpmi_rapl_regs @@     got void [noderef] __iomem * @@
       drivers/powercap/intel_rapl_tpmi.c:141:41: sparse:     expected unsigned long long [usertype] *tpmi_rapl_regs
       drivers/powercap/intel_rapl_tpmi.c:141:41: sparse:     got void [noderef] __iomem *
    
    Fix the problem by using a union to save the registers instead.
    
    Suggested-by: default avatarDavid Laight <David.Laight@ACULAB.COM>
    Reported-by: default avatarkernel test robot <lkp@intel.com>
    Closes: https://lore.kernel.org/oe-kbuild-all/202307031405.dy3druuy-lkp@intel.com/
    
    
    Tested-by: default avatarWang Wendy <wendy.wang@intel.com>
    Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
    [ rjw: Subject and changelog edits ]
    Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    16e95a62
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7