From: Rui Miguel Silva <rmfrfs@gmail.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: devel@driverdev.osuosl.org, Fabio Estevam <festevam@gmail.com>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Sascha Hauer <s.hauer@pengutronix.de>,
linux-kernel@vger.kernel.org, NXP Linux Team <linux-imx@nxp.com>,
Philipp Zabel <p.zabel@pengutronix.de>,
Steve Longerbeam <slongerbeam@gmail.com>,
Hans Verkuil <hverkuil-cisco@xs4all.nl>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Shawn Guo <shawnguo@kernel.org>,
linux-arm-kernel@lists.infradead.org,
linux-media@vger.kernel.org
Subject: Re: [PATCH] staging: media: imx7-mipi-csis: fix debugfs compilation
Date: Thu, 14 Mar 2019 10:17:51 +0000 [thread overview]
Message-ID: <m3r2b9ep4g.fsf@gmail.com> (raw)
In-Reply-To: <20190313211748.534491-1-arnd@arndb.de>
Hi Arnd,
Thanks for the patch.
On Wed 13 Mar 2019 at 21:17, Arnd Bergmann wrote:
> 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 <arnd@arndb.de>
Reviewed-by: Rui Miguel Silva <rmfrfs@gmail.com>
---
Cheers,
Rui
> ---
> 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 <linux/clk.h>
> +#include <linux/debugfs.h>
> #include <linux/delay.h>
> #include <linux/errno.h>
> #include <linux/interrupt.h>
> @@ -889,8 +890,6 @@ static int mipi_csis_subdev_init(struct
> v4l2_subdev *mipi_sd,
> return ret;
> }
>
> -#ifdef CONFIG_DEBUG_FS
> -#include <linux/debugfs.h>
>
> 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;
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
WARNING: multiple messages have this Message-ID (diff)
From: Rui Miguel Silva <rmfrfs@gmail.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Steve Longerbeam <slongerbeam@gmail.com>,
Philipp Zabel <p.zabel@pengutronix.de>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Shawn Guo <shawnguo@kernel.org>,
Sascha Hauer <s.hauer@pengutronix.de>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Fabio Estevam <festevam@gmail.com>,
NXP Linux Team <linux-imx@nxp.com>,
Hans Verkuil <hverkuil-cisco@xs4all.nl>,
linux-media@vger.kernel.org, devel@driverdev.osuosl.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: media: imx7-mipi-csis: fix debugfs compilation
Date: Thu, 14 Mar 2019 10:17:51 +0000 [thread overview]
Message-ID: <m3r2b9ep4g.fsf@gmail.com> (raw)
In-Reply-To: <20190313211748.534491-1-arnd@arndb.de>
Hi Arnd,
Thanks for the patch.
On Wed 13 Mar 2019 at 21:17, Arnd Bergmann wrote:
> 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 <arnd@arndb.de>
Reviewed-by: Rui Miguel Silva <rmfrfs@gmail.com>
---
Cheers,
Rui
> ---
> 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 <linux/clk.h>
> +#include <linux/debugfs.h>
> #include <linux/delay.h>
> #include <linux/errno.h>
> #include <linux/interrupt.h>
> @@ -889,8 +890,6 @@ static int mipi_csis_subdev_init(struct
> v4l2_subdev *mipi_sd,
> return ret;
> }
>
> -#ifdef CONFIG_DEBUG_FS
> -#include <linux/debugfs.h>
>
> 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;
next prev parent reply other threads:[~2019-03-14 10:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-13 21:17 [PATCH] staging: media: imx7-mipi-csis: fix debugfs compilation Arnd Bergmann
2019-03-13 21:17 ` Arnd Bergmann
2019-03-14 10:17 ` Rui Miguel Silva [this message]
2019-03-14 10:17 ` Rui Miguel Silva
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3r2b9ep4g.fsf@gmail.com \
--to=rmfrfs@gmail.com \
--cc=arnd@arndb.de \
--cc=devel@driverdev.osuosl.org \
--cc=festevam@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=hverkuil-cisco@xs4all.nl \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-imx@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
--cc=slongerbeam@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.