Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4497609pxu; Wed, 9 Dec 2020 20:12:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJxwHH1BEYP0EVEQfKJKJ3Aeinh3PODM3sS80sLaGV2v1aKiQHA9gtq9F42SKcFYO9YovHjR X-Received: by 2002:a17:906:5243:: with SMTP id y3mr4752322ejm.273.1607573569203; Wed, 09 Dec 2020 20:12:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607573569; cv=none; d=google.com; s=arc-20160816; b=XmuOZL6tea3i1x5mO1gLIUdsWmsvPWWO8lwRSK7gCKp41QcbpEcOHViUHm1o+nTsDp CPteLbOpEEp8DWWjPq5gfoxI1J8wnoM91yJ9WnAq9RQ+qw/ohUT7XzccIQaoIY5UWAZr kicpt7MuEVsTARzqFkB0qSDWQ4BobdCS3nClbNJtR0hHbGR7wKMa0Awp0nCI0Wa+N90u vK0agiJaoYkK1A1uIFtvoWj2g5QHd24mgPrKzxdV9stOAdLl35o3MfH+mT4qj8W9dCC/ uw9k+N6Xe917wIrnQXQVrZ9q25DednGMq9RPlVBVQ8snBnyTiOQilXbQR0mP2wenb43v Tn6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=MUmtMB6swHJqqDC6uyfl4heAqP9RaWReewlPL2d80QI=; b=k9VUo+8aDwwaoVgZVtHrqFIjT1CQLsKsZOwOc/O0vG9NtighVokFPvxP9118j/vXmN 1MGKM6crZhVAETWFrwTJ1LayU6alUJeGEZbA4R0ux+PfQxsIiTQbuQkbSjUHjzeicNL1 QxK4gchlcWKKhzNS3sjKZkyzrs0teLw5XTPlEOmxsa0W8K2xu/p+dFlBy+nMU7N2HapC hgtiPFZ3AwaHW+nR1f8p7z662uL1fBWZHFR3U+B8VrFqn9rby3S/+kExi7NVACHd54qN tf+F8YCkqLSU6dRFw1Q792h2qZbIRhloIzLka03x0cAGL94wcCxdco0YpsHZ/vLweuL9 RVRA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a17si1754749ejy.317.2020.12.09.20.12.26; Wed, 09 Dec 2020 20:12:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731068AbgLJEJw convert rfc822-to-8bit (ORCPT + 99 others); Wed, 9 Dec 2020 23:09:52 -0500 Received: from smtp.h3c.com ([60.191.123.56]:18606 "EHLO h3cspam01-ex.h3c.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730328AbgLJEJw (ORCPT ); Wed, 9 Dec 2020 23:09:52 -0500 Received: from DAG2EX01-BASE.srv.huawei-3com.com ([10.8.0.64]) by h3cspam01-ex.h3c.com with ESMTP id 0BA48DCZ034913; Thu, 10 Dec 2020 12:08:13 +0800 (GMT-8) (envelope-from tian.xianting@h3c.com) Received: from DAG2EX03-BASE.srv.huawei-3com.com (10.8.0.66) by DAG2EX01-BASE.srv.huawei-3com.com (10.8.0.64) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Thu, 10 Dec 2020 12:08:15 +0800 Received: from DAG2EX03-BASE.srv.huawei-3com.com ([fe80::5d18:e01c:bbbd:c074]) by DAG2EX03-BASE.srv.huawei-3com.com ([fe80::5d18:e01c:bbbd:c074%7]) with mapi id 15.01.2106.002; Thu, 10 Dec 2020 12:08:15 +0800 From: Tianxianting To: Ming Lei CC: "axboe@kernel.dk" , "linux-block@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH] blk-mq-tag: make blk_mq_tag_busy() return void Thread-Topic: [PATCH] blk-mq-tag: make blk_mq_tag_busy() return void Thread-Index: AQHWzTbPLVQryLH5fkSeJ0U/VBp/EKnvMY+AgACHgrA= Date: Thu, 10 Dec 2020 04:08:14 +0000 Message-ID: References: <20201208074002.31539-1-tian.xianting@h3c.com> <20201210040051.GA1377508@T590> In-Reply-To: <20201210040051.GA1377508@T590> Accept-Language: en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.99.141.128] x-sender-location: DAG2 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-DNSRBL: X-MAIL: h3cspam01-ex.h3c.com 0BA48DCZ034913 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thanks for the comments, So blk_mq_tag_idle() can be also simplified as below, I will send v2 patch for reviewing. static inline void blk_mq_tag_idle(struct blk_mq_hw_ctx *hctx) { - if (!(hctx->flags & BLK_MQ_F_TAG_QUEUE_SHARED)) - return; - - __blk_mq_tag_idle(hctx); + if (hctx->flags & BLK_MQ_F_TAG_QUEUE_SHARED) + __blk_mq_tag_idle(hctx); } -----Original Message----- From: Ming Lei [mailto:ming.lei@redhat.com] Sent: Thursday, December 10, 2020 12:01 PM To: tianxianting (RD) Cc: axboe@kernel.dk; linux-block@vger.kernel.org; linux-kernel@vger.kernel.org Subject: Re: [PATCH] blk-mq-tag: make blk_mq_tag_busy() return void On Tue, Dec 08, 2020 at 03:40:02PM +0800, Xianting Tian wrote: > As no one cares about the return value of blk_mq_tag_busy() and > __blk_mq_tag_busy(), so make them return void. > > Signed-off-by: Xianting Tian > --- > block/blk-mq-tag.c | 4 ++-- > block/blk-mq-tag.h | 8 ++++---- > 2 files changed, 6 insertions(+), 6 deletions(-) > > diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c index > 9c92053e7..21ff7d156 100644 > --- a/block/blk-mq-tag.c > +++ b/block/blk-mq-tag.c > @@ -21,7 +21,7 @@ > * to get tag when first time, the other shared-tag users could reserve > * budget for it. > */ > -bool __blk_mq_tag_busy(struct blk_mq_hw_ctx *hctx) > +void __blk_mq_tag_busy(struct blk_mq_hw_ctx *hctx) > { > if (blk_mq_is_sbitmap_shared(hctx->flags)) { > struct request_queue *q = hctx->queue; @@ -36,7 +36,7 @@ bool > __blk_mq_tag_busy(struct blk_mq_hw_ctx *hctx) > atomic_inc(&hctx->tags->active_queues); > } > > - return true; > + return; > } > > /* > diff --git a/block/blk-mq-tag.h b/block/blk-mq-tag.h index > 7d3e6b333..dd80e5a85 100644 > --- a/block/blk-mq-tag.h > +++ b/block/blk-mq-tag.h > @@ -60,15 +60,15 @@ enum { > BLK_MQ_TAG_MAX = BLK_MQ_NO_TAG - 1, > }; > > -extern bool __blk_mq_tag_busy(struct blk_mq_hw_ctx *); > +extern void __blk_mq_tag_busy(struct blk_mq_hw_ctx *); > extern void __blk_mq_tag_idle(struct blk_mq_hw_ctx *); > > -static inline bool blk_mq_tag_busy(struct blk_mq_hw_ctx *hctx) > +static inline void blk_mq_tag_busy(struct blk_mq_hw_ctx *hctx) > { > if (!(hctx->flags & BLK_MQ_F_TAG_QUEUE_SHARED)) > - return false; > + return; > > - return __blk_mq_tag_busy(hctx); > + __blk_mq_tag_busy(hctx); The above can be simplified as: if (hctx->flags & BLK_MQ_F_TAG_QUEUE_SHARED) __blk_mq_tag_busy(hctx); Otherwise, looks fine: Reviewed-by: Ming Lei Thanks, Ming