Re: dubious section mismatch test (was Re: [PULL] soc-camera: one commit as v4l2-dev preparation)

2009-06-05 Thread Sam Ravnborg
On Sun, May 10, 2009 at 08:33:03PM +0200, Guennadi Liakhovetski wrote:
 On Sat, 9 May 2009, Sam Ravnborg wrote:
 
  On Sat, May 09, 2009 at 06:13:13PM +0200, Guennadi Liakhovetski wrote:
   On Sat, 9 May 2009, Mauro Carvalho Chehab wrote:
   
WARNING: /home/v4l/master/v4l/soc_camera.o(.data+0x0): Section mismatch 
in reference from the variable soc_camera_pdrv to the function 
.devinit.text:soc_camera_pdrv_probe()
The variable soc_camera_pdrv references
the function __devinit soc_camera_pdrv_probe()
If the reference is valid then annotate the
variable with __init* (see linux/init.h) or name the variable:
*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, 
*_console, 

WARNING: /home/v4l/master/v4l/soc_camera.o(.data+0x8): Section mismatch 
in reference from the variable soc_camera_pdrv to the function 
.devexit.text:soc_camera_pdrv_remove()
The variable soc_camera_pdrv references
the function __devexit soc_camera_pdrv_remove()
If the reference is valid then annotate the
variable with __exit* (see linux/init.h) or name the variable:
*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, 
*_console, 
   
   FWIW, I find this test dubious. Matching on symbol names doesn't seem 
   like 
   a good idea to me. Can we introduce a new marker instead something like
   
   static struct whatever_driver __driver driver = {
 .probe  = my_probe,
 .remove = __exit_p(my_remove),
   };
   
   to put them in a new special section? Or is there a better solution?
  
  We already have that:
  __refdata would be your choice in this case.
 
 Aha, great! Then also the warning text should be changed, shouldn't it?

Yep - included __refdata in the warning now.

Sam
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: dubious section mismatch test (was Re: [PULL] soc-camera: one commit as v4l2-dev preparation)

2009-05-10 Thread Guennadi Liakhovetski
On Sat, 9 May 2009, Sam Ravnborg wrote:

 On Sat, May 09, 2009 at 06:13:13PM +0200, Guennadi Liakhovetski wrote:
  On Sat, 9 May 2009, Mauro Carvalho Chehab wrote:
  
   WARNING: /home/v4l/master/v4l/soc_camera.o(.data+0x0): Section mismatch 
   in reference from the variable soc_camera_pdrv to the function 
   .devinit.text:soc_camera_pdrv_probe()
   The variable soc_camera_pdrv references
   the function __devinit soc_camera_pdrv_probe()
   If the reference is valid then annotate the
   variable with __init* (see linux/init.h) or name the variable:
   *driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, 
   *_console, 
   
   WARNING: /home/v4l/master/v4l/soc_camera.o(.data+0x8): Section mismatch 
   in reference from the variable soc_camera_pdrv to the function 
   .devexit.text:soc_camera_pdrv_remove()
   The variable soc_camera_pdrv references
   the function __devexit soc_camera_pdrv_remove()
   If the reference is valid then annotate the
   variable with __exit* (see linux/init.h) or name the variable:
   *driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, 
   *_console, 
  
  FWIW, I find this test dubious. Matching on symbol names doesn't seem like 
  a good idea to me. Can we introduce a new marker instead something like
  
  static struct whatever_driver __driver driver = {
  .probe  = my_probe,
  .remove = __exit_p(my_remove),
  };
  
  to put them in a new special section? Or is there a better solution?
 
 We already have that:
 __refdata would be your choice in this case.

Aha, great! Then also the warning text should be changed, shouldn't it?

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PULL] soc-camera: one commit as v4l2-dev preparation

2009-05-09 Thread Mauro Carvalho Chehab
Em Thu, 7 May 2009 18:47:53 +0200 (CEST)
Guennadi Liakhovetski g.liakhovet...@gmx.de escreveu:

 Hi Mauro,
 
 Please pull from http://linuxtv.org/hg/~gliakhovetski/v4l-dvb
 
 for the following changeset:
 
 01/01: soc-camera: prepare for the platform driver conversion
 http://linuxtv.org/hg/~gliakhovetski/v4l-dvb?cmd=changeset;node=0a8bf9a89ae4
 
  drivers/media/video/soc_camera.c |   73 
 +++
  include/media/soc_camera.h   |5 ++
  2 files changed, 72 insertions(+), 6 deletions(-)
 
 I posted this patch about 2 weeks ago to the list for review, it creates 
 basis for gradual conversion of all affected platforms to the intermediate 
 platform driver stage of soc-camera, on its way to v4l2-subdev API. With 
 this patch we shall be able then to convert all platforms one by one to 
 their final form, which they shall then be able to preserve also when the 
 v4l2-subdev API is in place. So, it would help, if you could push this 
 change ASAP to linux-next, so we can start converting single platforms.

Guennadi,

Applied, but it is not producing two section mismatches. Please fix it and send
this patch alone, ASAP, since I intend to fold it together with your patch, at 
my -git.

WARNING: /home/v4l/master/v4l/soc_camera.o(.data+0x0): Section mismatch in 
reference from the variable soc_camera_pdrv to the function 
.devinit.text:soc_camera_pdrv_probe()
The variable soc_camera_pdrv references
the function __devinit soc_camera_pdrv_probe()
If the reference is valid then annotate the
variable with __init* (see linux/init.h) or name the variable:
*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console, 

WARNING: /home/v4l/master/v4l/soc_camera.o(.data+0x8): Section mismatch in 
reference from the variable soc_camera_pdrv to the function 
.devexit.text:soc_camera_pdrv_remove()
The variable soc_camera_pdrv references
the function __devexit soc_camera_pdrv_remove()
If the reference is valid then annotate the
variable with __exit* (see linux/init.h) or name the variable:
*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console, 

Btw,

I've aded a new target on our building system:
make mismatch

It would be better to use the newer tag, instead of just make before sending
patches to me, to be sure that the code won't generate section mismatches.



Cheers,
Mauro
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PULL] soc-camera: one commit as v4l2-dev preparation

2009-05-09 Thread Guennadi Liakhovetski
On Sat, 9 May 2009, Mauro Carvalho Chehab wrote:

 Applied, but it is not producing two section mismatches. Please fix it and 
 send
 this patch alone, ASAP, since I intend to fold it together with your patch, 
 at my -git.
 
 WARNING: /home/v4l/master/v4l/soc_camera.o(.data+0x0): Section mismatch in 
 reference from the variable soc_camera_pdrv to the function 
 .devinit.text:soc_camera_pdrv_probe()
 The variable soc_camera_pdrv references
 the function __devinit soc_camera_pdrv_probe()
 If the reference is valid then annotate the
 variable with __init* (see linux/init.h) or name the variable:
 *driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console, 
 
 WARNING: /home/v4l/master/v4l/soc_camera.o(.data+0x8): Section mismatch in 
 reference from the variable soc_camera_pdrv to the function 
 .devexit.text:soc_camera_pdrv_remove()
 The variable soc_camera_pdrv references
 the function __devexit soc_camera_pdrv_remove()
 If the reference is valid then annotate the
 variable with __exit* (see linux/init.h) or name the variable:
 *driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console, 

Grrr, yeah, to be honest, I find this rule, hm, at least funny. It is 
an absolutely standard construct:

+static struct platform_driver soc_camera_pdrv = {
+   .probe  = soc_camera_pdrv_probe,
+   .remove = __exit_p(soc_camera_pdrv_remove),
+   .driver = {
+   .name = soc-camera-pdrv,
+   .owner = THIS_MODULE,
+   },
+};
+

where .probe function is a __devinit, and .remove is a __devexit, and the 
test is complaining about a section mismatch _unless_ you name the struct 
with *driver or *_template or *_timer or... I don't find this very 
helpful FWIW. Ok, I'll rename the struct to soc_camera_pdriver. If you 
want, you can do this yourself, just a trivial change, or I'll send a 
patch tonight, in about 8 hours, is that enough?

 Btw,
 
 I've aded a new target on our building system:
   make mismatch
 
 It would be better to use the newer tag, instead of just make before sending
 patches to me, to be sure that the code won't generate section mismatches.

You mean to the hg repository? Nice, but I'm not building in hg, I always 
only build in complete trees...

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PULL] soc-camera: one commit as v4l2-dev preparation

