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 7E16C1370; Fri, 5 Apr 2024 06:32:26 +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=1712298748; cv=none; b=NxpoNBdto+R2848b+tWsqT267zBYh3wV5FmPKZczrBt9BjzhAfadFkgUyyS7T3e4uGWi5Xf+y6adO3FOYclB+KADSzgtmPc1CfBYO/SxCqL8u/8VtYKiFBH9BJAWRVMxS7J7xDVgX+9CdCju1mzzX/KMzkWlgxHYxVv0p79+6mI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712298748; c=relaxed/simple; bh=dCGIzkI2WWywAAD+bVC9mLePlWvKEyEDzpXJWUUjq34=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Oure3q9VhY+1O1/Rk2ExlDSFOt/PbQmJKXccdA5pQ6NK4RAPzp9CDSyjMPpZYqK1MPyF6oobOXeRpkg7liMzADux5Cb4TGHBM3kHRp0dR5MCoGs8Cu3Z7Rxzg6JHrjKF1gOh+RBHAvXUjXE0TGZETw4tcVp2bwj+UVMmuDJwdIc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (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=none (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 5E9A268D07; Fri, 5 Apr 2024 08:32:20 +0200 (CEST) Date: Fri, 5 Apr 2024 08:32:20 +0200 From: Christoph Hellwig To: Bart Van Assche Cc: Christoph Hellwig , Jens Axboe , "Martin K. Petersen" , Damien Le Moal , Niklas Cassel , Takashi Sakamoto , Sathya Prakash , Sreekanth Reddy , Suganath Prabu Subramani , "Juergen E. Fischer" , Xiang Chen , HighPoint Linux Team , Tyrel Datwyler , Brian King , Lee Duncan , Chris Leech , Mike Christie , John Garry , Jason Yan , Kashyap Desai , Sumit Saxena , Shivasharan S , Chandrakanth patil , Jack Wang , Nilesh Javali , GR-QLogic-Storage-Upstream@marvell.com, Greg Kroah-Hartman , Alim Akhtar , Avri Altman , Krzysztof Kozlowski , Alan Stern , linux-block@vger.kernel.org, linux-ide@vger.kernel.org, linux1394-devel@lists.sourceforge.net, MPT-FusionLinux.pdl@broadcom.com, linux-scsi@vger.kernel.org, megaraidlinux.pdl@broadcom.com, mpi3mr-linuxdrv.pdl@broadcom.com, linux-samsung-soc@vger.kernel.org, linux-usb@vger.kernel.org, usb-storage@lists.one-eyed-alien.net Subject: Re: [PATCH 01/23] block: add a helper to cancel atomic queue limit updates Message-ID: <20240405063220.GA3480@lst.de> References: <20240402130645.653507-1-hch@lst.de> <20240402130645.653507-2-hch@lst.de> Precedence: bulk X-Mailing-List: linux-block@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 Thu, Apr 04, 2024 at 09:53:03AM -0700, Bart Van Assche wrote: > At least in scsi_add_lun() there are multiple statements between > queue_limits_start_update(), queue_limits_cancel_update() and > queue_limits_commit_update(). Has it been considered to use __cleanup() > to invoke queue_limits_commit_update() when the end of the current scope > is reached? I think that would make code that uses the > queue_limits_*_update() functions easier to verify. For an example of > how to use the __cleanup() macro, see e.g. the __free() and > no_free_ptr() macros in . It has been considered and rejected as this syntactic sugar might make teenagers with attention deficit syndrome happy, but otherwise just horribly obfuscates the code.