From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 39092C433F5 for ; Mon, 20 Sep 2021 12:47:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1C0EB610A1 for ; Mon, 20 Sep 2021 12:47:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238775AbhITMtS (ORCPT ); Mon, 20 Sep 2021 08:49:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237095AbhITMtI (ORCPT ); Mon, 20 Sep 2021 08:49:08 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1AB0C061574; Mon, 20 Sep 2021 05:47:41 -0700 (PDT) Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 5B38BE57; Mon, 20 Sep 2021 14:47:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1632142057; bh=sUHy5mI48lLJfk0k+EUA5Q2mX9cYsAejPY8yjVUg2ks=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=msjI+3iUrWdFQ0rNpQ9h1aEphCugLPzQGK+AvdqcX51vj4ctb8kiB26dSBp/iwEvw qwEqmoZfKEXornPDuVtejK5URA38OVvGakD/wefgsjEzoSSlxEJD/E/pcDTzvekBaY 1pC2bixWM3bGWoPPFeQ3CJZr5Z/q1kyOunX34bTs= Date: Mon, 20 Sep 2021 15:47:07 +0300 From: Laurent Pinchart To: Arnd Bergmann Cc: Hyun Kwon , Vinod Koul , Michal Simek , Sanjay R Mehta , Peter Ujfalusi , Arnd Bergmann , Jianqiang Chen , Quanyang Wang , Yang Li , Allen Pais , Lad Prabhakar , Biju Das , Andy Shevchenko , dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] dmaengine: remove debugfs #ifdef Message-ID: References: <20210920122017.205975-1-arnd@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210920122017.205975-1-arnd@kernel.org> Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org Hi Arnd, Thank you for the patch. On Mon, Sep 20, 2021 at 02:20:07PM +0200, Arnd Bergmann wrote: > From: Arnd Bergmann > > The ptdma driver has added debugfs support, but this fails to build > when debugfs is disabled: > > drivers/dma/ptdma/ptdma-debugfs.c: In function 'ptdma_debugfs_setup': > drivers/dma/ptdma/ptdma-debugfs.c:93:54: error: 'struct dma_device' has no member named 'dbg_dev_root' > 93 | debugfs_create_file("info", 0400, pt->dma_dev.dbg_dev_root, pt, > | ^ > drivers/dma/ptdma/ptdma-debugfs.c:96:55: error: 'struct dma_device' has no member named 'dbg_dev_root' > 96 | debugfs_create_file("stats", 0400, pt->dma_dev.dbg_dev_root, pt, > | ^ > drivers/dma/ptdma/ptdma-debugfs.c:102:52: error: 'struct dma_device' has no member named 'dbg_dev_root' > 102 | debugfs_create_dir("q", pt->dma_dev.dbg_dev_root); > | ^ > > Remove the #ifdef in the header, as this only saves a few bytes, > but would require ugly #ifdefs in each driver using it. > Simplify the other user while we're at it. > > Fixes: e2fb2e2a33fa ("dmaengine: ptdma: Add debugfs entries for PTDMA") > Fixes: 26cf132de6f7 ("dmaengine: Create debug directories for DMA devices") > Signed-off-by: Arnd Bergmann > --- > drivers/dma/xilinx/xilinx_dpdma.c | 15 +-------------- > include/linux/dmaengine.h | 2 -- > 2 files changed, 1 insertion(+), 16 deletions(-) > > diff --git a/drivers/dma/xilinx/xilinx_dpdma.c b/drivers/dma/xilinx/xilinx_dpdma.c > index b280a53e8570..ce5c66e6897d 100644 > --- a/drivers/dma/xilinx/xilinx_dpdma.c > +++ b/drivers/dma/xilinx/xilinx_dpdma.c > @@ -271,9 +271,6 @@ struct xilinx_dpdma_device { > /* ----------------------------------------------------------------------------- > * DebugFS > */ > - > -#ifdef CONFIG_DEBUG_FS > - It's only a few bytes of data in struct dma_device, but a bit more in .text here. Is the simplification really required in this driver ? > #define XILINX_DPDMA_DEBUGFS_READ_MAX_SIZE 32 > #define XILINX_DPDMA_DEBUGFS_UINT16_MAX_STR "65535" > > @@ -299,7 +296,7 @@ struct xilinx_dpdma_debugfs_request { > > static void xilinx_dpdma_debugfs_desc_done_irq(struct xilinx_dpdma_chan *chan) > { > - if (chan->id == dpdma_debugfs.chan_id) > + if (IS_ENABLED(CONFIG_DEBUG_FS) && chan->id == dpdma_debugfs.chan_id) > dpdma_debugfs.xilinx_dpdma_irq_done_count++; > } > > @@ -462,16 +459,6 @@ static void xilinx_dpdma_debugfs_init(struct xilinx_dpdma_device *xdev) > dev_err(xdev->dev, "Failed to create debugfs testcase file\n"); > } > > -#else > -static void xilinx_dpdma_debugfs_init(struct xilinx_dpdma_device *xdev) > -{ > -} > - > -static void xilinx_dpdma_debugfs_desc_done_irq(struct xilinx_dpdma_chan *chan) > -{ > -} > -#endif /* CONFIG_DEBUG_FS */ > - > /* ----------------------------------------------------------------------------- > * I/O Accessors > */ > diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h > index e5c2c9e71bf1..9000f3ffce8b 100644 > --- a/include/linux/dmaengine.h > +++ b/include/linux/dmaengine.h > @@ -944,10 +944,8 @@ struct dma_device { > void (*device_issue_pending)(struct dma_chan *chan); > void (*device_release)(struct dma_device *dev); > /* debugfs support */ > -#ifdef CONFIG_DEBUG_FS > void (*dbg_summary_show)(struct seq_file *s, struct dma_device *dev); > struct dentry *dbg_dev_root; > -#endif > }; > > static inline int dmaengine_slave_config(struct dma_chan *chan, -- Regards, Laurent Pinchart From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A6CB9C433F5 for ; Mon, 20 Sep 2021 12:49:55 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4ED9560F58 for ; Mon, 20 Sep 2021 12:49:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4ED9560F58 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=vWhjf8cxUic99dd9D1cmToTY9fypxcxKJTF8N8JaacE=; b=DOi2fdxM9UhLzx WGduFRQeGhkTKDCYNpscxLLmDdLvmKZBcF3nnhfYlX8l6pNXUQGqNB9vGcq7MAQlfeNtg5SZ5mOyB M1N1JoNkr042h94ZopB5plwwGWv1IrdqhaRY+E1eVGU0upUwyL65HNuvjjbuYEm2m7weIzsdDmAU+ 5aJIqQolNeaf+43HkkoiwdKumGf0TkKr3CKCX+0VnaVBwLiT/iuzQAHs1iKcPnLI2uxGauoArn4HH cWOecVstXk6/dD/8VoDbj1PUlG0MCEa4SbxHaE6dHbyBK/saNOryYdX9GyClfk6QZD14zJERMIqad wd9bNXR6kw/fwk7lDczg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mSIi8-001eCR-Ia; Mon, 20 Sep 2021 12:47:52 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mSIhy-001e9J-6Y for linux-arm-kernel@lists.infradead.org; Mon, 20 Sep 2021 12:47:43 +0000 Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 5B38BE57; Mon, 20 Sep 2021 14:47:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1632142057; bh=sUHy5mI48lLJfk0k+EUA5Q2mX9cYsAejPY8yjVUg2ks=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=msjI+3iUrWdFQ0rNpQ9h1aEphCugLPzQGK+AvdqcX51vj4ctb8kiB26dSBp/iwEvw qwEqmoZfKEXornPDuVtejK5URA38OVvGakD/wefgsjEzoSSlxEJD/E/pcDTzvekBaY 1pC2bixWM3bGWoPPFeQ3CJZr5Z/q1kyOunX34bTs= Date: Mon, 20 Sep 2021 15:47:07 +0300 From: Laurent Pinchart To: Arnd Bergmann Cc: Hyun Kwon , Vinod Koul , Michal Simek , Sanjay R Mehta , Peter Ujfalusi , Arnd Bergmann , Jianqiang Chen , Quanyang Wang , Yang Li , Allen Pais , Lad Prabhakar , Biju Das , Andy Shevchenko , dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] dmaengine: remove debugfs #ifdef Message-ID: References: <20210920122017.205975-1-arnd@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210920122017.205975-1-arnd@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210920_054742_456513_2915F535 X-CRM114-Status: GOOD ( 23.76 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Arnd, Thank you for the patch. On Mon, Sep 20, 2021 at 02:20:07PM +0200, Arnd Bergmann wrote: > From: Arnd Bergmann > > The ptdma driver has added debugfs support, but this fails to build > when debugfs is disabled: > > drivers/dma/ptdma/ptdma-debugfs.c: In function 'ptdma_debugfs_setup': > drivers/dma/ptdma/ptdma-debugfs.c:93:54: error: 'struct dma_device' has no member named 'dbg_dev_root' > 93 | debugfs_create_file("info", 0400, pt->dma_dev.dbg_dev_root, pt, > | ^ > drivers/dma/ptdma/ptdma-debugfs.c:96:55: error: 'struct dma_device' has no member named 'dbg_dev_root' > 96 | debugfs_create_file("stats", 0400, pt->dma_dev.dbg_dev_root, pt, > | ^ > drivers/dma/ptdma/ptdma-debugfs.c:102:52: error: 'struct dma_device' has no member named 'dbg_dev_root' > 102 | debugfs_create_dir("q", pt->dma_dev.dbg_dev_root); > | ^ > > Remove the #ifdef in the header, as this only saves a few bytes, > but would require ugly #ifdefs in each driver using it. > Simplify the other user while we're at it. > > Fixes: e2fb2e2a33fa ("dmaengine: ptdma: Add debugfs entries for PTDMA") > Fixes: 26cf132de6f7 ("dmaengine: Create debug directories for DMA devices") > Signed-off-by: Arnd Bergmann > --- > drivers/dma/xilinx/xilinx_dpdma.c | 15 +-------------- > include/linux/dmaengine.h | 2 -- > 2 files changed, 1 insertion(+), 16 deletions(-) > > diff --git a/drivers/dma/xilinx/xilinx_dpdma.c b/drivers/dma/xilinx/xilinx_dpdma.c > index b280a53e8570..ce5c66e6897d 100644 > --- a/drivers/dma/xilinx/xilinx_dpdma.c > +++ b/drivers/dma/xilinx/xilinx_dpdma.c > @@ -271,9 +271,6 @@ struct xilinx_dpdma_device { > /* ----------------------------------------------------------------------------- > * DebugFS > */ > - > -#ifdef CONFIG_DEBUG_FS > - It's only a few bytes of data in struct dma_device, but a bit more in .text here. Is the simplification really required in this driver ? > #define XILINX_DPDMA_DEBUGFS_READ_MAX_SIZE 32 > #define XILINX_DPDMA_DEBUGFS_UINT16_MAX_STR "65535" > > @@ -299,7 +296,7 @@ struct xilinx_dpdma_debugfs_request { > > static void xilinx_dpdma_debugfs_desc_done_irq(struct xilinx_dpdma_chan *chan) > { > - if (chan->id == dpdma_debugfs.chan_id) > + if (IS_ENABLED(CONFIG_DEBUG_FS) && chan->id == dpdma_debugfs.chan_id) > dpdma_debugfs.xilinx_dpdma_irq_done_count++; > } > > @@ -462,16 +459,6 @@ static void xilinx_dpdma_debugfs_init(struct xilinx_dpdma_device *xdev) > dev_err(xdev->dev, "Failed to create debugfs testcase file\n"); > } > > -#else > -static void xilinx_dpdma_debugfs_init(struct xilinx_dpdma_device *xdev) > -{ > -} > - > -static void xilinx_dpdma_debugfs_desc_done_irq(struct xilinx_dpdma_chan *chan) > -{ > -} > -#endif /* CONFIG_DEBUG_FS */ > - > /* ----------------------------------------------------------------------------- > * I/O Accessors > */ > diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h > index e5c2c9e71bf1..9000f3ffce8b 100644 > --- a/include/linux/dmaengine.h > +++ b/include/linux/dmaengine.h > @@ -944,10 +944,8 @@ struct dma_device { > void (*device_issue_pending)(struct dma_chan *chan); > void (*device_release)(struct dma_device *dev); > /* debugfs support */ > -#ifdef CONFIG_DEBUG_FS > void (*dbg_summary_show)(struct seq_file *s, struct dma_device *dev); > struct dentry *dbg_dev_root; > -#endif > }; > > static inline int dmaengine_slave_config(struct dma_chan *chan, -- Regards, Laurent Pinchart _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel