[PATCH 6/14] drivers/media/video: Move dereference after NULL test

2009-10-17 Thread Julia Lawall
From: Julia Lawall ju...@diku.dk

In quickcam_messenger.c, if the NULL test on uvd is needed, then the
dereference should be after the NULL test.

In vpif_display.c, std_info is initialized to the address of a structure
field.  This seems unlikely to be NULL.  If it could somehow be NULL, then
the assignment should be moved after the NULL test.  Alternatively, perhaps
the NULL test is intended to test std_info-stdid rather than std_info?

In saa7134-alsa.c, the function is only called from one place, where the
chip argument has already been dereferenced.  On the other hand, if it
should be kept, then card should be initialized after it.

A simplified version of the semantic match that detects this problem is as
follows (http://coccinelle.lip6.fr/):

// smpl
@match exists@
expression x, E;
identifier fld;
@@

* x-fld
  ... when != \(x = E\|x\)
* x == NULL
// /smpl

Signed-off-by: Julia Lawall ju...@diku.dk

---
 drivers/media/video/davinci/vpif_display.c|2 --
 drivers/media/video/saa7134/saa7134-alsa.c|2 --
 drivers/media/video/usbvideo/quickcam_messenger.c |3 ++-
 3 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/media/video/usbvideo/quickcam_messenger.c 
b/drivers/media/video/usbvideo/quickcam_messenger.c
index 803d3e4..f0043d0 100644
--- a/drivers/media/video/usbvideo/quickcam_messenger.c
+++ b/drivers/media/video/usbvideo/quickcam_messenger.c
@@ -692,12 +692,13 @@ static int qcm_start_data(struct uvd *uvd)
 
 static void qcm_stop_data(struct uvd *uvd)
 {
-   struct qcm *cam = (struct qcm *) uvd-user_data;
+   struct qcm *cam;
int i, j;
int ret;
 
if ((uvd == NULL) || (!uvd-streaming) || (uvd-dev == NULL))
return;
+   cam = (struct qcm *) uvd-user_data;
 
ret = qcm_camera_off(uvd);
if (ret)
diff --git a/drivers/media/video/davinci/vpif_display.c 
b/drivers/media/video/davinci/vpif_display.c
index c015da8..7500411 100644
--- a/drivers/media/video/davinci/vpif_display.c
+++ b/drivers/media/video/davinci/vpif_display.c
@@ -383,8 +383,6 @@ static int vpif_get_std_info(struct channel_obj *ch)
int index;
 
std_info-stdid = vid_ch-stdid;
-   if (!std_info)
-   return -1;
 
for (index = 0; index  ARRAY_SIZE(ch_params); index++) {
config = ch_params[index];
diff --git a/drivers/media/video/saa7134/saa7134-alsa.c 
b/drivers/media/video/saa7134/saa7134-alsa.c
index d48c450..d3bd82a 100644
--- a/drivers/media/video/saa7134/saa7134-alsa.c
+++ b/drivers/media/video/saa7134/saa7134-alsa.c
@@ -1011,8 +1011,6 @@ static int snd_card_saa7134_new_mixer(snd_card_saa7134_t 
* chip)
unsigned int idx;
int err, addr;
 
-   if (snd_BUG_ON(!chip))
-   return -EINVAL;
strcpy(card-mixername, SAA7134 Mixer);
 
for (idx = 0; idx  ARRAY_SIZE(snd_saa7134_volume_controls); idx++) {
--
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


Lenovo USB 2.0 webcam (gspca, vc032x, MI1310_SOC)

2009-10-17 Thread Johannes Jordan

Hello,


I have a Lenovo USB 2.0 webcam which currently does not work with kernel 
 2.6.31 and also some earlier releases. It is supported by vc032x in 
theory though.



The camera worked with the old gspca driver before kernel inclusion. 
After kernel inclusion, it worked even better, albeit some applications 
would need v4l1compat.so.


Since some time (kernel updates) it stopped working. It is still 
recognized; dmesg output below:


usb 1-3: new high speed USB device using ehci_hcd and address 7
usb 1-3: configuration #1 chosen from 1 choice
gspca: probing 17ef:4802
vc032x: check sensor header 20
vc032x: Sensor ID 143a (3)
vc032x: Find Sensor MI1310_SOC
gspca: probe ok
gspca: probing 17ef:4802


However, the video device seems to be unusable:
 * spcaview hangs before showing the first frame, output follows:

Spcaview version: 1.1.8 date: 25:12:2007 (C) mxha...@magic.fr
Initializing SDL.
SDL initialized.
bpp 3 format 15
Using video device /dev/video0.
Initializing v4l.
 PROBING CAMERA *
Camera found: Lenovo USB Webcam
Hmm did not support Video_channel
*
 grabbing method default MMAP asked
VIDIOCGMBUF size 1327104  frames 4  offets[0]=0 offsets[1]=331776
VIDIOCGPICT
brightnes=0 hue=0 color=0 contrast=0 whiteness=0
depth=8 palette=0
VIDIOCSPICT
brightness=0 hue=0 color=0 contrast=0 whiteness=0
depth=24 palette=15

   No output from the kernel in that case

 * Apps like cheese with v4l2convert or mplayer with v4l2 driver
   try hard, giving errors like
v4l2: select timeout ??% ??,?% 0 0
   at the same time this message is produced a lot in kernel output:
gspca: frame overflow 119808  118784
   with varying numbers.

 * As you could imagine, skype does not work as well


As I read that there are recent patches against vc032x regarding the 
MI1310_SOC capture device, I wanted to try the recent v4l-dvb tree. 
However it does not compile here, missing headers in the firewire module.



I would be very grateful if you could help me resolve this issue!
What do I need to compile/try a newer version of the driver?
Is the problem with my webcam already known?
How may I assist in any bug-fixing, do you need further information?


Best Regards,
Johannes
--
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] http://udev.netup.ru/hg/v4l-dvb-commits

2009-10-17 Thread Igor M. Liplianin
Mauro,

Please pull from http://udev.netup.ru/hg/v4l-dvb-commits

for the following 3 changesets:

01/03: stv6110: add configurable gain
http://udev.netup.ru/hg/v4l-dvb-commits?cmd=changeset;node=655c21f61eb3

02/03: stv0900: fix diseqc support for NetUP card
http://udev.netup.ru/hg/v4l-dvb-commits?cmd=changeset;node=7682b35a0526

03/03: stv0900: config definition for single/dual mode
http://udev.netup.ru/hg/v4l-dvb-commits?cmd=changeset;node=71fb9ae3e3f7


 dvb/frontends/stv0900.h  |1 +
 dvb/frontends/stv0900_core.c |   35 ++-
 dvb/frontends/stv6110.c  |   13 -
 dvb/frontends/stv6110.h  |1 +
 video/cx23885/cx23885-dvb.c  |   11 +++
 5 files changed, 35 insertions(+), 26 deletions(-)

Thanks,
Igor


--
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


Is anyone working on a Dual DVB-S2 PCIe Tuner driver?

2009-10-17 Thread Another Sillyname
I've had a look at the Wiki and there appears to be only two PCIe
cards that have Dual Tuners.

However both seem crazily expensive and perhaps in once case are vapourware.

Is there anyone working on any DVB-S2 PCI Express Device that has dual tuners?

Lastly (I know it's not shipping yet) there's a newly announced
Blackgold card BGT3595
that supposedly will have Dual DVB-T AND Dual DVB-S2 (so 4 tuners) on
a PCI express platform.
Will anyone be working on a driver for that device?  (Looking back
through the lists it would appear)
that previous cards from Blackgold couldn't get the information to
produce a driver.

Thanks in advance.
--
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


[cron job] v4l-dvb daily build 2.6.22 and up: ERRORS, 2.6.16-2.6.21: ERRORS

2009-10-17 Thread Hans Verkuil
This message is generated daily by a cron job that builds v4l-dvb for
the kernels and architectures in the list below.

Results of the daily build of v4l-dvb:

date:Sat Oct 17 19:00:05 CEST 2009
path:http://www.linuxtv.org/hg/v4l-dvb
changeset:   13101:3919b17dc88e
gcc version: gcc (GCC) 4.3.1
hardware:x86_64
host os: 2.6.26

linux-2.6.22.19-armv5: OK
linux-2.6.23.12-armv5: OK
linux-2.6.24.7-armv5: OK
linux-2.6.25.11-armv5: OK
linux-2.6.26-armv5: OK
linux-2.6.27-armv5: OK
linux-2.6.28-armv5: OK
linux-2.6.29.1-armv5: OK
linux-2.6.30-armv5: OK
linux-2.6.31-armv5: OK
linux-2.6.32-rc3-armv5: ERRORS
linux-2.6.32-rc3-armv5-davinci: ERRORS
linux-2.6.27-armv5-ixp: ERRORS
linux-2.6.28-armv5-ixp: ERRORS
linux-2.6.29.1-armv5-ixp: ERRORS
linux-2.6.30-armv5-ixp: ERRORS
linux-2.6.31-armv5-ixp: ERRORS
linux-2.6.32-rc3-armv5-ixp: ERRORS
linux-2.6.28-armv5-omap2: OK
linux-2.6.29.1-armv5-omap2: OK
linux-2.6.30-armv5-omap2: OK
linux-2.6.31-armv5-omap2: ERRORS
linux-2.6.32-rc3-armv5-omap2: ERRORS
linux-2.6.22.19-i686: ERRORS
linux-2.6.23.12-i686: ERRORS
linux-2.6.24.7-i686: ERRORS
linux-2.6.25.11-i686: ERRORS
linux-2.6.26-i686: OK
linux-2.6.27-i686: OK
linux-2.6.28-i686: OK
linux-2.6.29.1-i686: WARNINGS
linux-2.6.30-i686: WARNINGS
linux-2.6.31-i686: WARNINGS
linux-2.6.32-rc3-i686: ERRORS
linux-2.6.23.12-m32r: OK
linux-2.6.24.7-m32r: OK
linux-2.6.25.11-m32r: OK
linux-2.6.26-m32r: OK
linux-2.6.27-m32r: OK
linux-2.6.28-m32r: OK
linux-2.6.29.1-m32r: OK
linux-2.6.30-m32r: OK
linux-2.6.31-m32r: OK
linux-2.6.32-rc3-m32r: ERRORS
linux-2.6.30-mips: WARNINGS
linux-2.6.31-mips: OK
linux-2.6.32-rc3-mips: ERRORS
linux-2.6.27-powerpc64: ERRORS
linux-2.6.28-powerpc64: ERRORS
linux-2.6.29.1-powerpc64: ERRORS
linux-2.6.30-powerpc64: ERRORS
linux-2.6.31-powerpc64: ERRORS
linux-2.6.32-rc3-powerpc64: ERRORS
linux-2.6.22.19-x86_64: ERRORS
linux-2.6.23.12-x86_64: ERRORS
linux-2.6.24.7-x86_64: ERRORS
linux-2.6.25.11-x86_64: ERRORS
linux-2.6.26-x86_64: OK
linux-2.6.27-x86_64: OK
linux-2.6.28-x86_64: OK
linux-2.6.29.1-x86_64: WARNINGS
linux-2.6.30-x86_64: WARNINGS
linux-2.6.31-x86_64: WARNINGS
linux-2.6.32-rc3-x86_64: ERRORS
sparse (linux-2.6.31): OK
sparse (linux-2.6.32-rc3): OK
linux-2.6.16.61-i686: ERRORS
linux-2.6.17.14-i686: ERRORS
linux-2.6.18.8-i686: ERRORS
linux-2.6.19.5-i686: ERRORS
linux-2.6.20.21-i686: ERRORS
linux-2.6.21.7-i686: ERRORS
linux-2.6.16.61-x86_64: ERRORS
linux-2.6.17.14-x86_64: ERRORS
linux-2.6.18.8-x86_64: ERRORS
linux-2.6.19.5-x86_64: ERRORS
linux-2.6.20.21-x86_64: ERRORS
linux-2.6.21.7-x86_64: ERRORS

Detailed results are available here:

http://www.xs4all.nl/~hverkuil/logs/Saturday.log

Full logs are available here:

http://www.xs4all.nl/~hverkuil/logs/Saturday.tar.bz2

The V4L2 specification failed to build, but the last compiled spec is here:

http://www.xs4all.nl/~hverkuil/spec/v4l2.html

The DVB API specification from this daily build is here:

http://www.xs4all.nl/~hverkuil/spec/dvbapi.pdf

--
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


2.6.32 regression: can't tune DVB with firedtv

2009-10-17 Thread Stefan Richter
Hi list,

I just switched from kernel 2.6.31 to 2.6.32-rc5.  Using kaffeine, I
can't tune FireDTV-C and FireDTV-T boxes via the firedtv driver anymore.
Electronic program guide data is still displayed though.

Under 2.6.31, I used firedtv at the same patchlevel as present in
2.6.32-rc5, hence I guess that it is a DVB core problem rather than a
driver problem.

Any suggestions where to look for the cause?

(I am not subscribed to the list.)
-- 
Stefan Richter
-=-==--= =-=- =---=
http://arcgraph.de/sr/
--
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: 2.6.32 regression: can't tune DVB with firedtv

2009-10-17 Thread Stefan Richter
Stefan Richter wrote:
 I just switched from kernel 2.6.31 to 2.6.32-rc5.  Using kaffeine, I
 can't tune FireDTV-C and FireDTV-T boxes via the firedtv driver anymore.
 Electronic program guide data is still displayed though.
 
 Under 2.6.31, I used firedtv at the same patchlevel as present in
 2.6.32-rc5, hence I guess that it is a DVB core problem rather than a
 driver problem.
 
 Any suggestions where to look for the cause?

From looking at the git history of dvb-core, I think the cause is
V4L/DVB (12685): dvb-core: check fe-ops.set_frontend return value,
but the actual bug is in the driver in
firedtv-fe.c::fdtv_set_frontend().  Let me boot back into 2.6.32-rc5 and
check my theory...

 (I am not subscribed to the list.)
-- 
Stefan Richter
-=-==--= =-=- =---=
http://arcgraph.de/sr/
--
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: 2.6.32 regression: can't tune DVB with firedtv

2009-10-17 Thread Mario Bachmann
Am Sat, 17 Oct 2009 21:01:50 +0200
schrieb Stefan Richter stef...@s5r6.in-berlin.de:

 Hi list,
 
 I just switched from kernel 2.6.31 to 2.6.32-rc5.  Using kaffeine, I
 can't tune FireDTV-C and FireDTV-T boxes via the firedtv driver
 anymore. Electronic program guide data is still displayed though.
 
 Under 2.6.31, I used firedtv at the same patchlevel as present in
 2.6.32-rc5, hence I guess that it is a DVB core problem rather than a
 driver problem.
 
 Any suggestions where to look for the cause?
 
 (I am not subscribed to the list.)

Hi there, 

perhaps it is related:
with kernel 2.6.30.8 my TwinhanDTV USB-Ter USB1.1 / Magic Box I
worked. 

Now with kernel 2.6.32-rc3 (and 2.6.31.1) the modules seems to be
loaded fine, but tzap/kaffeine/mplayer can not tune to a channel. 

i think the cause must be here:
/usr/src/linux-2.6.32-rc3/drivers/media/dvb/dvb-usb/dibusb-common.c
line 136 to line 146

i changed this hole section to the version of 2.6.30.8 and it works
again.

Mario
--
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


[PATCH] firedtv: fix regression: tuning fails due to bogus error return

2009-10-17 Thread Stefan Richter
Since 2.6.32(-rc1), DVB core checks the return value of
dvb_frontend_ops.set_frontend.  Now it becomes apparent that firedtv
always returned a bogus value from its set_frontend method.

Signed-off-by: Stefan Richter stef...@s5r6.in-berlin.de
---
 drivers/media/dvb/firewire/firedtv-avc.c |7 +--
 drivers/media/dvb/firewire/firedtv-fe.c  |8 +---
 2 files changed, 6 insertions(+), 9 deletions(-)

Index: linux-2.6.32-rc5/drivers/media/dvb/firewire/firedtv-avc.c
===
--- linux-2.6.32-rc5.orig/drivers/media/dvb/firewire/firedtv-avc.c
+++ linux-2.6.32-rc5/drivers/media/dvb/firewire/firedtv-avc.c
@@ -573,8 +573,11 @@ int avc_tuner_dsd(struct firedtv *fdtv,
 
msleep(500);
 #if 0
-   /* FIXME: */
-   /* u8 *status was an out-parameter of avc_tuner_dsd, unused by caller */
+   /*
+* FIXME:
+* u8 *status was an out-parameter of avc_tuner_dsd, unused by caller
+* Check for AVC_RESPONSE_ACCEPTED here instead?
+*/
if (status)
*status = r-operand[2];
 #endif
Index: linux-2.6.32-rc5/drivers/media/dvb/firewire/firedtv-fe.c
===
--- linux-2.6.32-rc5.orig/drivers/media/dvb/firewire/firedtv-fe.c
+++ linux-2.6.32-rc5/drivers/media/dvb/firewire/firedtv-fe.c
@@ -141,18 +141,12 @@ static int fdtv_read_uncorrected_blocks(
return -EOPNOTSUPP;
 }
 
-#define ACCEPTED 0x9
-
 static int fdtv_set_frontend(struct dvb_frontend *fe,
 struct dvb_frontend_parameters *params)
 {
struct firedtv *fdtv = fe-sec_priv;
 
-   /* FIXME: avc_tuner_dsd never returns ACCEPTED. Check status? */
-   if (avc_tuner_dsd(fdtv, params) != ACCEPTED)
-   return -EINVAL;
-   else
-   return 0; /* not sure of this... */
+   return avc_tuner_dsd(fdtv, params);
 }
 
 static int fdtv_get_frontend(struct dvb_frontend *fe,

-- 
Stefan Richter
-=-==--= =-=- =---=
http://arcgraph.de/sr/

--
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