Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp343027pxv; Wed, 30 Jun 2021 06:57:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwFkolHPspbKPqLObqpalAndiAbC88VwyVE+NMyfXGBq0JM4M1Y4UCy/Wjw1lPWATjBuTZQ X-Received: by 2002:a17:906:3e8d:: with SMTP id a13mr35406951ejj.463.1625061429099; Wed, 30 Jun 2021 06:57:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625061429; cv=none; d=google.com; s=arc-20160816; b=MoMaHn1o2I9P2+Fg3J4AWuTEZYnZgxZgH0TDMq8SErqpjJyc0CVuOFaKjrjhO7A2lG rfTjUn3OXIj+sGaWg0P7TU1MVGSJdsG4c3a/kA5ANuQjiD4WmF03m5WpDUFDgki5OLvj 7srS0vOA9UEK64Wow/8inXNAJn6VAmFhCBoO2AXyi+/Qfsu5/jgaFMtw2+nf4SE3R+Sn 2WRN93aD1jc0WkyZl1KoQo/p4M2D0hUsKI37yBzRSJqndkuFjQUyBCCgbteKIEdkZ8k1 r6IjMGE8//aaxuteypVjpzYjsmGjdonePubdamx+msTB5GUnFuf5Lqs5EXStEhfcb5zC wDgQ== 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 :cc:to:subject; bh=dbwundPwLouMaG9GCOJadUUv3m7ZuMw0jR3bRoXi/50=; b=K9ZqWfjg8gH7vNqUlALJA8FaDuf1i38guCeoY27o0C4+i0wxgwzocEXKO+tGqS9aUY SmTia+ShTNfVfiUuu6/b4RI+MIoScpgqPEP/yNdELJvDKNIdvxUpFKOEc9ilxaWrfJSa 0ooU9QFy4SKFakjp612anr4J04rqJKOo0pmGpPHuqo9LrtqMiv8p+INnT4P4BA1bZMHg rs3oTnid8+oeGZN4YpfjY5SNDVnMYveM/skIH4ixY2PtyPh+1WsMeIWLkQORjS/vUoNg PAT9udtI/ewHn7mxc0QXwui5w7AeprabK6bJ4KbmfwjfURJ29hQqNvuU1U5THbrdp7iC Ofiw== 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=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b22si20344216edw.104.2021.06.30.06.56.44; Wed, 30 Jun 2021 06:57:09 -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=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235467AbhF3N4R (ORCPT + 99 others); Wed, 30 Jun 2021 09:56:17 -0400 Received: from foss.arm.com ([217.140.110.172]:38576 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235781AbhF3Nw3 (ORCPT ); Wed, 30 Jun 2021 09:52:29 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 66FB26D; Wed, 30 Jun 2021 06:50:00 -0700 (PDT) Received: from [10.57.40.45] (unknown [10.57.40.45]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C08BC3F718; Wed, 30 Jun 2021 06:49:58 -0700 (PDT) Subject: Re: [PATCH v3] swiotlb: fix implicit debugfs_create_dir declaration To: Claire Chang , konrad.wilk@oracle.com, hch@lst.de, m.szyprowski@samsung.com, Will Deacon , sstabellini@kernel.org Cc: iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, tfiga@chromium.org, Nicolas Boichat , kernel test robot References: <20210630040616.3914990-1-tientzu@chromium.org> From: Robin Murphy Message-ID: <0ed2f689-2593-5387-dccb-96a82243910f@arm.com> Date: Wed, 30 Jun 2021 14:49:54 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210630040616.3914990-1-tientzu@chromium.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021-06-30 05:06, Claire Chang wrote: > Factor out the debugfs bits from rmem_swiotlb_device_init() into a separate > rmem_swiotlb_debugfs_init(). > > Fixes: 461021875c50 ("swiotlb: Add restricted DMA pool initialization") > Reported-by: kernel test robot > Signed-off-by: Claire Chang > --- > kernel/dma/swiotlb.c | 17 ++++++++++++----- > 1 file changed, 12 insertions(+), 5 deletions(-) > > diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c > index 0ffbaae9fba2..355dc98d381c 100644 > --- a/kernel/dma/swiotlb.c > +++ b/kernel/dma/swiotlb.c > @@ -709,6 +709,16 @@ static int __init swiotlb_create_default_debugfs(void) > > late_initcall(swiotlb_create_default_debugfs); > > +static void rmem_swiotlb_debugfs_init(const char *name, struct io_tlb_mem *mem) Nit: maybe just pass in the reserved_mem, then dereference rmem->name and rmem->priv inside here? > +{ > + mem->debugfs = debugfs_create_dir(name, debugfs_dir); > + swiotlb_create_debugfs_files(mem); > +} > +#else > +__maybe_unused static void rmem_swiotlb_debugfs_init(const char *name, > + struct io_tlb_mem *mem) > +{ > +} > #endif > > #ifdef CONFIG_DMA_RESTRICTED_POOL > @@ -766,11 +776,8 @@ static int rmem_swiotlb_device_init(struct reserved_mem *rmem, > > rmem->priv = mem; > > - if (IS_ENABLED(CONFIG_DEBUG_FS)) { > - mem->debugfs = > - debugfs_create_dir(rmem->name, debugfs_dir); > - swiotlb_create_debugfs_files(mem); > - } > + if (IS_ENABLED(CONFIG_DEBUG_FS)) > + rmem_swiotlb_debugfs_init(rmem->name, mem); Just make the call unconditional (and drop the __maybe_unused annotation above) - the stub already does nothing for the DEBUG_FS=n case, so the IS_ENABLED() is pointless. Robin. > } > > dev->dma_io_tlb_mem = mem; >