• Mauro Carvalho Chehab's avatar
    media: pwc-ctl: pChoose can't be NULL · 4f777d01
    Mauro Carvalho Chehab authored
    The way the code works, compression will be a valid value (less or equal to 3)
    on both set_video_mode_foo() calls at the beginning of the while() loop.
    
    So, the value for pChoose can't be NULL.
    
    Solves those smatch warnings:
    
    	drivers/media/usb/pwc/pwc-ctrl.c: drivers/media/usb/pwc/pwc-ctrl.c:252 set_video_mode_Timon() warn: variable dereferenced before check 'pChoose' (see line 248)
    	drivers/media/usb/pwc/pwc-ctrl.c: drivers/media/usb/pwc/pwc-ctrl.c:302 set_video_mode_Kiara() warn: variable dereferenced before check 'pChoose' (see line 298)
    
    and simplifies the code a little bit.
    Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
    4f777d01
pwc-ctrl.c 14.3 KB