Re: [PATCH] check_ida_alloc: Improve check to not warn when min is '1'
Dan Carpenter <[email protected]> Thu, 26 Oct 2023 15:27:07 +0300
| Newsgroups | org.kernel.vger.smatch |
|---|---|
| Message-ID | <[email protected]> |
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 <[email protected]> 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