From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Tue, 17 Jul 2018 15:21:17 +0200 From: Christoph Hellwig To: Ming Lei Cc: Jens Axboe , linux-block@vger.kernel.org, "Rafael J. Wysocki" , Alan Stern , linux-pm@vger.kernel.org, Greg Kroah-Hartman , Christoph Hellwig , Bart Van Assche , Hannes Reinecke , Johannes Thumshirn , Adrian Hunter , "James E.J. Bottomley" , "Martin K. Petersen" , linux-scsi@vger.kernel.org Subject: Re: [PATCH RFC V2 1/3] block: put runtime PM code into common helpers Message-ID: <20180717132117.GG13582@lst.de> References: <20180713080602.31602-1-ming.lei@redhat.com> <20180713080602.31602-2-ming.lei@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <20180713080602.31602-2-ming.lei@redhat.com> List-ID: > #ifdef CONFIG_PM > +static int __blk_pre_runtime_suspend(struct request_queue *q, bool active) > +{ > + int ret; > + > + if (active) { > + ret = -EBUSY; > + pm_runtime_mark_last_busy(q->dev); > + } else { > + ret = 0; > + q->rpm_status = RPM_SUSPENDING; > + } > + > + return ret; > +} Why not: if (active) { pm_runtime_mark_last_busy(q->dev); return -EBUSY; } q->rpm_status = RPM_SUSPENDING; return 0;