From patchwork Mon Jun 3 00:32:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kent Overstreet X-Patchwork-Id: 13683156 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 935D5C25B74 for ; Mon, 3 Jun 2024 00:33:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DC32B6B00D0; Sun, 2 Jun 2024 20:33:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D4B1E6B00D2; Sun, 2 Jun 2024 20:33:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B2A0F6B00D4; Sun, 2 Jun 2024 20:33:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 9003D6B00D0 for ; Sun, 2 Jun 2024 20:33:25 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 3BAD8A0648 for ; Mon, 3 Jun 2024 00:33:25 +0000 (UTC) X-FDA: 82187703570.25.210ADD9 Received: from out-180.mta0.migadu.com (out-180.mta0.migadu.com [91.218.175.180]) by imf21.hostedemail.com (Postfix) with ESMTP id 225701C0014 for ; Mon, 3 Jun 2024 00:33:22 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=cxshFyB9; spf=pass (imf21.hostedemail.com: domain of kent.overstreet@linux.dev designates 91.218.175.180 as permitted sender) smtp.mailfrom=kent.overstreet@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1717374803; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=+9i05LKO2QA/lK7UY488kffvxZI78NDDMmynN4RHjDY=; b=wdPZl9hy7EyMpUeGqpwyR+iFtRKXP/+yFq4gZy8a4B9V85Pt/i/c9xupsDrqQKwKNiNcaT TiMQSNtzAbQkS+d8FHRB/f+VWRZINelGeq9593OvUzZGV8t/PsckgK9x6v62tFvgDy87Ww FUWr6iNADW9FSC7S6Rgr09S/cYZI5WI= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1717374803; a=rsa-sha256; cv=none; b=DA5DfcNbZwqC634S7faC1k8M3nPCovvXc0ugQPia/1NWKrtAb3uZvNLVc893OUEiPk4UXs Q02oYgwkhApAzceLbyzLx68dfywmH+hzBe3JDWS235RKWpip9KFjhF3c+iaNG/0OhA6Q1d W+adqs3nAX24QO/IogihfZdXyU/1r+U= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=cxshFyB9; spf=pass (imf21.hostedemail.com: domain of kent.overstreet@linux.dev designates 91.218.175.180 as permitted sender) smtp.mailfrom=kent.overstreet@linux.dev; dmarc=pass (policy=none) header.from=linux.dev X-Envelope-To: linux-fsdevel@vger.kernel.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1717374798; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+9i05LKO2QA/lK7UY488kffvxZI78NDDMmynN4RHjDY=; b=cxshFyB9JKCAKNznr6OdQp2IxW5GvjHiPt+QwcO6E7Tff7SKkiTnAbxNBlh6rLc1BPyINF oAsbyEBatHM043qRZtq+a8/5fz3Bt4YMJ4266ftivXpjgOu+sVkinKDFD6wTXyCe+0IeR1 kS1/2wqUZqwufTFCro/A+IvTJdlst2M= X-Envelope-To: linux-kernel@vger.kernel.org X-Envelope-To: axboe@kernel.dk X-Envelope-To: kent.overstreet@linux.dev X-Envelope-To: brauner@kernel.org X-Envelope-To: viro@zeniv.linux.org.uk X-Envelope-To: bernd.schubert@fastmail.fm X-Envelope-To: linux-mm@kvack.org X-Envelope-To: josef@toxicpanda.com X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jens Axboe , Kent Overstreet , brauner@kernel.org, viro@zeniv.linux.org.uk, Bernd Schubert , linux-mm@kvack.org, Josef Bacik Subject: [PATCH 2/5] darray: Fix darray_for_each_reverse() when darray is empty Date: Sun, 2 Jun 2024 20:32:59 -0400 Message-ID: <20240603003306.2030491-3-kent.overstreet@linux.dev> In-Reply-To: <20240603003306.2030491-1-kent.overstreet@linux.dev> References: <20240603003306.2030491-1-kent.overstreet@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 225701C0014 X-Rspam-User: X-Stat-Signature: 8w3u669i4xd7fg1epqw6rici75b49izh X-HE-Tag: 1717374802-295610 X-HE-Meta: U2FsdGVkX19ps+UipbgIqzlXG/jhNSk4DtpETkUSSRMbgA4M5gKtuCbXJR5Bp4EJ5d9/yQSP8/UBmD3nmzaSv/nvhCcb0ziNAgJ5NtmViMAOKj9GOH8IDG/bKRyGU6bNx/DEWIuQGCl7pvEbkNI61FOCVw/w8OvSMXrSkd2NtjGyBYI6H9Sw/iNX6JoLl0ORQ7LNaYKDSiBVM7UwxRNBYQV2kKF/Y/1V1gJZJ2ekwqq8hs2i4ZWINiGjqrM1zuPDrWS8Qp4xJSAsiqpqPhwLfeFNTblbR0bL7i61JdN1f7UsdZWOko8UWke7r4R2kawgWebeYAMJR3BZr5nxsavur5Gh27AfAgWe1n9bnHRaK8kRak/uFx9SZWsaRKcUm8CnHKthZJ8obeshen8DlsZLhWsZH7ICIoqLydOMGJ6dNtRxaqLdNURKoQMjZJIgAst6TkHqzE4xdT0VIxwQRHQUka08NI3CpWRcje+IN+tcjsGWOGAVqARe3ZUFwsgwuez1FmqG+y9LqQKkOGUfvO/KOp6ITpo+1zjEDVhg85AoV7wcGf8E0NTZ1yi17tOGPawuafkzLXdFfGP+6voxGzkok1tZTHWAOnol5VJid5EDjYX274qR2vnPcl3V0toc76EalxCgnV74NGPf3W6/uH4Wzj64L3mmJ9m+RDMYovR128KIwNZHuYEYOpr4SAxcVDKm1Tj3nksT3dF014RbPQ1cjgRtw8sqFEZHdWTctKj/pjY1QG6EvuNqv3NLIYd13u1t9+ZFMj1o8YLxrOs7bSNhn5OqWjVmemyqI6TruQ0tV3TCRRYmi4DgScVPjwG5K8rKBuh+SfpjCRxzU8YoqHcHVqsKXngk29FW7oZzY2BDI8lntRXhwxX01kJ7eGfSHS25fgbVP8SOi7ibPXu+C42MIn/0lYwXKpiFa4o/dqEtSUo2gWyoLdQ5SvoOlwu/j0vO/3w2Od1WhP7CKKUd/s7 Ef5WAKp+ fKuFjfPCM+XSrKuUwk9CbITZ7jyhJD3KhT+fgFkM3fp/wqMVxpqxa2yr+nrZyRC8la1yn9IfmOJxK3sSdLiWKEUWLO6ibxZT3yWMyXGGtenMQMUCAZ9f3ioeHfl07WPE9RIQH X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Signed-off-by: Kent Overstreet --- include/linux/darray.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/darray.h b/include/linux/darray.h index ff167eb795f2..603d6762c29a 100644 --- a/include/linux/darray.h +++ b/include/linux/darray.h @@ -108,7 +108,7 @@ do { \ for (typeof(&(_d).data[0]) _i = (_d).data; _i < (_d).data + (_d).nr; _i++) #define darray_for_each_reverse(_d, _i) \ - for (typeof(&(_d).data[0]) _i = (_d).data + (_d).nr - 1; _i >= (_d).data; --_i) + for (typeof(&(_d).data[0]) _i = (_d).data + (_d).nr - 1; (_d).data && _i >= (_d).data; --_i) #define darray_init(_d) \ do { \