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
  • prandom.h
Find file BlameHistoryPermalink
  • Richard Fitzgerald's avatar
    random32: Fix implicit truncation warning in prandom_seed_state() · d327ea15
    Richard Fitzgerald authored May 25, 2021
    
    
    sparse generates the following warning:
    
     include/linux/prandom.h:114:45: sparse: sparse: cast truncates bits from
     constant value
    
    This is because the 64-bit seed value is manipulated and then placed in a
    u32, causing an implicit cast and truncation. A forced cast to u32 doesn't
    prevent this warning, which is reasonable because a typecast doesn't prove
    that truncation was expected.
    
    Logical-AND the value with 0xffffffff to make explicit that truncation to
    32-bit is intended.
    
    Reported-by: default avatarkernel test robot <lkp@intel.com>
    Signed-off-by: default avatarRichard Fitzgerald <rf@opensource.cirrus.com>
    Reviewed-by: default avatarPetr Mladek <pmladek@suse.com>
    Signed-off-by: default avatarPetr Mladek <pmladek@suse.com>
    Link: https://lore.kernel.org/r/20210525122012.6336-3-rf@opensource.cirrus.com
    d327ea15
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7