cxl/mem: Correct full ID range allocation
authorDavidlohr Bueso <dave@stgolabs.net>
Wed, 8 Feb 2023 18:19:44 +0000 (10:19 -0800)
committerDan Williams <dan.j.williams@intel.com>
Thu, 9 Feb 2023 16:46:10 +0000 (08:46 -0800)
commitd874297bc7c8bb69f9fcbe6422ac5623c5897977
treec1600bbbe63f063eb8aaf5eb76bd01be9d3ca8b9
parent623c0751336e4035ab0047f2c152a02bd26b612b
cxl/mem: Correct full ID range allocation

For ID allocations we want 0-(max-1), ie: smatch complains:

 error: Calling ida_alloc_range() with a 'max' argument which is a power of 2. -1 missing?

Correct this and also replace the call to use the max() flavor instead.

Signed-off-by: Davidlohr Bueso <dave@stgolabs.net>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Link: https://lore.kernel.org/r/20230208181944.240261-1-dave@stgolabs.net
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/cxl/core/memdev.c