]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[media] tm6000: remove needless check
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>
Fri, 5 Jun 2015 12:33:44 +0000 (09:33 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Fri, 5 Jun 2015 14:26:37 +0000 (11:26 -0300)
Smatch reports a warning:
drivers/media/usb/tm6000/tm6000-video.c:646 tm6000_prepare_isoc() error: we previously assumed 'dev->urb_buffer' could be null (see line 624)

This is not really a problem, but it actually shows that the check
if urb_buffer is NULL is being done twice: at the if and at
tm6000_alloc_urb_buffers().

We don't need to do it twice. So, remove the extra check. The code
become cleaner, and, as a collateral effect, smatch becomes happy.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/usb/tm6000/tm6000-video.c

index 77ce9efe1f2477050b665bde13a24868370f1383..5287d29602824acc5ca77b078cc3c87e43386be1 100644 (file)
@@ -621,7 +621,7 @@ static int tm6000_prepare_isoc(struct tm6000_core *dev)
                    dev->isoc_in.maxsize, size);
 
 
-       if (!dev->urb_buffer && tm6000_alloc_urb_buffers(dev) < 0) {
+       if (tm6000_alloc_urb_buffers(dev) < 0) {
                tm6000_err("cannot allocate memory for urb buffers\n");
 
                /* call free, as some buffers might have been allocated */