From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8A96A1DB122 for ; Tue, 2 Dec 2025 05:57:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.95.11.211 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764655038; cv=none; b=VYuLRDC6C1iACQmHN/3+D68Eo3bxHN9KppLelWQ/nppqZiqEDduExxLyP6C84aENLDa6UidIxPneMCMuluIrf/kIwnrMK9RAg/leqAKddnjUwBvlIantdlcSRxCh/MHxpTjDX/TdoEMndOrxQoFth425L809RSKcnwZPy5FXa4M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764655038; c=relaxed/simple; bh=JWSMXJ6W9A3+TRzs8FikoAQwrpZqjjWFaDJbup3gx4g=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=N9X2ZeY5kWzu1aaj5Dp/RiFzAlmzLfSdT3tbkdw9AeX02YF49TP71c7PsrS1PEbrOM4hEy93sIGzGXbFf+9t0XqYROCG5VzyTV5gotc20tUZWUSgRemc2OXLHl+OFRpv1gNgvozyPfl2BzLDe+I2e/ed/jXnWiXN3HaYeS+iccc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lst.de; spf=pass smtp.mailfrom=lst.de; arc=none smtp.client-ip=213.95.11.211 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lst.de Received: by verein.lst.de (Postfix, from userid 2407) id 8ABD968AA6; Tue, 2 Dec 2025 06:57:13 +0100 (CET) Date: Tue, 2 Dec 2025 06:57:13 +0100 From: Christoph Hellwig To: Keith Busch Cc: Eugene Korenevsky , Jens Axboe , Christoph Hellwig , Sagi Grimberg , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] nvme: nvme_identify_ns_descs: prevent oob Message-ID: <20251202055713.GB15852@lst.de> References: 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=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) On Mon, Dec 01, 2025 at 05:27:48PM -0700, Keith Busch wrote: > I don't want bikeshed this, but I thought this looked better as a > for-loop. You can just modify the continuing condition instead of > changing the loop type to do-while. The reason I went for the while in my whiteboard coding is that it would allow for keeping len local inside the loop, which I like in general. The actual patch doesn't do this anyway, and I don't care too strongly, so I'm fine with the somewhat more natural for loop as well.