diff mbox

stkwebcam: Fix sparse warning on undeclared symbol

Message ID 1351773720-22639-1-git-send-email-elezegarcia@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ezequiel Garcia Nov. 1, 2012, 12:42 p.m. UTC
The sparse warning is:
"drivers/media/usb/stkwebcam/stk-webcam.c:59:5:
warning: symbol 'first_init' was not declared. Should it be static?"

Declare variable 'first_init' as static and local to the function.
Found by Hans Verkuil's daily build. Tested by compilation only.

Cc: Andrea Anacleto <andreaanacleto@libero.it>
Cc: Arvydas Sidorenko <asido4@gmail.com>
Cc: Jaime Velasco Juan <jsagarribay@gmail.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
---
Ouch, there doesn't seem to be an active maintainer for this.
If anyone has a device and can give it a try, it would be nice.
The change is pretty simple anyway.

Also, why the heck do we need this first_init?
To prevent the led from blinking on udev first open?

 drivers/media/usb/stkwebcam/stk-webcam.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

Comments

Arvydas Sidorenko Nov. 2, 2012, 7:35 a.m. UTC | #1
> why the heck do we need this first_init?

first_init was introduced in 7b1c8f58fcdbed75 for turning off LED when
the cam finishes
the capture.
Andrea Anacleto <andreaanacleto@libero.it> claimed that the change
broke his webcam
on the same laptop, so he introduced that variable to fix the issue.
It didn't have any
impact to my cam so I merged it's patch and resent my fix to the maintainer.
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ezequiel Garcia Nov. 2, 2012, 1:41 p.m. UTC | #2
Hi Arvydas,

On Fri, Nov 2, 2012 at 4:35 AM, Arvydas Sidorenko <asido4@gmail.com> wrote:
>> why the heck do we need this first_init?
>
> first_init was introduced in 7b1c8f58fcdbed75 for turning off LED when
> the cam finishes
> the capture.
> Andrea Anacleto <andreaanacleto@libero.it> claimed that the change
> broke his webcam
> on the same laptop, so he introduced that variable to fix the issue.
> It didn't have any
> impact to my cam so I merged it's patch and resent my fix to the maintainer.

I understand.

It sounds a bit weird to me. However, I can't argue since I don't have
a device to test.

This patch doesn't change the functionality in any way.
If you have the time to test it and stamp a "Tested-by" on it, I would
appreciate it.

Thanks,

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

Patch

diff --git a/drivers/media/usb/stkwebcam/stk-webcam.c b/drivers/media/usb/stkwebcam/stk-webcam.c
index 86a0fc5..5d3c032 100644
--- a/drivers/media/usb/stkwebcam/stk-webcam.c
+++ b/drivers/media/usb/stkwebcam/stk-webcam.c
@@ -54,10 +54,6 @@  MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Jaime Velasco Juan <jsagarribay@gmail.com> and Nicolas VIVIEN");
 MODULE_DESCRIPTION("Syntek DC1125 webcam driver");
 
-
-/* bool for webcam LED management */
-int first_init = 1;
-
 /* Some cameras have audio interfaces, we aren't interested in those */
 static struct usb_device_id stkwebcam_table[] = {
 	{ USB_DEVICE_AND_INTERFACE_INFO(0x174f, 0xa311, 0xff, 0xff, 0xff) },
@@ -554,6 +550,7 @@  static void stk_free_buffers(struct stk_camera *dev)
 
 static int v4l_stk_open(struct file *fp)
 {
+	static int first_init = 1; /* webcam LED management */
 	struct stk_camera *dev;
 	struct video_device *vdev;