Re: [PATCH v3 1/4] ida: Add ida_find_first_range()

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

 



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@xxxxxxxxxxxxx>

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 {

--
Regards,
Yi Liu




[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux