* [PATCH] omap_vout: Fix the build warning and section miss-match warning
@ 2012-03-09 12:14 Vaibhav Hiremath
2012-03-14 14:52 ` Laurent Pinchart
0 siblings, 1 reply; 3+ messages in thread
From: Vaibhav Hiremath @ 2012-03-09 12:14 UTC (permalink / raw)
To: linux-media
Cc: mchehab, archit, laurent.pinchart, linux-omap, Vaibhav Hiremath
Patch fixes below build warning and section miss-match warning
from omap_vout driver -
Build warnings:
=============
drivers/media/video/omap/omap_vout.c: In function 'omapvid_setup_overlay':
drivers/media/video/omap/omap_vout.c:381:17: warning: 'mode' may be used
uninitialized in this function
Section Mis-Match warnings:
==========================
WARNING: drivers/media/video/omap/omap-vout.o(.data+0x0): Section mismatch in
reference from the variable
omap_vout_driver to the function .init.text:omap_vout_probe()
The variable omap_vout_driver references
the function __init omap_vout_probe()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
---
drivers/media/video/omap/omap_vout.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/media/video/omap/omap_vout.c b/drivers/media/video/omap/omap_vout.c
index dffcf66..0fb0437 100644
--- a/drivers/media/video/omap/omap_vout.c
+++ b/drivers/media/video/omap/omap_vout.c
@@ -328,7 +328,7 @@ static int video_mode_to_dss_mode(struct omap_vout_device *vout)
struct omap_overlay *ovl;
struct omapvideo_info *ovid;
struct v4l2_pix_format *pix = &vout->pix;
- enum omap_color_mode mode;
+ enum omap_color_mode mode = -EINVAL;
ovid = &vout->vid_info;
ovl = ovid->overlays[0];
@@ -2108,7 +2108,7 @@ static void omap_vout_cleanup_device(struct omap_vout_device *vout)
kfree(vout);
}
-static int omap_vout_remove(struct platform_device *pdev)
+static int __devexit omap_vout_remove(struct platform_device *pdev)
{
int k;
struct v4l2_device *v4l2_dev = platform_get_drvdata(pdev);
@@ -2129,7 +2129,7 @@ static int omap_vout_remove(struct platform_device *pdev)
return 0;
}
-static int __init omap_vout_probe(struct platform_device *pdev)
+static int __devinit omap_vout_probe(struct platform_device *pdev)
{
int ret = 0, i;
struct omap_overlay *ovl;
@@ -2241,9 +2241,10 @@ probe_err0:
static struct platform_driver omap_vout_driver = {
.driver = {
.name = VOUT_NAME,
+ .owner = THIS_MODULE,
},
.probe = omap_vout_probe,
- .remove = omap_vout_remove,
+ .remove = __devexit_p(omap_vout_remove),
};
static int __init omap_vout_init(void)
--
1.7.0.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] omap_vout: Fix the build warning and section miss-match warning
2012-03-09 12:14 [PATCH] omap_vout: Fix the build warning and section miss-match warning Vaibhav Hiremath
@ 2012-03-14 14:52 ` Laurent Pinchart
2012-03-16 9:19 ` Hiremath, Vaibhav
0 siblings, 1 reply; 3+ messages in thread
From: Laurent Pinchart @ 2012-03-14 14:52 UTC (permalink / raw)
To: Vaibhav Hiremath; +Cc: linux-media, mchehab, archit, linux-omap
Hi Vaibhav,
Thanks for the patch.
On Friday 09 March 2012 17:44:03 Vaibhav Hiremath wrote:
> Patch fixes below build warning and section miss-match warning
> from omap_vout driver -
You should probably not refer to "patch below" in a commit message, as there
this won't be a patch anymore after it gets applied (and "below" is
meaningless in a git log).
> Build warnings:
> =============
> drivers/media/video/omap/omap_vout.c: In function 'omapvid_setup_overlay':
> drivers/media/video/omap/omap_vout.c:381:17: warning: 'mode' may be used
> uninitialized in this function
>
> Section Mis-Match warnings:
> ==========================
> WARNING: drivers/media/video/omap/omap-vout.o(.data+0x0): Section mismatch
> in reference from the variable
> omap_vout_driver to the function .init.text:omap_vout_probe()
> The variable omap_vout_driver references
> the function __init omap_vout_probe()
> If the reference is valid then annotate the
> variable with __init* or __refdata (see linux/init.h) or name the variable:
> *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
There are 3 fixes in this patch: compilation warning, section mismatch
warning, and addition of .owner = THIS_MODULE. I would have split the patch in
3.
> Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
>
> ---
> drivers/media/video/omap/omap_vout.c | 9 +++++----
> 1 files changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/media/video/omap/omap_vout.c
> b/drivers/media/video/omap/omap_vout.c index dffcf66..0fb0437 100644
> --- a/drivers/media/video/omap/omap_vout.c
> +++ b/drivers/media/video/omap/omap_vout.c
> @@ -328,7 +328,7 @@ static int video_mode_to_dss_mode(struct
> omap_vout_device *vout) struct omap_overlay *ovl;
> struct omapvideo_info *ovid;
> struct v4l2_pix_format *pix = &vout->pix;
> - enum omap_color_mode mode;
> + enum omap_color_mode mode = -EINVAL;
What about removing "case 0" below ? The default case would then set mode to -
EINVAL.
>
> ovid = &vout->vid_info;
> ovl = ovid->overlays[0];
> @@ -2108,7 +2108,7 @@ static void omap_vout_cleanup_device(struct
> omap_vout_device *vout) kfree(vout);
> }
>
> -static int omap_vout_remove(struct platform_device *pdev)
> +static int __devexit omap_vout_remove(struct platform_device *pdev)
> {
> int k;
> struct v4l2_device *v4l2_dev = platform_get_drvdata(pdev);
> @@ -2129,7 +2129,7 @@ static int omap_vout_remove(struct platform_device
> *pdev) return 0;
> }
>
> -static int __init omap_vout_probe(struct platform_device *pdev)
> +static int __devinit omap_vout_probe(struct platform_device *pdev)
> {
> int ret = 0, i;
> struct omap_overlay *ovl;
> @@ -2241,9 +2241,10 @@ probe_err0:
> static struct platform_driver omap_vout_driver = {
> .driver = {
> .name = VOUT_NAME,
> + .owner = THIS_MODULE,
> },
> .probe = omap_vout_probe,
> - .remove = omap_vout_remove,
> + .remove = __devexit_p(omap_vout_remove),
> };
>
> static int __init omap_vout_init(void)
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH] omap_vout: Fix the build warning and section miss-match warning
2012-03-14 14:52 ` Laurent Pinchart
@ 2012-03-16 9:19 ` Hiremath, Vaibhav
0 siblings, 0 replies; 3+ messages in thread
From: Hiremath, Vaibhav @ 2012-03-16 9:19 UTC (permalink / raw)
To: Laurent Pinchart
Cc: linux-media@vger.kernel.org, mchehab@infradead.org,
Taneja, Archit, linux-omap@vger.kernel.org
On Wed, Mar 14, 2012 at 20:22:37, Laurent Pinchart wrote:
> Hi Vaibhav,
>
> Thanks for the patch.
>
> On Friday 09 March 2012 17:44:03 Vaibhav Hiremath wrote:
> > Patch fixes below build warning and section miss-match warning
> > from omap_vout driver -
>
> You should probably not refer to "patch below" in a commit message, as there
> this won't be a patch anymore after it gets applied (and "below" is
> meaningless in a git log).
>
Ok.
> > Build warnings:
> > =============
> > drivers/media/video/omap/omap_vout.c: In function 'omapvid_setup_overlay':
> > drivers/media/video/omap/omap_vout.c:381:17: warning: 'mode' may be used
> > uninitialized in this function
> >
> > Section Mis-Match warnings:
> > ==========================
> > WARNING: drivers/media/video/omap/omap-vout.o(.data+0x0): Section mismatch
> > in reference from the variable
> > omap_vout_driver to the function .init.text:omap_vout_probe()
> > The variable omap_vout_driver references
> > the function __init omap_vout_probe()
> > If the reference is valid then annotate the
> > variable with __init* or __refdata (see linux/init.h) or name the variable:
> > *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
>
> There are 3 fixes in this patch: compilation warning, section mismatch
> warning, and addition of .owner = THIS_MODULE. I would have split the patch in
> 3.
>
Ok. Will separate them into 3.
> > Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
> >
> > ---
> > drivers/media/video/omap/omap_vout.c | 9 +++++----
> > 1 files changed, 5 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/media/video/omap/omap_vout.c
> > b/drivers/media/video/omap/omap_vout.c index dffcf66..0fb0437 100644
> > --- a/drivers/media/video/omap/omap_vout.c
> > +++ b/drivers/media/video/omap/omap_vout.c
> > @@ -328,7 +328,7 @@ static int video_mode_to_dss_mode(struct
> > omap_vout_device *vout) struct omap_overlay *ovl;
> > struct omapvideo_info *ovid;
> > struct v4l2_pix_format *pix = &vout->pix;
> > - enum omap_color_mode mode;
> > + enum omap_color_mode mode = -EINVAL;
>
> What about removing "case 0" below ? The default case would then set mode to -
> EINVAL.
>
Yeup... thanks for pointing this. Will fix it in next version.
Thanks,
Vaibhav
> >
> > ovid = &vout->vid_info;
> > ovl = ovid->overlays[0];
> > @@ -2108,7 +2108,7 @@ static void omap_vout_cleanup_device(struct
> > omap_vout_device *vout) kfree(vout);
> > }
> >
> > -static int omap_vout_remove(struct platform_device *pdev)
> > +static int __devexit omap_vout_remove(struct platform_device *pdev)
> > {
> > int k;
> > struct v4l2_device *v4l2_dev = platform_get_drvdata(pdev);
> > @@ -2129,7 +2129,7 @@ static int omap_vout_remove(struct platform_device
> > *pdev) return 0;
> > }
> >
> > -static int __init omap_vout_probe(struct platform_device *pdev)
> > +static int __devinit omap_vout_probe(struct platform_device *pdev)
> > {
> > int ret = 0, i;
> > struct omap_overlay *ovl;
> > @@ -2241,9 +2241,10 @@ probe_err0:
> > static struct platform_driver omap_vout_driver = {
> > .driver = {
> > .name = VOUT_NAME,
> > + .owner = THIS_MODULE,
> > },
> > .probe = omap_vout_probe,
> > - .remove = omap_vout_remove,
> > + .remove = __devexit_p(omap_vout_remove),
> > };
> >
> > static int __init omap_vout_init(void)
>
> --
> Regards,
>
> Laurent Pinchart
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-03-16 9:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-09 12:14 [PATCH] omap_vout: Fix the build warning and section miss-match warning Vaibhav Hiremath
2012-03-14 14:52 ` Laurent Pinchart
2012-03-16 9:19 ` Hiremath, Vaibhav
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).