Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp365152pxb; Sat, 18 Sep 2021 05:12:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz9roh8go6U5Gb58QFtZEJMsQg96gSadCVVphZAWy5GB12rr1fdxnXyAXnHJQycH5pXAn02 X-Received: by 2002:a92:d18c:: with SMTP id z12mr11637192ilz.59.1631967131860; Sat, 18 Sep 2021 05:12:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631967131; cv=none; d=google.com; s=arc-20160816; b=HloQ1TpxQb/OZCOTZUNyw18AAMPsLiHZfMibh0RFkNvheqp55DeDnxNQVgyEv1knaG ZudVHOEID1AYJVYNlbWeU8t/K6/Q6vW8aDwxCveBmP7XjsT+bpnscvkNF8zINf40h0w1 CLC0LKy5zcVKPjv8luU1kuunm3RC5plQYhVTmb4IOOydxbYtrWfbPDRde7X3G4myiVvw hm7zeprRXM0xoZ4lC3/h+jBf/ctEitlKlOD3Olm9H+QwrmtAwNgtb+V2gD/tnD21hdbl O1MWV9MoTHFqi3rdoxRJUMuAUYoBVKSxzVxJCGDySNXBs92bLwLmrv77d9qE7oK6qXqQ 5abw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :to:subject; bh=SCjV32iC6y2XqJ5V6Svsgu4wh8aBW/rhxYjP+PMWhJY=; b=KXw6ynB1k1A0U8/DQelDLO00W1TVvW8TnAyFVarrM/7SKUue2dFagumNjytfAkUvwW 7HzxJW8v+wBlMWuxoynvqc+Wrkz7KVhZgA0F65HtJ1SfpoVnteX3jdgRQRnBn0Q95xF+ J5pZZ4LSRpFP7JOwVXztmo3AzORWQwuuTMK1Il9+AyblnNlQuUM2r+08zkuU0aYxX7oX Qt0llY6pceOuq1DoK2oyx5GmVGgbt+ykY52pK7gMBs3H6awrVyc690SOEPD7z5xMfx3i 3tkAnq+pfrnfJLF28Y8zrA464uXYaGPmSCTp/xG4b0gt8rt4jxBeD4FYCbdlB7MMUggo vzQw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u12si7406962ilm.1.2021.09.18.05.12.00; Sat, 18 Sep 2021 05:12:11 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234282AbhIRCZO (ORCPT + 99 others); Fri, 17 Sep 2021 22:25:14 -0400 Received: from out30-132.freemail.mail.aliyun.com ([115.124.30.132]:58401 "EHLO out30-132.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232711AbhIRCZN (ORCPT ); Fri, 17 Sep 2021 22:25:13 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R151e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04423;MF=tianjia.zhang@linux.alibaba.com;NM=1;PH=DS;RN=3;SR=0;TI=SMTPD_---0UojoMEt_1631931828; Received: from B-455UMD6M-2027.local(mailfrom:tianjia.zhang@linux.alibaba.com fp:SMTPD_---0UojoMEt_1631931828) by smtp.aliyun-inc.com(127.0.0.1); Sat, 18 Sep 2021 10:23:48 +0800 Subject: Re: [PATCH] block/mq-deadline: Fix unused-function compilation warning To: Jens Axboe , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org References: <20210901064705.55071-1-tianjia.zhang@linux.alibaba.com> From: Tianjia Zhang Message-ID: <90507369-7beb-5337-5bb3-f5e2798dee2f@linux.alibaba.com> Date: Sat, 18 Sep 2021 10:23:47 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <20210901064705.55071-1-tianjia.zhang@linux.alibaba.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ping. On 9/1/21 2:47 PM, Tianjia Zhang wrote: > If CONFIG_BLK_DEBUG_FS is not defined, the following compilation warning > will be reported: > > block/mq-deadline.c:274:12: warning: ‘dd_queued’ defined but not used [-Wunused-function] > static u32 dd_queued(struct deadline_data *dd, enum dd_prio prio) > > Move the function dd_queued() to the scope of this config and mark it > inline. > > Signed-off-by: Tianjia Zhang > --- > block/mq-deadline.c | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/block/mq-deadline.c b/block/mq-deadline.c > index 3c3693c34f06..084314ee878d 100644 > --- a/block/mq-deadline.c > +++ b/block/mq-deadline.c > @@ -270,12 +270,6 @@ deadline_move_request(struct deadline_data *dd, struct dd_per_prio *per_prio, > deadline_remove_request(rq->q, per_prio, rq); > } > > -/* Number of requests queued for a given priority level. */ > -static u32 dd_queued(struct deadline_data *dd, enum dd_prio prio) > -{ > - return dd_sum(dd, inserted, prio) - dd_sum(dd, completed, prio); > -} > - > /* > * deadline_check_fifo returns 0 if there are no expired requests on the fifo, > * 1 otherwise. Requires !list_empty(&dd->fifo_list[data_dir]) > @@ -953,6 +947,12 @@ static int dd_async_depth_show(void *data, struct seq_file *m) > return 0; > } > > +/* Number of requests queued for a given priority level. */ > +static inline u32 dd_queued(struct deadline_data *dd, enum dd_prio prio) > +{ > + return dd_sum(dd, inserted, prio) - dd_sum(dd, completed, prio); > +} > + > static int dd_queued_show(void *data, struct seq_file *m) > { > struct request_queue *q = data; >