Powered by Linux
Re: [PATCH] check_ida_alloc: Improve check to not warn when min is '1' — Semantic Matching Tool

Re: [PATCH] check_ida_alloc: Improve check to not warn when min is '1'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Oct 26, 2023 at 05:01:17AM -0700, Harshit Mogalapalli wrote:
> This check warns when the max argument of ida_alloc_range is not of the
> the form "2^x-1".
> 
> It is fine to not warn when min argument is 1 and max argument is a
> power of 2.
> 
> Before this patch:
> drivers/net/ethernet/mellanox/mlx5/core/lib/macsec_fs.c:587 macsec_fs_tx_setup_fte() error: Calling ida_alloc_range() with a 'max' argument which is a power of 2. -1 missing?
> 
> After this patch:
> Smatch will not warn as the min argument is one.
> 
> Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@xxxxxxxxxx>

Right.  Because people count from 0-9 or 1-10 but not 0-10.

Applied.  Thanks!

I'll probably push this tomorrow.

regards,
dan carpenter




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux