[PATCH] erofs: silence warnings related to impossible m_plen

Chao Yu chao at kernel.org
Fri Mar 11 19:23:58 AEDT 2022


On 2022/3/11 1:34, Gao Xiang wrote:
> Dan reported two smatch warnings [1],
> .. warn: should '1 << lclusterbits' be a 64 bit type?
> .. warn: should 'm->compressedlcs << lclusterbits' be a 64 bit type?
> 
> In practice, m_plen cannot be more than 1MiB due to on-disk constraint
> for the compression mode, so we're always safe here.
> 
> In order to make static analyzers happy and don't report again,
> let's silence them instead.
> 
> [1] https://lore.kernel.org/r/202203091002.lJVzsX6e-lkp@intel.com
> 
> Reported-by: kernel test robot <lkp at intel.com>
> Reported-by: Dan Carpenter <dan.carpenter at oracle.com>
> Signed-off-by: Gao Xiang <hsiangkao at linux.alibaba.com>

Reviewed-by: Chao Yu <chao at kernel.org>

Thanks,


More information about the Linux-erofs mailing list