Re: [v4l-dvb-maintainer] [-mm patch] drivers/media/video/ivtv/: possible cleanups
On Monday 05 March 2007 02:49, Adrian Bunk wrote: > On Fri, Mar 02, 2007 at 03:00:26AM -0800, Andrew Morton wrote: > >... > > Changes since 2.6.20-mm2: > >... > > git-dvb.patch > >... > > git trees > >... > > This patch contains the following possible cleanups: > - every file should #include the headers containing the prototypes > for it's global functions > - make the following needlessly global variables static: > - ivtv-driver.c: newi2c > - ivtv-streams.c: struct ivtv_stream_info[] > - make the following needlessly global functions static: > - ivtv-fileops.c: ivtv_stop_decoding() > - ivtv-i2c.c: ivtv_i2c_id_addr() > - #if 0 the following unused global functions: > - ivtv-i2c.c: ivtv_msp34xx() > - ivtv-udma.c: ivtv_udma_setup() > - ivtv-video.c: ivtv_encoder_enable() > - ivtv-driver.c: remove the unused EXPORT_SYMBOL's > > Signed-off-by: Adrian Bunk <[EMAIL PROTECTED]> NACK. A patch to fix the needlessly global functions is already in v4l-dvb, and the 'unused EXPORT_SYMBOLs' ARE in fact used by the ivtv-fb framebuffer. This module is not yet in the kernel, although I hope to do that for 2.6.22. Regards, Hans > > --- > > drivers/media/video/ivtv/ivtv-driver.c | 16 +--- > drivers/media/video/ivtv/ivtv-fileops.c |2 +- > drivers/media/video/ivtv/ivtv-fileops.h |1 - > drivers/media/video/ivtv/ivtv-i2c.c |5 - > drivers/media/video/ivtv/ivtv-i2c.h |2 -- > drivers/media/video/ivtv/ivtv-streams.c |2 +- > drivers/media/video/ivtv/ivtv-udma.c|2 ++ > drivers/media/video/ivtv/ivtv-udma.h|2 -- > drivers/media/video/ivtv/ivtv-video.c |2 ++ > drivers/media/video/ivtv/ivtv-video.h |1 - > drivers/media/video/ivtv/ivtv-yuv.c |1 + > 11 files changed, 12 insertions(+), 24 deletions(-) > > --- > linux-2.6.21-rc2-mm1/drivers/media/video/ivtv/ivtv-driver.c.old 2007- >03-04 21:00:12.0 +0100 +++ > linux-2.6.21-rc2-mm1/drivers/media/video/ivtv/ivtv-driver.c 2007-03-0 >4 21:04:50.0 +0100 @@ -121,7 +121,7 @@ > > int ivtv_debug = 0; > > -int newi2c = -1; > +static int newi2c = -1; > > module_param_array(tuner, int, _c, 0644); > module_param_array(radio, bool, _c, 0644); > @@ -1367,19 +1367,5 @@ > pci_unregister_driver(_pci_driver); > } > > -EXPORT_SYMBOL(ivtv_set_irq_mask); > -EXPORT_SYMBOL(ivtv_cards_active); > -EXPORT_SYMBOL(ivtv_cards); > -EXPORT_SYMBOL(ivtv_api); > -EXPORT_SYMBOL(ivtv_vapi); > -EXPORT_SYMBOL(ivtv_vapi_result); > -EXPORT_SYMBOL(ivtv_clear_irq_mask); > -EXPORT_SYMBOL(ivtv_debug); > -EXPORT_SYMBOL(ivtv_reset_ir_gpio); > -EXPORT_SYMBOL(ivtv_udma_setup); > -EXPORT_SYMBOL(ivtv_udma_unmap); > -EXPORT_SYMBOL(ivtv_udma_alloc); > -EXPORT_SYMBOL(ivtv_udma_prepare); > - > module_init(module_start); > module_exit(module_cleanup); > --- > linux-2.6.21-rc2-mm1/drivers/media/video/ivtv/ivtv-fileops.h.old 2007 >-03-04 21:00:35.0 +0100 +++ > linux-2.6.21-rc2-mm1/drivers/media/video/ivtv/ivtv-fileops.h 2007-03- >04 21:00:41.0 +0100 @@ -30,7 +30,6 @@ > int ivtv_start_capture(struct ivtv_open_id *id); > void ivtv_stop_capture(struct ivtv_open_id *id, int gop_end); > int ivtv_start_decoding(struct ivtv_open_id *id, int speed); > -void ivtv_stop_decoding(struct ivtv_open_id *id, int flags, u64 > pts); void ivtv_mute(struct ivtv *itv); > void ivtv_unmute(struct ivtv *itv); > > --- > linux-2.6.21-rc2-mm1/drivers/media/video/ivtv/ivtv-fileops.c.old 2007 >-03-04 21:00:50.0 +0100 +++ > linux-2.6.21-rc2-mm1/drivers/media/video/ivtv/ivtv-fileops.c 2007-03- >04 21:01:01.0 +0100 @@ -730,7 +730,7 @@ > ivtv_release_stream(s); > } > > -void ivtv_stop_decoding(struct ivtv_open_id *id, int flags, u64 pts) > +static void ivtv_stop_decoding(struct ivtv_open_id *id, int flags, > u64 pts) { > struct ivtv *itv = id->itv; > struct ivtv_stream *s = >streams[id->type]; > --- > linux-2.6.21-rc2-mm1/drivers/media/video/ivtv/ivtv-i2c.h.old 2007-03- >04 21:01:31.0 +0100 +++ > linux-2.6.21-rc2-mm1/drivers/media/video/ivtv/ivtv-i2c.h 2007-03-04 > 21:02:07.0 +0100 @@ -22,11 +22,9 @@ > int ivtv_saa7115(struct ivtv *itv, unsigned int cmd, void *arg); > int ivtv_saa7127(struct ivtv *itv, unsigned int cmd, void *arg); > int ivtv_saa717x(struct ivtv *itv, unsigned int cmd, void *arg); > -int ivtv_msp34xx(struct ivtv *itv, unsigned int cmd, void *arg); > int ivtv_upd64031a(struct ivtv *itv, unsigned int cmd, void *arg); > int ivtv_upd64083(struct ivtv *itv, unsigned int cmd, void *arg); > > -int ivtv_i2c_id_addr(struct ivtv *itv, u32 id); > int ivtv_i2c_hw_addr(struct ivtv *itv, u32 hw); > int ivtv_i2c_hw(struct ivtv *itv, u32 hw, unsigned int cmd, void > *arg); int ivtv_i2c_id(struct ivtv *itv, u32 id, unsigned int cmd, > void *arg); --- > linux-2.6.21-rc2-mm1/drivers/media/video/ivtv/ivtv-i2c.c.old 2007-03- >04 21:01:43.0 +0100 +++ > linux-2.6.21-rc2-mm1/drivers/media/video/ivtv/ivtv-i2c.c
Re: [v4l-dvb-maintainer] [-mm patch] drivers/media/video/ivtv/: possible cleanups
On Monday 05 March 2007 02:49, Adrian Bunk wrote: On Fri, Mar 02, 2007 at 03:00:26AM -0800, Andrew Morton wrote: ... Changes since 2.6.20-mm2: ... git-dvb.patch ... git trees ... This patch contains the following possible cleanups: - every file should #include the headers containing the prototypes for it's global functions - make the following needlessly global variables static: - ivtv-driver.c: newi2c - ivtv-streams.c: struct ivtv_stream_info[] - make the following needlessly global functions static: - ivtv-fileops.c: ivtv_stop_decoding() - ivtv-i2c.c: ivtv_i2c_id_addr() - #if 0 the following unused global functions: - ivtv-i2c.c: ivtv_msp34xx() - ivtv-udma.c: ivtv_udma_setup() - ivtv-video.c: ivtv_encoder_enable() - ivtv-driver.c: remove the unused EXPORT_SYMBOL's Signed-off-by: Adrian Bunk [EMAIL PROTECTED] NACK. A patch to fix the needlessly global functions is already in v4l-dvb, and the 'unused EXPORT_SYMBOLs' ARE in fact used by the ivtv-fb framebuffer. This module is not yet in the kernel, although I hope to do that for 2.6.22. Regards, Hans --- drivers/media/video/ivtv/ivtv-driver.c | 16 +--- drivers/media/video/ivtv/ivtv-fileops.c |2 +- drivers/media/video/ivtv/ivtv-fileops.h |1 - drivers/media/video/ivtv/ivtv-i2c.c |5 - drivers/media/video/ivtv/ivtv-i2c.h |2 -- drivers/media/video/ivtv/ivtv-streams.c |2 +- drivers/media/video/ivtv/ivtv-udma.c|2 ++ drivers/media/video/ivtv/ivtv-udma.h|2 -- drivers/media/video/ivtv/ivtv-video.c |2 ++ drivers/media/video/ivtv/ivtv-video.h |1 - drivers/media/video/ivtv/ivtv-yuv.c |1 + 11 files changed, 12 insertions(+), 24 deletions(-) --- linux-2.6.21-rc2-mm1/drivers/media/video/ivtv/ivtv-driver.c.old 2007- 03-04 21:00:12.0 +0100 +++ linux-2.6.21-rc2-mm1/drivers/media/video/ivtv/ivtv-driver.c 2007-03-0 4 21:04:50.0 +0100 @@ -121,7 +121,7 @@ int ivtv_debug = 0; -int newi2c = -1; +static int newi2c = -1; module_param_array(tuner, int, tuner_c, 0644); module_param_array(radio, bool, radio_c, 0644); @@ -1367,19 +1367,5 @@ pci_unregister_driver(ivtv_pci_driver); } -EXPORT_SYMBOL(ivtv_set_irq_mask); -EXPORT_SYMBOL(ivtv_cards_active); -EXPORT_SYMBOL(ivtv_cards); -EXPORT_SYMBOL(ivtv_api); -EXPORT_SYMBOL(ivtv_vapi); -EXPORT_SYMBOL(ivtv_vapi_result); -EXPORT_SYMBOL(ivtv_clear_irq_mask); -EXPORT_SYMBOL(ivtv_debug); -EXPORT_SYMBOL(ivtv_reset_ir_gpio); -EXPORT_SYMBOL(ivtv_udma_setup); -EXPORT_SYMBOL(ivtv_udma_unmap); -EXPORT_SYMBOL(ivtv_udma_alloc); -EXPORT_SYMBOL(ivtv_udma_prepare); - module_init(module_start); module_exit(module_cleanup); --- linux-2.6.21-rc2-mm1/drivers/media/video/ivtv/ivtv-fileops.h.old 2007 -03-04 21:00:35.0 +0100 +++ linux-2.6.21-rc2-mm1/drivers/media/video/ivtv/ivtv-fileops.h 2007-03- 04 21:00:41.0 +0100 @@ -30,7 +30,6 @@ int ivtv_start_capture(struct ivtv_open_id *id); void ivtv_stop_capture(struct ivtv_open_id *id, int gop_end); int ivtv_start_decoding(struct ivtv_open_id *id, int speed); -void ivtv_stop_decoding(struct ivtv_open_id *id, int flags, u64 pts); void ivtv_mute(struct ivtv *itv); void ivtv_unmute(struct ivtv *itv); --- linux-2.6.21-rc2-mm1/drivers/media/video/ivtv/ivtv-fileops.c.old 2007 -03-04 21:00:50.0 +0100 +++ linux-2.6.21-rc2-mm1/drivers/media/video/ivtv/ivtv-fileops.c 2007-03- 04 21:01:01.0 +0100 @@ -730,7 +730,7 @@ ivtv_release_stream(s); } -void ivtv_stop_decoding(struct ivtv_open_id *id, int flags, u64 pts) +static void ivtv_stop_decoding(struct ivtv_open_id *id, int flags, u64 pts) { struct ivtv *itv = id-itv; struct ivtv_stream *s = itv-streams[id-type]; --- linux-2.6.21-rc2-mm1/drivers/media/video/ivtv/ivtv-i2c.h.old 2007-03- 04 21:01:31.0 +0100 +++ linux-2.6.21-rc2-mm1/drivers/media/video/ivtv/ivtv-i2c.h 2007-03-04 21:02:07.0 +0100 @@ -22,11 +22,9 @@ int ivtv_saa7115(struct ivtv *itv, unsigned int cmd, void *arg); int ivtv_saa7127(struct ivtv *itv, unsigned int cmd, void *arg); int ivtv_saa717x(struct ivtv *itv, unsigned int cmd, void *arg); -int ivtv_msp34xx(struct ivtv *itv, unsigned int cmd, void *arg); int ivtv_upd64031a(struct ivtv *itv, unsigned int cmd, void *arg); int ivtv_upd64083(struct ivtv *itv, unsigned int cmd, void *arg); -int ivtv_i2c_id_addr(struct ivtv *itv, u32 id); int ivtv_i2c_hw_addr(struct ivtv *itv, u32 hw); int ivtv_i2c_hw(struct ivtv *itv, u32 hw, unsigned int cmd, void *arg); int ivtv_i2c_id(struct ivtv *itv, u32 id, unsigned int cmd, void *arg); --- linux-2.6.21-rc2-mm1/drivers/media/video/ivtv/ivtv-i2c.c.old 2007-03- 04 21:01:43.0 +0100 +++ linux-2.6.21-rc2-mm1/drivers/media/video/ivtv/ivtv-i2c.c 2007-03-04 21:27:22.0 +0100 @@ -62,6 +62,7 @@ #include ivtv-driver.h #include ivtv-cards.h #include