From patchwork Wed Mar 13 21:17:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10851799 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B74DD14DE for ; Wed, 13 Mar 2019 21:18:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9F46B29AB5 for ; Wed, 13 Mar 2019 21:18:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 90D7429FC3; Wed, 13 Mar 2019 21:18:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4CB9729AB5 for ; Wed, 13 Mar 2019 21:18:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=728Tbcx2ZH4q7B6saljPQiwAUR8jAek4Uh9o9RbctiI=; b=ePOzb11ejt4io0 TwfpatGOc0GwhyqRoIEgXa5xpKG+vO1hq2R3igvj22EjFCaJnQAxeBR32VydjJKyGVie0GgEHMtOt Jc+e90+02jTqBjomn9335TV9FxhWNsA/aA5Gr14iPzI5VmB82SaYyV573VFlwa0N+nYDpdtt/kF+d DI6REA9pxQqg2zRwk2e+vWFMEZ4W2NIUL3EXQG15A7t3qvk81w6teRUHlWp2S+Dfuz6szLirhw5zV EVjjREsEj6QUUPlgMSMu5tgrGvTZ86FmFCMw1ZzSpzXR/8X1zpgVibvpcPXvf79mpTjyI7wAbkC8C 8Et7Hhnue99egrHVlC5Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h4BGF-00008r-AL; Wed, 13 Mar 2019 21:18:03 +0000 Received: from mout.kundenserver.de ([212.227.126.187]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h4BGC-000087-4G for linux-arm-kernel@lists.infradead.org; Wed, 13 Mar 2019 21:18:01 +0000 Received: from wuerfel.lan ([109.192.41.194]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.129]) with ESMTPA (Nemesis) id 1M6DrU-1h6N6r3iMi-006dm8; Wed, 13 Mar 2019 22:17:50 +0100 From: Arnd Bergmann To: Rui Miguel Silva , Steve Longerbeam , Philipp Zabel , Mauro Carvalho Chehab Subject: [PATCH] staging: media: imx7-mipi-csis: fix debugfs compilation Date: Wed, 13 Mar 2019 22:17:32 +0100 Message-Id: <20190313211748.534491-1-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:SNoTQV7pLQFErYrCNqEuueldEPoz3NgvQS/zQAfLXbLZtg4/4XZ NqyoHVcn7AhLm+pyB8v/i+4lhKm/81zxi7RYUUZK3aFFrNBiW7EDRJ6+bbH1hVAC/pThdxT LDC7HAy5Yn9SKZt5gTSSRdrlRL8si9GPCpFsFMz1D9q3jnjjsOzRAKJ1y4E9ZtegvjqIOUv BjjFfwbmoU3Xa3bnRuQ7A== X-UI-Out-Filterresults: notjunk:1;V03:K0:kKpUg2pwm14=:LFCX4kSxrSCpSEmc9VbExf yI1hzlHRzBM71i49cew+IL6e+igPq7iprPxL9WpUqjUNlfrgdbOcoLoXy2U4/pXs8/5ejCphj ZKroi7Dw1Nn9md4uITL6kaAPAfxOuMmxgqeobcc7tRQwS06UdkcWUml3vZR7rdnuT/oSPDnpl ycUDJzWdnMqzJt4LOxNLKLgcqC5FtNPjDAIfRYR690u11WCZatOLiqN1mA4pYXFa6VJp4GH3W SDOX/M6Q81ceWPq/e5m8/2B8dN2m37TEK3dmXzHLuvDPjMWXy5uK4tGV7H0o8l9oZVwYDKgcc FmssSwF63XYckaMbI6wn3cqs9UXqk+PTq68YKESA/JETOqcZkgzvjQ5syAmXcXx1qbozcyefJ brnCqZ4a/TBrTQUW5d5vCl4ETDoPmHbhJEzsCELg2fIo06WWP1wrdpKOWnE2dqioFTh2i1zVK Kai6qWu7hHDIVOkTN8IgAwafDRE221Z9R5PGMj4sj+tEjd+WVS+EwKZBPYUCEmSQNMUna9dTe yP1KFvz+3pKzRFw8JqLsLYf/2hiUI8Cls6bJKhjxHS3sBuWuwmOn68RZrEeptjb6frb+RVLAk Fc4vHTHq04VgFmnddxekI3vMkpfBVZQg9NoELIElX8kNVhOxAS435UvKDuG73fajoneYnUqu+ xCPLcCt491MLFJ1Qepf6kOMHcMXbf9fu3Sd+myniIxQHxangIPOAqzyPHM5pKDGmKgiv7AcKF diQGrDy9NGJyDMGiHM22m/hTuQi2WvRVSQ2t3Q== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190313_141800_478814_DCD0E14E X-CRM114-Status: GOOD ( 12.78 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devel@driverdev.osuosl.org, Arnd Bergmann , Greg Kroah-Hartman , Sascha Hauer , linux-kernel@vger.kernel.org, NXP Linux Team , Pengutronix Kernel Team , Hans Verkuil , Shawn Guo , Fabio Estevam , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP When CONFIG_DEBUGFS is enabled, we get a warning about an incorrect section annotation that can lead to undefined behavior: WARNING: vmlinux.o(.text+0xd3c7c4): Section mismatch in reference from the function mipi_csis_probe() to the function .init.text:mipi_csis_debugfs_init() The function mipi_csis_probe() references the function __init mipi_csis_debugfs_init(). This is often because mipi_csis_probe lacks a __init annotation or the annotation of mipi_csis_debugfs_init is wrong. The same function for an unknown reason has a different version for !CONFIG_DEBUGFS, which does not have this problem, but behaves the same way otherwise (it does nothing when debugfs is disabled). Consolidate the two versions, using the correct section from one version, and the implementation from the other. Signed-off-by: Arnd Bergmann Reviewed-by: Rui Miguel Silva --- drivers/staging/media/imx/imx7-mipi-csis.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/drivers/staging/media/imx/imx7-mipi-csis.c b/drivers/staging/media/imx/imx7-mipi-csis.c index 2ddcc42ab8ff..001ce369ec45 100644 --- a/drivers/staging/media/imx/imx7-mipi-csis.c +++ b/drivers/staging/media/imx/imx7-mipi-csis.c @@ -9,6 +9,7 @@ */ #include +#include #include #include #include @@ -889,8 +890,6 @@ static int mipi_csis_subdev_init(struct v4l2_subdev *mipi_sd, return ret; } -#ifdef CONFIG_DEBUG_FS -#include static int mipi_csis_dump_regs_show(struct seq_file *m, void *private) { @@ -900,7 +899,7 @@ static int mipi_csis_dump_regs_show(struct seq_file *m, void *private) } DEFINE_SHOW_ATTRIBUTE(mipi_csis_dump_regs); -static int __init_or_module mipi_csis_debugfs_init(struct csi_state *state) +static int mipi_csis_debugfs_init(struct csi_state *state) { struct dentry *d; @@ -934,17 +933,6 @@ static void mipi_csis_debugfs_exit(struct csi_state *state) debugfs_remove_recursive(state->debugfs_root); } -#else -static int mipi_csis_debugfs_init(struct csi_state *state __maybe_unused) -{ - return 0; -} - -static void mipi_csis_debugfs_exit(struct csi_state *state __maybe_unused) -{ -} -#endif - static int mipi_csis_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev;