From: Andrew Morton Date: Wed, 25 May 2022 22:17:09 +0000 (-0700) Subject: mm/shmem.c: suppress shift warning X-Git-Tag: for-5.19/block-exec-2022-06-02~9^2 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=fa020a2b87d24016723fff4a4237deb612478a32;p=linux-block.git 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 --- diff --git a/mm/shmem.c b/mm/shmem.c index 54149ce679be..c24f684022fd 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;