2009-05-09 Thread Mauro Carvalho Chehab
Em Sat, 9 May 2009 12:46:07 +0200 (CEST)
Guennadi Liakhovetski g.liakhovet...@gmx.de escreveu:

 On Sat, 9 May 2009, Mauro Carvalho Chehab wrote:
 
  Applied, but it is not producing two section mismatches. Please fix it and 
  send
  this patch alone, ASAP, since I intend to fold it together with your patch, 
  at my -git.
  
  WARNING: /home/v4l/master/v4l/soc_camera.o(.data+0x0): Section mismatch in 
  reference from the variable soc_camera_pdrv to the function 
  .devinit.text:soc_camera_pdrv_probe()
  The variable soc_camera_pdrv references
  the function __devinit soc_camera_pdrv_probe()
  If the reference is valid then annotate the
  variable with __init* (see linux/init.h) or name the variable:
  *driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, 
  *_console, 
  
  WARNING: /home/v4l/master/v4l/soc_camera.o(.data+0x8): Section mismatch in 
  reference from the variable soc_camera_pdrv to the function 
  .devexit.text:soc_camera_pdrv_remove()
  The variable soc_camera_pdrv references
  the function __devexit soc_camera_pdrv_remove()
  If the reference is valid then annotate the
  variable with __exit* (see linux/init.h) or name the variable:
  *driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, 
  *_console, 
 
 Grrr, yeah, to be honest, I find this rule, hm, at least funny. It is 
 an absolutely standard construct:
 
 +static struct platform_driver soc_camera_pdrv = {
 + .probe  = soc_camera_pdrv_probe,
 + .remove = __exit_p(soc_camera_pdrv_remove),
 + .driver = {
 + .name = soc-camera-pdrv,
 + .owner = THIS_MODULE,
 + },
 +};
 +
 
 where .probe function is a __devinit, and .remove is a __devexit, and the 
 test is complaining about a section mismatch _unless_ you name the struct 
 with *driver or *_template or *_timer or... I don't find this very 
 helpful FWIW.

You may alternatively propose an upstream patch to remove the dumb rule, or
question at LKML about it.

 Ok, I'll rename the struct to soc_camera_pdriver. If you 
 want, you can do this yourself, just a trivial change, or I'll send a 
 patch tonight, in about 8 hours, is that enough?

Yes, this is ok.

 
  Btw,
  
  I've aded a new target on our building system:
  make mismatch
  
  It would be better to use the newer tag, instead of just make before 
  sending
  patches to me, to be sure that the code won't generate section mismatches.
 
 You mean to the hg repository? Nice, but I'm not building in hg, I always 
 only build in complete trees...

Ok, but anyway, this is useful for me and probably for other developers.
 
 Thanks
 Guennadi
 ---
 Guennadi Liakhovetski, Ph.D.
 Freelance Open-Source Software Developer
 http://www.open-technology.de/
 --
 To unsubscribe from this list: send the line unsubscribe linux-media in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html




Cheers,
Mauro
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


dubious section mismatch test (was Re: [PULL] soc-camera: one commit as v4l2-dev preparation)

2009-05-09 Thread Guennadi Liakhovetski
On Sat, 9 May 2009, Mauro Carvalho Chehab wrote:

 WARNING: /home/v4l/master/v4l/soc_camera.o(.data+0x0): Section mismatch in 
 reference from the variable soc_camera_pdrv to the function 
 .devinit.text:soc_camera_pdrv_probe()
 The variable soc_camera_pdrv references
 the function __devinit soc_camera_pdrv_probe()
 If the reference is valid then annotate the
 variable with __init* (see linux/init.h) or name the variable:
 *driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console, 
 
 WARNING: /home/v4l/master/v4l/soc_camera.o(.data+0x8): Section mismatch in 
 reference from the variable soc_camera_pdrv to the function 
 .devexit.text:soc_camera_pdrv_remove()
 The variable soc_camera_pdrv references
 the function __devexit soc_camera_pdrv_remove()
 If the reference is valid then annotate the
 variable with __exit* (see linux/init.h) or name the variable:
 *driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console, 

FWIW, I find this test dubious. Matching on symbol names doesn't seem like 
a good idea to me. Can we introduce a new marker instead something like

static struct whatever_driver __driver driver = {
.probe  = my_probe,
.remove = __exit_p(my_remove),
};

to put them in a new special section? Or is there a better solution?

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PULL] soc-camera: one commit as v4l2-dev preparation

2009-05-07 Thread Guennadi Liakhovetski
Hi Mauro,

Please pull from http://linuxtv.org/hg/~gliakhovetski/v4l-dvb

for the following changeset:

01/01: soc-camera: prepare for the platform driver conversion
http://linuxtv.org/hg/~gliakhovetski/v4l-dvb?cmd=changeset;node=0a8bf9a89ae4

 drivers/media/video/soc_camera.c |   73 +++
 include/media/soc_camera.h   |5 ++
 2 files changed, 72 insertions(+), 6 deletions(-)

I posted this patch about 2 weeks ago to the list for review, it creates 
basis for gradual conversion of all affected platforms to the intermediate 
platform driver stage of soc-camera, on its way to v4l2-subdev API. With 
this patch we shall be able then to convert all platforms one by one to 
their final form, which they shall then be able to preserve also when the 
v4l2-subdev API is in place. So, it would help, if you could push this 
change ASAP to linux-next, so we can start converting single platforms.

Thanks,
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html