From 8c2f65f1d7bb104dc5b384f03f4d1acc9cdaf3b7 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 54149ce679be4..c24f684022fd0 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -1945,7 +1945,7 @@ alloc_nohuge: 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; -- 2.39.5