From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yx1-f44.google.com (mail-yx1-f44.google.com [74.125.224.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2E4711A680B for ; Fri, 19 Jun 2026 14:01:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.224.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781877670; cv=none; b=d42qX1MnxUtrSh0pDCXYIEQX/sBmaaQoq8oemH5C0GInSdUy0zmAZWzgPemShvLKzKPcFv/1iW115UDmC8s8cJfNZJBDoQtucu3xdxjEHAIPoS/3uUji7XDyH93R9nT2LHeXzUC955Ue/A/sBH5yT4m0DSbxQIfQfyI3lrYSli4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781877670; c=relaxed/simple; bh=AEdbL5ICaJ1PyyVddVej+xiLbBlUdDsdjZ0vGBbTw44=; h=From:Date:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=BWeY10w8upZJU6rr+wIqUhB4as2zZwdBEPEseNw3IW6jHK4Dr0G8M9J/yd8l0wvxAQiUaVX8A273e38NXtej3zMz9j1nGS+6DEH6f8amXfjHGAPaisn3bHVHoBue7usgbJzEho7PHopsILJ2Xyf/Crgf55PSeNfFDdGn5BgQyRs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=YsI556mD; arc=none smtp.client-ip=74.125.224.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="YsI556mD" Received: by mail-yx1-f44.google.com with SMTP id 956f58d0204a3-66310a69f65so110023d50.2 for ; Fri, 19 Jun 2026 07:01:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781877668; x=1782482468; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:date:from:from:to :cc:subject:date:message-id:reply-to; bh=yebTZMiQHX5D1zjTOVboH/X7oe2sXhzeCEnf1ibvrdY=; b=YsI556mDZkD0JZoFia2LK9ufucwHw9Fjf1f9LkXcFAAjyIR7Fb6WKFG0lZNWy2b7RL fYok+7bRIQn02h/5MGshHWMnyM7H2dHEMRq+ixkvbwyFeiGkhRyFORQDtf0dVEfbSBZW t9ZrKaP8QigaybL2QmQe5NWgs/owHxsVAqTf11gWf1YlGS7kpNTMX51AgH9+rHxrDrkl 0imT3tdrd2x/b9c4q5En0QhIrDGgL5lOTn04YARoqGotV4L2NMFMKpjt4VeKZ3UxcagP YUCVaf/5jaxIWb8QWiehNy5qzabV5s/geaGbsDaa6O8iha3aUG7YiCOSUwtkz3TfFE0O 1+YA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781877668; x=1782482468; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=yebTZMiQHX5D1zjTOVboH/X7oe2sXhzeCEnf1ibvrdY=; b=my9KPrZhOXX6vf9p4agBQocoKlmgPA2IYq4KgJRo4k9Cpm0HLSyaFDZwPfGzUSI4gi QlbS8ddP8yny4sPTm0ibcSo7HZCUrtst0VanYJWc6lXXr+6QL9UhNEGz/1aHUeft/LRk yx3j9IzvIO9wr6bB/k0dT/GbuVWGAUlcjFUzOfiePjiK4kFjseEeltq1gF5YAG6niTTN dXmNWyeLOE+JezT9607T4+T+Uib27+9kspcSptz+o6J3U868+Sb1WAw1HDMAYqPGyLwA ir6dryZCLTv+ViuW1++vS9niDaEjH9MfTsQTAs55yGTYYi21ltnBu7JF9skqzXAK6B/N rhkQ== X-Forwarded-Encrypted: i=1; AFNElJ9I5FQJVBhYbMJ1A4eHOBXKczgzDQ9dXpFuJ6y9rDfCzLNW6xnmxGhlybaonEG7q/rie0UGKiQLftGHkNo=@vger.kernel.org X-Gm-Message-State: AOJu0Ywipamrf5oCzKKGojMWIosj65hDybxiNxI6OjHehAFCS8qTjUC9 JFohX+sFZMVafhl5u0Z4/AFsapYkG6o82TZ9w+piOyIO810sOSs/HCEk X-Gm-Gg: AfdE7cl7HZNd3SKiGDESWgC4Lu4gdxjogZAvk1PsBVQXJISOt3MFLtV6+gvSPR5Mu1I 4MPhw/ISuXmhmQAeVnS3J1jt5OOm3W8Ry2uZ7NAFqnt+gQ4Nuyyi3FUqe9iYkWhcFpdExoxSBM5 vCGFVGe0Am6WWV9Je0QK0xZKJcEOXrdI3U23ZiclJ/h+z1Ah4cpLbcm1TTnHKt3sQf/w7qYjJZd DL6X+2H8QpItkofSUNdwotek9yYAgTGpcLkRwLuTe2U6qvQ3q/jj8vWcYgGM9s0Ix/q3cZ+lvXn dAHFvyTSQLmZrIVLcrdAOhnDVysWAq/ikszB2n3sfyuQF8reSvwn/aj3268dKkGdPn50/ZfGypE yXaBmF+4dv949QUPTa1D1/vIDdhv8dQkOTO7lKzL5VVyXsWvquS/Qu0b+wOWA0YtmID8PDMLPxX qEXD86+5jXrriuMf2TPnGo+XRJH5QmuN+HyvV105a4T9Uy7Q== X-Received: by 2002:a05:690c:7205:b0:800:3647:10af with SMTP id 00721157ae682-801761c900amr23093107b3.15.1781877668029; Fri, 19 Jun 2026 07:01:08 -0700 (PDT) Received: from localhost (syn-035-130-123-074.biz.spectrum.com. [35.130.123.74]) by smtp.gmail.com with ESMTPSA id 00721157ae682-8011d600167sm11603727b3.40.2026.06.19.07.01.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jun 2026 07:01:05 -0700 (PDT) From: Yury Norov X-Google-Original-From: Yury Norov Date: Fri, 19 Jun 2026 10:01:04 -0400 To: =?utf-8?B?5a2Z5q+FIChZaSBTdW4p?= Cc: Yury Norov , "mina86@mina86.com" , "279644543@qq.com" <279644543@qq.com>, "mnazarewicz@gmail.com" , "akpm@linux-foundation.org" , "akinobu.mita@gmail.com" , "linux-kernel@vger.kernel.org" , "tjmercier@google.com" , "qiang.zhao@freescale.com" , "scottwood@freescale.com" , "fvdl@google.com" , "tglx@kernel.org" , "song@kernel.org" , "hch@lst.de" , "minchan@kernel.org" , =?utf-8?B?546L56eRIChLZSBXYW5nKQ==?= , John Stultz Subject: Re: =?utf-8?B?562U5aSNOiBbUEFUQ0ggdjUgMS8y?= =?utf-8?Q?=5D?= lib: bitmap: add tests for bitmap_find_next_zero_area_off() Message-ID: References: <20260618015252.3601554-1-yi.sun@unisoc.com> <20260618015252.3601554-2-yi.sun@unisoc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Thu, Jun 18, 2026 at 12:44:19PM +0000, 孙毅 (Yi Sun) wrote: > > > > > + expect_eq_uint(1, > > > > + !!(bitmap_find_next_zero_area_off(bmap, 192, 0, 33, 0, 0) > 192)); > > > > > > It should be >= here. > > > > There would be a problem if the return value equals 192. > > size = 192; > > if (end > size) > > return end; > > So the return value must be greater than 192. > > I agree with the patch you suggested that returns the size, so it needs to be changed to >= here. The valid index range is 0...(size-1), i.e. for 10-bits bitmap the highest valid index is 9. If your implementation never returns 'size', it doesn't mean that the test should consider 'size' as a valid index. (I'm not even sure that your implementation never returns 'size'). > > > > +} > > > > + > > > > static void __init test_fill_set(void) > > > > { > > > > DECLARE_BITMAP(bmap, 1024); > > > > @@ -1559,6 +1596,7 @@ static void __init selftest(void) > > > > test_for_each_clear_bitrange_from(); > > > > test_for_each_set_clump8(); > > > > test_for_each_set_bit_wrap(); > > > > + test_bitmap_find_next_zero_area_off(); > > > > } > > > > > > > > KSTM_MODULE_LOADERS(test_bitmap); > > > > -- > > > > 2.34.1