Re: [PATCH] check_ida_alloc: Add a new check to spot invalid conversion from ida_simple_get()
Dan Carpenter <[email protected]> Fri, 10 Jun 2022 13:25:03 +0300
| Newsgroups | org.kernel.vger.smatch |
|---|---|
| Message-ID | <20220610102503.GC2146@kadam> |
On Thu, Jun 09, 2022 at 10:33:40PM +0200, Christophe JAILLET wrote: > The 'max' parameter of ida_alloc_max() and ida_alloc_range() is not > interpreted as it was in the deprecated ida_simple_get(). > > The 'max' value in the new functions is inclusive but it was exclusive > before. So, in older code, this parameter was often a power of 2, such as > 1 << 16, so that the maximum possible value was 0xffff. > > Now a power of 2 value is spurious. > > Signed-off-by: Christophe JAILLET <[email protected]> > --- > Most of the code is stolen from smatch_power_of_two.c > --- Thanks, applied! regards, dan carpenter