Skip to content

Commit

Permalink
mm/shmem.c: suppress shift warning
Browse files Browse the repository at this point in the history
mm/shmem.c:1948 shmem_getpage_gfp() warn: should '(((1) << 12) / 512) << folio_order(folio)' be a 64 bit type?

On i386, so an unsigned long is 32-bit, but i_blocks is a 64-bit blkcnt_t.

Reported-by: kernel test robot <[email protected]>
Reported-by: Jessica Clarke <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
akpm00 committed May 27, 2022
1 parent 0710d01 commit fa020a2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mm/shmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -1945,7 +1945,7 @@ static int shmem_getpage_gfp(struct inode *inode, pgoff_t index,

spin_lock_irq(&info->lock);
info->alloced += folio_nr_pages(folio);
inode->i_blocks += BLOCKS_PER_PAGE << folio_order(folio);
inode->i_blocks += (blkcnt_t)BLOCKS_PER_PAGE << folio_order(folio);
shmem_recalc_inode(inode);
spin_unlock_irq(&info->lock);
alloced = true;
Expand Down

0 comments on commit fa020a2

Please sign in to comment.