From fa020a2b87d24016723fff4a4237deb612478a32 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Wed, 25 May 2022 15:17:09 -0700 Subject: [PATCH] mm/shmem.c: suppress shift warning 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 Reported-by: Jessica Clarke Signed-off-by: Andrew Morton --- mm/shmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/shmem.c b/mm/shmem.c index 54149ce679be4f..c24f684022fd04 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -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;