On 2024/9/13 23:09, Matthew Wilcox wrote:
On Fri, Sep 13, 2024 at 07:45:55PM +0800, Yi Liu wrote:
No test cases for the test suite? ;-(
let me add something like the below. :)
That looks pretty comprehensive, thanks!
Acked-by: Matthew Wilcox (Oracle) willy@infradead.org
thanks, and FYI. I found a bug when running the unit test. will fix it in the next version. it's really helpful suggestion.
diff --git a/lib/idr.c b/lib/idr.c index 6644d3d1af02..f16eb3d172bc 100644 --- a/lib/idr.c +++ b/lib/idr.c @@ -494,6 +494,7 @@ int ida_find_first_range(struct ida *ida, unsigned int min, unsigned int max) unsigned int offset = min % IDA_BITMAP_BITS; unsigned long *addr, size, bit; unsigned long flags; + unsigned long tmp = 0; void *entry; int ret;
@@ -518,8 +519,7 @@ int ida_find_first_range(struct ida *ida, unsigned int min, unsigned int max) }
if (xa_is_value(entry)) { - unsigned long tmp = xa_to_value(entry); - + tmp = xa_to_value(entry); addr = &tmp; size = BITS_PER_XA_VALUE; } else {