Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4854948ybv; Wed, 26 Feb 2020 04:15:16 -0800 (PST) X-Google-Smtp-Source: APXvYqzf0g6F8SzjlLH/TkQJs/aw3MHLLPir8pv0MhkMz8PjlMSeCguzrWv5Hg+AxxniF72EKz3y X-Received: by 2002:a05:6830:1d7b:: with SMTP id l27mr2553547oti.251.1582719316365; Wed, 26 Feb 2020 04:15:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582719316; cv=none; d=google.com; s=arc-20160816; b=wWu0yU0HXQWXf/05UjsppTh8j+cunlkJDR8YVhMTirvgMnRegj59Wb6FQJ+wgDKS65 8OWwy09FqSc9tW8ZtWNla0liMIgqRK0bAJgEUx+ClY0TC2/Y9adTWQQRuxL6XrN4W0Zi XwLWU6o6XBOXotM6UNMnfDW4FX6eIc+4EvAU37AjsuIEyYF71+SQNvb3AGpvrZhC0q8r vEQ4VRIpBDGMLpPqbYcUOLWNCBqw+BhOhg1yacOsnYCjtBG+asOvxBE+VI3VSpaBLkax 2hmQQO4ky1FaWt9/wy/XNKRdFZoApzXLsW2N5YTp+912lFD/wToa+6iFBsA2QqEGCb4K th1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=xI2nZ6ZsmLXnXS6Rn/ezRtgsFqEw88codXTmY+LAZ1o=; b=MJPbXMyMOakoIUcIH8BVe4E5+hR+TjAh6PpwhHK9ZKcHTRanbDxUDPFlJxpbR1yeFf aSxGo9jxue13J0NhFo8dMRb7MjDmSJAxDCFxeRRwb/wo1rGC8NdQRwRLmCofuJX7qlCG MW5OnYa9Z2rQiB5cwxN7SmEv6i6XArLRssWOvovf2lb/tOB8DRBR95KUdDRL2t4R1O5y JgN05ojC08i8zC/F+baMNQrMiHTG80lhB1gXAUSXF6BoAh9eV2Q4pAr3xFgOFQqHPSsH WcawZcXtAPmTxQ1UuDTkwVKPlnqDXII0EXdGgt4QENNkh0GuBbT+9DxH+JZ+vdWqRMLR U+qg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m82si1107482oig.129.2020.02.26.04.15.04; Wed, 26 Feb 2020 04:15:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727221AbgBZMOa (ORCPT + 99 others); Wed, 26 Feb 2020 07:14:30 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:11112 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726806AbgBZMO3 (ORCPT ); Wed, 26 Feb 2020 07:14:29 -0500 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id DD6FD38F0FDB02B7E510; Wed, 26 Feb 2020 20:14:16 +0800 (CST) Received: from localhost.localdomain (10.69.192.58) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.439.0; Wed, 26 Feb 2020 20:14:08 +0800 From: John Garry To: CC: , , John Garry Subject: [PATCH] blk-mq: Remove some unused function arguments Date: Wed, 26 Feb 2020 20:10:15 +0800 Message-ID: <1582719015-198980-1-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.58] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The struct blk_mq_hw_ctx pointer argument in blk_mq_put_tag(), blk_mq_poll_nsecs(), and blk_mq_poll_hybrid_sleep() is unused, so remove it. Overall obj code size shows a minor reduction, before: text data bss dec hex filename 27306 1312 0 28618 6fca block/blk-mq.o 4303 272 0 4575 11df block/blk-mq-tag.o after: 27282 1312 0 28594 6fb2 block/blk-mq.o 4311 272 0 4583 11e7 block/blk-mq-tag.o Reviewed-by: Hannes Reinecke Signed-off-by: John Garry -- This minor patch had been carried as part of the blk-mq shared tags RFC, I'd rather not carry it anymore as it required rebasing, so now or never.. diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c index fbacde454718..586c9d6e904a 100644 --- a/block/blk-mq-tag.c +++ b/block/blk-mq-tag.c @@ -183,8 +183,8 @@ unsigned int blk_mq_get_tag(struct blk_mq_alloc_data *data) return tag + tag_offset; } -void blk_mq_put_tag(struct blk_mq_hw_ctx *hctx, struct blk_mq_tags *tags, - struct blk_mq_ctx *ctx, unsigned int tag) +void blk_mq_put_tag(struct blk_mq_tags *tags, struct blk_mq_ctx *ctx, + unsigned int tag) { if (!blk_mq_tag_is_reserved(tags, tag)) { const int real_tag = tag - tags->nr_reserved_tags; diff --git a/block/blk-mq-tag.h b/block/blk-mq-tag.h index 15bc74acb57e..2b8321efb682 100644 --- a/block/blk-mq-tag.h +++ b/block/blk-mq-tag.h @@ -26,8 +26,8 @@ extern struct blk_mq_tags *blk_mq_init_tags(unsigned int nr_tags, unsigned int r extern void blk_mq_free_tags(struct blk_mq_tags *tags); extern unsigned int blk_mq_get_tag(struct blk_mq_alloc_data *data); -extern void blk_mq_put_tag(struct blk_mq_hw_ctx *hctx, struct blk_mq_tags *tags, - struct blk_mq_ctx *ctx, unsigned int tag); +extern void blk_mq_put_tag(struct blk_mq_tags *tags, struct blk_mq_ctx *ctx, + unsigned int tag); extern int blk_mq_tag_update_depth(struct blk_mq_hw_ctx *hctx, struct blk_mq_tags **tags, unsigned int depth, bool can_grow); diff --git a/block/blk-mq.c b/block/blk-mq.c index a12b1763508d..0836b5135fa6 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -477,9 +477,9 @@ static void __blk_mq_free_request(struct request *rq) blk_pm_mark_last_busy(rq); rq->mq_hctx = NULL; if (rq->tag != -1) - blk_mq_put_tag(hctx, hctx->tags, ctx, rq->tag); + blk_mq_put_tag(hctx->tags, ctx, rq->tag); if (sched_tag != -1) - blk_mq_put_tag(hctx, hctx->sched_tags, ctx, sched_tag); + blk_mq_put_tag(hctx->sched_tags, ctx, sched_tag); blk_mq_sched_restart(hctx); blk_queue_exit(q); } @@ -3398,7 +3398,6 @@ static void blk_mq_poll_stats_fn(struct blk_stat_callback *cb) } static unsigned long blk_mq_poll_nsecs(struct request_queue *q, - struct blk_mq_hw_ctx *hctx, struct request *rq) { unsigned long ret = 0; @@ -3431,7 +3430,6 @@ static unsigned long blk_mq_poll_nsecs(struct request_queue *q, } static bool blk_mq_poll_hybrid_sleep(struct request_queue *q, - struct blk_mq_hw_ctx *hctx, struct request *rq) { struct hrtimer_sleeper hs; @@ -3451,7 +3449,7 @@ static bool blk_mq_poll_hybrid_sleep(struct request_queue *q, if (q->poll_nsec > 0) nsecs = q->poll_nsec; else - nsecs = blk_mq_poll_nsecs(q, hctx, rq); + nsecs = blk_mq_poll_nsecs(q, rq); if (!nsecs) return false; @@ -3506,7 +3504,7 @@ static bool blk_mq_poll_hybrid(struct request_queue *q, return false; } - return blk_mq_poll_hybrid_sleep(q, hctx, rq); + return blk_mq_poll_hybrid_sleep(q, rq); } /** diff --git a/block/blk-mq.h b/block/blk-mq.h index eaaca8fc1c28..ba37cd64894c 100644 --- a/block/blk-mq.h +++ b/block/blk-mq.h @@ -199,7 +199,7 @@ static inline bool blk_mq_get_dispatch_budget(struct blk_mq_hw_ctx *hctx) static inline void __blk_mq_put_driver_tag(struct blk_mq_hw_ctx *hctx, struct request *rq) { - blk_mq_put_tag(hctx, hctx->tags, rq->mq_ctx, rq->tag); + blk_mq_put_tag(hctx->tags, rq->mq_ctx, rq->tag); rq->tag = -1; if (rq->rq_flags & RQF_MQ_INFLIGHT) { -- 2.17.1