Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] tm6000: remove needless check

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>

+1 -1
+1 -1
drivers/media/usb/tm6000/tm6000-video.c
··· 621 621 dev->isoc_in.maxsize, size); 622 622 623 623 624 - if (!dev->urb_buffer && tm6000_alloc_urb_buffers(dev) < 0) { 624 + if (tm6000_alloc_urb_buffers(dev) < 0) { 625 625 tm6000_err("cannot allocate memory for urb buffers\n"); 626 626 627 627 /* call free, as some buffers might have been allocated */