tlg2300: make local variables and functions static
PATCH 1/1 tlg2300: make local variables and functions static
From: Márton Németh <[email protected]>
Make the local variables and functions static. Some of them are not exported by their symbol name but used trough other means. For example a pointer of the operation structure is passed through a function call.
This will remove the following sparse warnings (see "make C=1"):
* pd-video.c:20:5: warning: symbol 'usb_transfer_mode' was not declared. Should it be static?
* pd-video.c:621:5: warning: symbol 'fire_all_urb' was not declared. Should it be static?
* pd-video.c:881:5: warning: symbol 'vidioc_s_std' was not declared. Should it be static?
* pd-video.c:1024:5: warning: symbol 'vidioc_g_audio' was not declared. Should it be static?
* pd-video.c:1033:5: warning: symbol 'vidioc_s_audio' was not declared. Should it be static?
* pd-video.c:1193:5: warning: symbol 'usb_transfer_stop' was not declared. Should it be static?
* pd-video.c:1522:14: warning: symbol 'pd_video_poll' was not declared. Should it be static?
* pd-video.c:1528:9: warning: symbol 'pd_video_read' was not declared. Should it be static?
* pd-radio.c:164:5: warning: symbol 'tlg_fm_vidioc_g_tuner' was not declared. Should it be static?
* pd-radio.c:206:5: warning: symbol 'fm_get_freq' was not declared. Should it be static?
* pd-radio.c:249:5: warning: symbol 'fm_set_freq' was not declared. Should it be static?
* pd-radio.c:261:5: warning: symbol 'tlg_fm_vidioc_g_ctrl' was not declared. Should it be static?
* pd-radio.c:267:5: warning: symbol 'tlg_fm_vidioc_g_exts_ctrl' was not declared. Should it be static?
* pd-radio.c:288:5: warning: symbol 'tlg_fm_vidioc_s_exts_ctrl' was not declared. Should it be static?
* pd-radio.c:315:5: warning: symbol 'tlg_fm_vidioc_s_ctrl' was not declared. Should it be static?
* pd-radio.c:321:5: warning: symbol 'tlg_fm_vidioc_queryctrl' was not declared. Should it be static?
* pd-radio.c:340:5: warning: symbol 'tlg_fm_vidioc_querymenu' was not declared. Should it be static?
* pd-main.c:58:12: warning: symbol 'firmware_name' was not declared. Should it be static?
* pd-main.c:59:19: warning: symbol 'poseidon_driver' was not declared. Should it be static?
---
linux/drivers/media/video/tlg2300/pd-main.c +3 -3
@@ -55,8 +55,8 @@ int debug_mode;module_param (debug_mode, int,0644 );MODULE_PARM_DESC (debug_mode,"0 = disable, 1 = enable, 2 = verbose" ); -const char *firmware_name ="tlg2300_firmware.bin" ; -struct usb_driver poseidon_driver; +static const char *firmware_name ="tlg2300_firmware.bin" ; +static struct usb_driver poseidon_driver;static LIST_HEAD (pd_device_list);/*
@@ -501,7 +501,7 @@ static void poseidon_disconnect(struct ukref_put (&pd->kref, poseidon_delete); } -struct usb_driver poseidon_driver = { +static struct usb_driver poseidon_driver = { .name ="poseidon" , .probe = poseidon_probe, .disconnect = poseidon_disconnect,
linux/drivers/media/video/tlg2300/pd-radio.c +9 -9
@@ -161,7 +161,7 @@ static const struct v4l2_file_operations .ioctl = video_ioctl2, }; -int tlg_fm_vidioc_g_tuner (struct file *file,void *priv,struct v4l2_tuner *vt) +static int tlg_fm_vidioc_g_tuner (struct file *file,void *priv,struct v4l2_tuner *vt) {struct tuner_fm_sig_stat_s fm_stat = {};int ret, status, count =5 ;
@@ -203,7 +203,7 @@ int tlg_fm_vidioc_g_tuner(struct file *freturn 0 ; } -int fm_get_freq (struct file *file,void *priv,struct v4l2_frequency *argp) +static int fm_get_freq (struct file *file,void *priv,struct v4l2_frequency *argp) {struct poseidon *p = file->private_data;
@@ -246,7 +246,7 @@ error:return ret; } -int fm_set_freq (struct file *file,void *priv,struct v4l2_frequency *argp) +static int fm_set_freq (struct file *file,void *priv,struct v4l2_frequency *argp) {struct poseidon *p = file->private_data;
@@ -258,13 +258,13 @@ int fm_set_freq(struct file *file, voidreturn set_frequency (p, argp->frequency); } -int tlg_fm_vidioc_g_ctrl (struct file *file,void *priv, +static int tlg_fm_vidioc_g_ctrl (struct file *file,void *priv,struct v4l2_control *arg) {return 0 ; } -int tlg_fm_vidioc_g_exts_ctrl (struct file *file,void *fh, +static int tlg_fm_vidioc_g_exts_ctrl (struct file *file,void *fh,struct v4l2_ext_controls *ctrls) {struct poseidon *p = file->private_data;
@@ -285,7 +285,7 @@ int tlg_fm_vidioc_g_exts_ctrl(struct filreturn 0 ; } -int tlg_fm_vidioc_s_exts_ctrl (struct file *file,void *fh, +static int tlg_fm_vidioc_s_exts_ctrl (struct file *file,void *fh,struct v4l2_ext_controls *ctrls) {int i;
@@ -312,13 +312,13 @@ int tlg_fm_vidioc_s_exts_ctrl(struct filreturn 0 ; } -int tlg_fm_vidioc_s_ctrl (struct file *file,void *priv, +static int tlg_fm_vidioc_s_ctrl (struct file *file,void *priv,struct v4l2_control *ctrl) {return 0 ; } -int tlg_fm_vidioc_queryctrl (struct file *file,void *priv, +static int tlg_fm_vidioc_queryctrl (struct file *file,void *priv,struct v4l2_queryctrl *ctrl) {if (!(ctrl->id &V4L2_CTRL_FLAG_NEXT_CTRL ))
@@ -337,7 +337,7 @@ int tlg_fm_vidioc_queryctrl(struct filereturn -EINVAL ; } -int tlg_fm_vidioc_querymenu (struct file *file,void *fh, +static int tlg_fm_vidioc_querymenu (struct file *file,void *fh,struct v4l2_querymenu *qmenu) {return v4l2_ctrl_query_menu (qmenu,NULL ,NULL );
linux/drivers/media/video/tlg2300/pd-video.c +8 -8
@@ -17,7 +17,7 @@ static int pm_video_resume(struct poseid#endif static void iso_bubble_handler (struct work_struct *w); -int usb_transfer_mode; +static int usb_transfer_mode;module_param (usb_transfer_mode, int,0644 );MODULE_PARM_DESC (usb_transfer_mode,"0 = Bulk, 1 = Isochronous" );
@@ -618,7 +618,7 @@ static int pd_buf_prepare(struct videobureturn 0 ; } -int fire_all_urb (struct video_data *video) +static int fire_all_urb (struct video_data *video) {int i, ret;
@@ -878,7 +878,7 @@ out:return ret; } -int vidioc_s_std (struct file *file,void *fh,v4l2_std_id *norm) +static int vidioc_s_std (struct file *file,void *fh,v4l2_std_id *norm) {struct front_face *front = fh;logs (front);
@@ -1021,7 +1021,7 @@ static int vidioc_enumaudio(struct filereturn 0 ; } -int vidioc_g_audio (struct file *file,void *fh,struct v4l2_audio *a) +static int vidioc_g_audio (struct file *file,void *fh,struct v4l2_audio *a) { a->index =0 ; a->capability =V4L2_AUDCAP_STEREO ;
@@ -1030,7 +1030,7 @@ int vidioc_g_audio(struct file *file, voreturn 0 ; } -int vidioc_s_audio (struct file *file,void *fh,struct v4l2_audio *a) +static int vidioc_s_audio (struct file *file,void *fh,struct v4l2_audio *a) {return (0 == a->index) ?0 : -EINVAL ; }
@@ -1190,7 +1190,7 @@ static int vidioc_dqbuf(struct file *fil }/* Just stop the URBs, do not free the URBs */ -int usb_transfer_stop (struct video_data *video) +static int usb_transfer_stop (struct video_data *video) {if (video->is_streaming) {int i;
@@ -1519,13 +1519,13 @@ static int pd_video_mmap(struct file *fireturn videobuf_mmap_mapper (&front->q, vma); } -unsigned int pd_video_poll (struct file *file,poll_table *table) +static unsigned int pd_video_poll (struct file *file,poll_table *table) {struct front_face *front = file->private_data;return videobuf_poll_stream (file, &front->q, table); } -ssize_t pd_video_read (struct file *file,char __user *buffer, +static ssize_t pd_video_read (struct file *file,char __user *buffer,size_t count,loff_t *ppos) {struct front_face *front = file->private_data;
Quoted 75 lines
From: Márton Németh<[email protected]>
Make the local variables and functions static. Some of them are not exported by their symbol name but used trough other means. For example a pointer of the operation structure is passed through a function call.
This will remove the following sparse warnings (see "make C=1"):
* pd-video.c:20:5: warning: symbol 'usb_transfer_mode' was not declared. Should it be static?
* pd-video.c:621:5: warning: symbol 'fire_all_urb' was not declared. Should it be static?
* pd-video.c:881:5: warning: symbol 'vidioc_s_std' was not declared. Should it be static?
* pd-video.c:1024:5: warning: symbol 'vidioc_g_audio' was not declared. Should it be static?
* pd-video.c:1033:5: warning: symbol 'vidioc_s_audio' was not declared. Should it be static?
* pd-video.c:1193:5: warning: symbol 'usb_transfer_stop' was not declared. Should it be static?
* pd-video.c:1522:14: warning: symbol 'pd_video_poll' was not declared. Should it be static?
* pd-video.c:1528:9: warning: symbol 'pd_video_read' was not declared. Should it be static?
* pd-radio.c:164:5: warning: symbol 'tlg_fm_vidioc_g_tuner' was not declared. Should it be static?
* pd-radio.c:206:5: warning: symbol 'fm_get_freq' was not declared. Should it be static?
* pd-radio.c:249:5: warning: symbol 'fm_set_freq' was not declared. Should it be static?
* pd-radio.c:261:5: warning: symbol 'tlg_fm_vidioc_g_ctrl' was not declared. Should it be static?
* pd-radio.c:267:5: warning: symbol 'tlg_fm_vidioc_g_exts_ctrl' was not declared. Should it be static?
* pd-radio.c:288:5: warning: symbol 'tlg_fm_vidioc_s_exts_ctrl' was not declared. Should it be static?
* pd-radio.c:315:5: warning: symbol 'tlg_fm_vidioc_s_ctrl' was not declared. Should it be static?
* pd-radio.c:321:5: warning: symbol 'tlg_fm_vidioc_queryctrl' was not declared. Should it be static?
* pd-radio.c:340:5: warning: symbol 'tlg_fm_vidioc_querymenu' was not declared. Should it be static?
* pd-main.c:58:12: warning: symbol 'firmware_name' was not declared. Should it be static?
* pd-main.c:59:19: warning: symbol 'poseidon_driver' was not declared. Should it be static?Signed-off-by Márton Németh<[email protected]>---
diff -uprv4l-dvb.orig/linux/drivers/media/video/tlg2300/pd-main.cv4l-dvb/linux/drivers/media/video/tlg2300/pd-main.clinux/drivers/media/video/tlg2300/pd-main.c +3
-3@@ -55,8 +55,8 @@ int debug_mode;module_param (debug_mode, int,0644 );MODULE_PARM_DESC (debug_mode,"0 = disable, 1 = enable, 2 = verbose" ); -const char *firmware_name ="tlg2300_firmware.bin" ; -struct usb_driver poseidon_driver; +static const char *firmware_name ="tlg2300_firmware.bin" ; +static struct usb_driver poseidon_driver;static LIST_HEAD (pd_device_list);/* @@ -501,7 +501,7 @@ static void poseidon_disconnect(struct ukref_put (&pd->kref, poseidon_delete); } -struct usb_driver poseidon_driver = { +static struct usb_driver poseidon_driver = { .name ="poseidon" , .probe = poseidon_probe, .disconnect = poseidon_disconnect,diff -upr
v4l-dvb.orig/linux/drivers/media/video/tlg2300/pd-radio.cv4l-dvb/linux/drivers/media/video/tlg2300/pd-radio.clinux/drivers/media/video/tlg2300/pd-radio.c +2
-2@@ -161,7 +161,7 @@ static const struct v4l2_file_operations .ioctl = video_ioctl2, }; -int tlg_fm_vidioc_g_tuner (struct file *file,void *priv,struct v4l2_tuner *vt) +static int tlg_fm_vidioc_g_tuner (struct file *file,void *priv,struct v4l2_tuner *vt) {struct tuner_fm_sig_stat_s fm_stat = {};int ret, status, count =5 ;@@ -203,7 +203,7 @@ int tlg_fm_vidioc_g_tuner(struct file *freturn 0 ; } -int fm_get_freq (struct file *file,void *priv,struct v4l2_frequency *argp) +static int fm_get_freq (struct file *file,void *priv,struct v4l2_frequency *argp) {struct poseidon *p = file->private_data;
linux/drivers/media/video/tlg2300/pd-radio.c error: · line 250
Quoted 6 lines
linux/drivers/media/video/tlg2300/pd-radio.c +1
-1@@ -246,7 +246,7 @@ error:return ret; } -int fm_set_freq (struct file *file,void *priv,struct v4l2_frequency *argp) +static int fm_set_freq (struct file *file,void *priv,struct v4l2_frequency *argp)
thanks. But Do you check the patch by script ./scripts/checkpatch.pl. This line will cause :
"WARNING: line over 80 characters"
Please change the patch again, and resend it to me.
Quoted 128 lines
linux/drivers/media/video/tlg2300/pd-radio.c +6
-6{struct poseidon *p = file->private_data;@@ -258,13 +258,13 @@ int fm_set_freq(struct file *file, voidreturn set_frequency (p, argp->frequency); } -int tlg_fm_vidioc_g_ctrl (struct file *file,void *priv, +static int tlg_fm_vidioc_g_ctrl (struct file *file,void *priv,struct v4l2_control *arg) {return 0 ; } -int tlg_fm_vidioc_g_exts_ctrl (struct file *file,void *fh, +static int tlg_fm_vidioc_g_exts_ctrl (struct file *file,void *fh,struct v4l2_ext_controls *ctrls) {struct poseidon *p = file->private_data;@@ -285,7 +285,7 @@ int tlg_fm_vidioc_g_exts_ctrl(struct filreturn 0 ; } -int tlg_fm_vidioc_s_exts_ctrl (struct file *file,void *fh, +static int tlg_fm_vidioc_s_exts_ctrl (struct file *file,void *fh,struct v4l2_ext_controls *ctrls) {int i;@@ -312,13 +312,13 @@ int tlg_fm_vidioc_s_exts_ctrl(struct filreturn 0 ; } -int tlg_fm_vidioc_s_ctrl (struct file *file,void *priv, +static int tlg_fm_vidioc_s_ctrl (struct file *file,void *priv,struct v4l2_control *ctrl) {return 0 ; } -int tlg_fm_vidioc_queryctrl (struct file *file,void *priv, +static int tlg_fm_vidioc_queryctrl (struct file *file,void *priv,struct v4l2_queryctrl *ctrl) {if (!(ctrl->id&V4L2_CTRL_FLAG_NEXT_CTRL ))@@ -337,7 +337,7 @@ int tlg_fm_vidioc_queryctrl(struct filereturn -EINVAL ; } -int tlg_fm_vidioc_querymenu (struct file *file,void *fh, +static int tlg_fm_vidioc_querymenu (struct file *file,void *fh,struct v4l2_querymenu *qmenu) {return v4l2_ctrl_query_menu (qmenu,NULL ,NULL );diff -upr
v4l-dvb.orig/linux/drivers/media/video/tlg2300/pd-video.cv4l-dvb/linux/drivers/media/video/tlg2300/pd-video.clinux/drivers/media/video/tlg2300/pd-video.c +8
-8@@ -17,7 +17,7 @@ static int pm_video_resume(struct poseid#endif static void iso_bubble_handler (struct work_struct *w); -int usb_transfer_mode; +static int usb_transfer_mode;module_param (usb_transfer_mode, int,0644 );MODULE_PARM_DESC (usb_transfer_mode,"0 = Bulk, 1 = Isochronous" );@@ -618,7 +618,7 @@ static int pd_buf_prepare(struct videobureturn 0 ; } -int fire_all_urb (struct video_data *video) +static int fire_all_urb (struct video_data *video) {int i, ret;@@ -878,7 +878,7 @@ out:return ret; } -int vidioc_s_std (struct file *file,void *fh,v4l2_std_id *norm) +static int vidioc_s_std (struct file *file,void *fh,v4l2_std_id *norm) {struct front_face *front = fh;logs (front);@@ -1021,7 +1021,7 @@ static int vidioc_enumaudio(struct filereturn 0 ; } -int vidioc_g_audio (struct file *file,void *fh,struct v4l2_audio *a) +static int vidioc_g_audio (struct file *file,void *fh,struct v4l2_audio *a) { a->index =0 ; a->capability =V4L2_AUDCAP_STEREO ;@@ -1030,7 +1030,7 @@ int vidioc_g_audio(struct file *file, voreturn 0 ; } -int vidioc_s_audio (struct file *file,void *fh,struct v4l2_audio *a) +static int vidioc_s_audio (struct file *file,void *fh,struct v4l2_audio *a) {return (0 == a->index) ?0 : -EINVAL ; }@@ -1190,7 +1190,7 @@ static int vidioc_dqbuf(struct file *fil }/* Just stop the URBs, do not free the URBs */ -int usb_transfer_stop (struct video_data *video) +static int usb_transfer_stop (struct video_data *video) {if (video->is_streaming) {int i;@@ -1519,13 +1519,13 @@ static int pd_video_mmap(struct file *fireturn videobuf_mmap_mapper (&front->q, vma); } -unsigned int pd_video_poll (struct file *file,poll_table *table) +static unsigned int pd_video_poll (struct file *file,poll_table *table) {struct front_face *front = file->private_data;return videobuf_poll_stream (file,&front->q, table); } -ssize_t pd_video_read (struct file *file,char __user *buffer, +static ssize_t pd_video_read (struct file *file,char __user *buffer,size_t count,loff_t *ppos) {struct front_face *front = file->private_data;
PATCH 1/1 tlg2300: make local variables and functions static
From: Márton Németh <[email protected]>
Make the local variables and functions static. Some of them are not exported by their symbol name but used trough other means. For example a pointer of the operation structure is passed through a function call.
This will remove the following sparse warnings (see "make C=1"):
* pd-video.c:20:5: warning: symbol 'usb_transfer_mode' was not declared. Should it be static?
* pd-video.c:621:5: warning: symbol 'fire_all_urb' was not declared. Should it be static?
* pd-video.c:881:5: warning: symbol 'vidioc_s_std' was not declared. Should it be static?
* pd-video.c:1024:5: warning: symbol 'vidioc_g_audio' was not declared. Should it be static?
* pd-video.c:1033:5: warning: symbol 'vidioc_s_audio' was not declared. Should it be static?
* pd-video.c:1193:5: warning: symbol 'usb_transfer_stop' was not declared. Should it be static?
* pd-video.c:1522:14: warning: symbol 'pd_video_poll' was not declared. Should it be static?
* pd-video.c:1528:9: warning: symbol 'pd_video_read' was not declared. Should it be static?
* pd-radio.c:164:5: warning: symbol 'tlg_fm_vidioc_g_tuner' was not declared. Should it be static?
* pd-radio.c:206:5: warning: symbol 'fm_get_freq' was not declared. Should it be static?
* pd-radio.c:249:5: warning: symbol 'fm_set_freq' was not declared. Should it be static?
* pd-radio.c:261:5: warning: symbol 'tlg_fm_vidioc_g_ctrl' was not declared. Should it be static?
* pd-radio.c:267:5: warning: symbol 'tlg_fm_vidioc_g_exts_ctrl' was not declared. Should it be static?
* pd-radio.c:288:5: warning: symbol 'tlg_fm_vidioc_s_exts_ctrl' was not declared. Should it be static?
* pd-radio.c:315:5: warning: symbol 'tlg_fm_vidioc_s_ctrl' was not declared. Should it be static?
* pd-radio.c:321:5: warning: symbol 'tlg_fm_vidioc_queryctrl' was not declared. Should it be static?
* pd-radio.c:340:5: warning: symbol 'tlg_fm_vidioc_querymenu' was not declared. Should it be static?
* pd-main.c:58:12: warning: symbol 'firmware_name' was not declared. Should it be static?
* pd-main.c:59:19: warning: symbol 'poseidon_driver' was not declared. Should it be static?
---
linux/drivers/media/video/tlg2300/pd-main.c +3 -3
@@ -55,8 +55,8 @@ int debug_mode;module_param (debug_mode, int,0644 );MODULE_PARM_DESC (debug_mode,"0 = disable, 1 = enable, 2 = verbose" ); -const char *firmware_name ="tlg2300_firmware.bin" ; -struct usb_driver poseidon_driver; +static const char *firmware_name ="tlg2300_firmware.bin" ; +static struct usb_driver poseidon_driver;static LIST_HEAD (pd_device_list);/*
@@ -501,7 +501,7 @@ static void poseidon_disconnect(struct ukref_put (&pd->kref, poseidon_delete); } -struct usb_driver poseidon_driver = { +static struct usb_driver poseidon_driver = { .name ="poseidon" , .probe = poseidon_probe, .disconnect = poseidon_disconnect,
linux/drivers/media/video/tlg2300/pd-radio.c +12 -9
@@ -161,7 +161,8 @@ static const struct v4l2_file_operations .ioctl = video_ioctl2, }; -int tlg_fm_vidioc_g_tuner (struct file *file,void *priv,struct v4l2_tuner *vt) +static int tlg_fm_vidioc_g_tuner (struct file *file,void *priv, +struct v4l2_tuner *vt) {struct tuner_fm_sig_stat_s fm_stat = {};int ret, status, count =5 ;
@@ -203,7 +204,8 @@ int tlg_fm_vidioc_g_tuner(struct file *freturn 0 ; } -int fm_get_freq (struct file *file,void *priv,struct v4l2_frequency *argp) +static int fm_get_freq (struct file *file,void *priv, +struct v4l2_frequency *argp) {struct poseidon *p = file->private_data;
@@ -246,7 +248,8 @@ error:return ret; } -int fm_set_freq (struct file *file,void *priv,struct v4l2_frequency *argp) +static int fm_set_freq (struct file *file,void *priv, +struct v4l2_frequency *argp) {struct poseidon *p = file->private_data;
@@ -258,13 +261,13 @@ int fm_set_freq(struct file *file, voidreturn set_frequency (p, argp->frequency); } -int tlg_fm_vidioc_g_ctrl (struct file *file,void *priv, +static int tlg_fm_vidioc_g_ctrl (struct file *file,void *priv,struct v4l2_control *arg) {return 0 ; } -int tlg_fm_vidioc_g_exts_ctrl (struct file *file,void *fh, +static int tlg_fm_vidioc_g_exts_ctrl (struct file *file,void *fh,struct v4l2_ext_controls *ctrls) {struct poseidon *p = file->private_data;
@@ -285,7 +288,7 @@ int tlg_fm_vidioc_g_exts_ctrl(struct filreturn 0 ; } -int tlg_fm_vidioc_s_exts_ctrl (struct file *file,void *fh, +static int tlg_fm_vidioc_s_exts_ctrl (struct file *file,void *fh,struct v4l2_ext_controls *ctrls) {int i;
@@ -312,13 +315,13 @@ int tlg_fm_vidioc_s_exts_ctrl(struct filreturn 0 ; } -int tlg_fm_vidioc_s_ctrl (struct file *file,void *priv, +static int tlg_fm_vidioc_s_ctrl (struct file *file,void *priv,struct v4l2_control *ctrl) {return 0 ; } -int tlg_fm_vidioc_queryctrl (struct file *file,void *priv, +static int tlg_fm_vidioc_queryctrl (struct file *file,void *priv,struct v4l2_queryctrl *ctrl) {if (!(ctrl->id &V4L2_CTRL_FLAG_NEXT_CTRL ))
@@ -337,7 +340,7 @@ int tlg_fm_vidioc_queryctrl(struct filereturn -EINVAL ; } -int tlg_fm_vidioc_querymenu (struct file *file,void *fh, +static int tlg_fm_vidioc_querymenu (struct file *file,void *fh,struct v4l2_querymenu *qmenu) {return v4l2_ctrl_query_menu (qmenu,NULL ,NULL );
linux/drivers/media/video/tlg2300/pd-video.c +8 -8
@@ -17,7 +17,7 @@ static int pm_video_resume(struct poseid#endif static void iso_bubble_handler (struct work_struct *w); -int usb_transfer_mode; +static int usb_transfer_mode;module_param (usb_transfer_mode, int,0644 );MODULE_PARM_DESC (usb_transfer_mode,"0 = Bulk, 1 = Isochronous" );
@@ -618,7 +618,7 @@ static int pd_buf_prepare(struct videobureturn 0 ; } -int fire_all_urb (struct video_data *video) +static int fire_all_urb (struct video_data *video) {int i, ret;
@@ -878,7 +878,7 @@ out:return ret; } -int vidioc_s_std (struct file *file,void *fh,v4l2_std_id *norm) +static int vidioc_s_std (struct file *file,void *fh,v4l2_std_id *norm) {struct front_face *front = fh;logs (front);
@@ -1021,7 +1021,7 @@ static int vidioc_enumaudio(struct filereturn 0 ; } -int vidioc_g_audio (struct file *file,void *fh,struct v4l2_audio *a) +static int vidioc_g_audio (struct file *file,void *fh,struct v4l2_audio *a) { a->index =0 ; a->capability =V4L2_AUDCAP_STEREO ;
@@ -1030,7 +1030,7 @@ int vidioc_g_audio(struct file *file, voreturn 0 ; } -int vidioc_s_audio (struct file *file,void *fh,struct v4l2_audio *a) +static int vidioc_s_audio (struct file *file,void *fh,struct v4l2_audio *a) {return (0 == a->index) ?0 : -EINVAL ; }
@@ -1190,7 +1190,7 @@ static int vidioc_dqbuf(struct file *fil }/* Just stop the URBs, do not free the URBs */ -int usb_transfer_stop (struct video_data *video) +static int usb_transfer_stop (struct video_data *video) {if (video->is_streaming) {int i;
@@ -1519,13 +1519,13 @@ static int pd_video_mmap(struct file *fireturn videobuf_mmap_mapper (&front->q, vma); } -unsigned int pd_video_poll (struct file *file,poll_table *table) +static unsigned int pd_video_poll (struct file *file,poll_table *table) {struct front_face *front = file->private_data;return videobuf_poll_stream (file, &front->q, table); } -ssize_t pd_video_read (struct file *file,char __user *buffer, +static ssize_t pd_video_read (struct file *file,char __user *buffer,size_t count,loff_t *ppos) {struct front_face *front = file->private_data;
thanks.
Quoted 210 lines
From: Márton Németh<[email protected]>
Make the local variables and functions static. Some of them are not exported by their symbol name but used trough other means. For example a pointer of the operation structure is passed through a function call.
This will remove the following sparse warnings (see "make C=1"):
* pd-video.c:20:5: warning: symbol 'usb_transfer_mode' was not declared. Should it be static?
* pd-video.c:621:5: warning: symbol 'fire_all_urb' was not declared. Should it be static?
* pd-video.c:881:5: warning: symbol 'vidioc_s_std' was not declared. Should it be static?
* pd-video.c:1024:5: warning: symbol 'vidioc_g_audio' was not declared. Should it be static?
* pd-video.c:1033:5: warning: symbol 'vidioc_s_audio' was not declared. Should it be static?
* pd-video.c:1193:5: warning: symbol 'usb_transfer_stop' was not declared. Should it be static?
* pd-video.c:1522:14: warning: symbol 'pd_video_poll' was not declared. Should it be static?
* pd-video.c:1528:9: warning: symbol 'pd_video_read' was not declared. Should it be static?
* pd-radio.c:164:5: warning: symbol 'tlg_fm_vidioc_g_tuner' was not declared. Should it be static?
* pd-radio.c:206:5: warning: symbol 'fm_get_freq' was not declared. Should it be static?
* pd-radio.c:249:5: warning: symbol 'fm_set_freq' was not declared. Should it be static?
* pd-radio.c:261:5: warning: symbol 'tlg_fm_vidioc_g_ctrl' was not declared. Should it be static?
* pd-radio.c:267:5: warning: symbol 'tlg_fm_vidioc_g_exts_ctrl' was not declared. Should it be static?
* pd-radio.c:288:5: warning: symbol 'tlg_fm_vidioc_s_exts_ctrl' was not declared. Should it be static?
* pd-radio.c:315:5: warning: symbol 'tlg_fm_vidioc_s_ctrl' was not declared. Should it be static?
* pd-radio.c:321:5: warning: symbol 'tlg_fm_vidioc_queryctrl' was not declared. Should it be static?
* pd-radio.c:340:5: warning: symbol 'tlg_fm_vidioc_querymenu' was not declared. Should it be static?
* pd-main.c:58:12: warning: symbol 'firmware_name' was not declared. Should it be static?
* pd-main.c:59:19: warning: symbol 'poseidon_driver' was not declared. Should it be static?Signed-off-by Márton Németh<[email protected]>---
diff -uprv4l-dvb.orig/linux/drivers/media/video/tlg2300/pd-main.cv4l-dvb/linux/drivers/media/video/tlg2300/pd-main.clinux/drivers/media/video/tlg2300/pd-main.c +3
-3@@ -55,8 +55,8 @@ int debug_mode;module_param (debug_mode, int,0644 );MODULE_PARM_DESC (debug_mode,"0 = disable, 1 = enable, 2 = verbose" ); -const char *firmware_name ="tlg2300_firmware.bin" ; -struct usb_driver poseidon_driver; +static const char *firmware_name ="tlg2300_firmware.bin" ; +static struct usb_driver poseidon_driver;static LIST_HEAD (pd_device_list);/* @@ -501,7 +501,7 @@ static void poseidon_disconnect(struct ukref_put (&pd->kref, poseidon_delete); } -struct usb_driver poseidon_driver = { +static struct usb_driver poseidon_driver = { .name ="poseidon" , .probe = poseidon_probe, .disconnect = poseidon_disconnect,diff -upr
v4l-dvb.orig/linux/drivers/media/video/tlg2300/pd-radio.cv4l-dvb/linux/drivers/media/video/tlg2300/pd-radio.clinux/drivers/media/video/tlg2300/pd-radio.c +12
-9@@ -161,7 +161,8 @@ static const struct v4l2_file_operations .ioctl = video_ioctl2, }; -int tlg_fm_vidioc_g_tuner (struct file *file,void *priv,struct v4l2_tuner *vt) +static int tlg_fm_vidioc_g_tuner (struct file *file,void *priv, +struct v4l2_tuner *vt) {struct tuner_fm_sig_stat_s fm_stat = {};int ret, status, count =5 ;@@ -203,7 +204,8 @@ int tlg_fm_vidioc_g_tuner(struct file *freturn 0 ; } -int fm_get_freq (struct file *file,void *priv,struct v4l2_frequency *argp) +static int fm_get_freq (struct file *file,void *priv, +struct v4l2_frequency *argp) {struct poseidon *p = file->private_data;@@ -246,7 +248,8 @@ error:return ret; } -int fm_set_freq (struct file *file,void *priv,struct v4l2_frequency *argp) +static int fm_set_freq (struct file *file,void *priv, +struct v4l2_frequency *argp) {struct poseidon *p = file->private_data;@@ -258,13 +261,13 @@ int fm_set_freq(struct file *file, voidreturn set_frequency (p, argp->frequency); } -int tlg_fm_vidioc_g_ctrl (struct file *file,void *priv, +static int tlg_fm_vidioc_g_ctrl (struct file *file,void *priv,struct v4l2_control *arg) {return 0 ; } -int tlg_fm_vidioc_g_exts_ctrl (struct file *file,void *fh, +static int tlg_fm_vidioc_g_exts_ctrl (struct file *file,void *fh,struct v4l2_ext_controls *ctrls) {struct poseidon *p = file->private_data;@@ -285,7 +288,7 @@ int tlg_fm_vidioc_g_exts_ctrl(struct filreturn 0 ; } -int tlg_fm_vidioc_s_exts_ctrl (struct file *file,void *fh, +static int tlg_fm_vidioc_s_exts_ctrl (struct file *file,void *fh,struct v4l2_ext_controls *ctrls) {int i;@@ -312,13 +315,13 @@ int tlg_fm_vidioc_s_exts_ctrl(struct filreturn 0 ; } -int tlg_fm_vidioc_s_ctrl (struct file *file,void *priv, +static int tlg_fm_vidioc_s_ctrl (struct file *file,void *priv,struct v4l2_control *ctrl) {return 0 ; } -int tlg_fm_vidioc_queryctrl (struct file *file,void *priv, +static int tlg_fm_vidioc_queryctrl (struct file *file,void *priv,struct v4l2_queryctrl *ctrl) {if (!(ctrl->id&V4L2_CTRL_FLAG_NEXT_CTRL ))@@ -337,7 +340,7 @@ int tlg_fm_vidioc_queryctrl(struct filereturn -EINVAL ; } -int tlg_fm_vidioc_querymenu (struct file *file,void *fh, +static int tlg_fm_vidioc_querymenu (struct file *file,void *fh,struct v4l2_querymenu *qmenu) {return v4l2_ctrl_query_menu (qmenu,NULL ,NULL );diff -upr
v4l-dvb.orig/linux/drivers/media/video/tlg2300/pd-video.cv4l-dvb/linux/drivers/media/video/tlg2300/pd-video.clinux/drivers/media/video/tlg2300/pd-video.c +8
-8@@ -17,7 +17,7 @@ static int pm_video_resume(struct poseid#endif static void iso_bubble_handler (struct work_struct *w); -int usb_transfer_mode; +static int usb_transfer_mode;module_param (usb_transfer_mode, int,0644 );MODULE_PARM_DESC (usb_transfer_mode,"0 = Bulk, 1 = Isochronous" );@@ -618,7 +618,7 @@ static int pd_buf_prepare(struct videobureturn 0 ; } -int fire_all_urb (struct video_data *video) +static int fire_all_urb (struct video_data *video) {int i, ret;@@ -878,7 +878,7 @@ out:return ret; } -int vidioc_s_std (struct file *file,void *fh,v4l2_std_id *norm) +static int vidioc_s_std (struct file *file,void *fh,v4l2_std_id *norm) {struct front_face *front = fh;logs (front);@@ -1021,7 +1021,7 @@ static int vidioc_enumaudio(struct filereturn 0 ; } -int vidioc_g_audio (struct file *file,void *fh,struct v4l2_audio *a) +static int vidioc_g_audio (struct file *file,void *fh,struct v4l2_audio *a) { a->index =0 ; a->capability =V4L2_AUDCAP_STEREO ;@@ -1030,7 +1030,7 @@ int vidioc_g_audio(struct file *file, voreturn 0 ; } -int vidioc_s_audio (struct file *file,void *fh,struct v4l2_audio *a) +static int vidioc_s_audio (struct file *file,void *fh,struct v4l2_audio *a) {return (0 == a->index) ?0 : -EINVAL ; }@@ -1190,7 +1190,7 @@ static int vidioc_dqbuf(struct file *fil }/* Just stop the URBs, do not free the URBs */ -int usb_transfer_stop (struct video_data *video) +static int usb_transfer_stop (struct video_data *video) {if (video->is_streaming) {int i;@@ -1519,13 +1519,13 @@ static int pd_video_mmap(struct file *fireturn videobuf_mmap_mapper (&front->q, vma); } -unsigned int pd_video_poll (struct file *file,poll_table *table) +static unsigned int pd_video_poll (struct file *file,poll_table *table) {struct front_face *front = file->private_data;return videobuf_poll_stream (file,&front->q, table); } -ssize_t pd_video_read (struct file *file,char __user *buffer, +static ssize_t pd_video_read (struct file *file,char __user *buffer,size_t count,loff_t *ppos) {struct front_face *front = file->private_data;