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

media: platform/sh_veu.c: remove redundant NULL pointer checks

Function `sh_veu_find_fmt` returns an address that is an addition of a
base pointer `sh_veu_fmt` and an offset. The base pointer refers to a
global variable of which address cannot be NULL. Therefore, this commit
removes the NULL pointer checks on the return values of function
`sh_veu_find_fmt`.

Signed-off-by: Shaobo He <shaobo@cs.utah.edu>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>

authored by

Shaobo He and committed by
Mauro Carvalho Chehab
2c2a8dc3 dea37a97

-6
-6
drivers/media/platform/sh_veu.c
··· 493 493 const struct sh_veu_format *fmt; 494 494 495 495 fmt = sh_veu_find_fmt(f); 496 - if (!fmt) 497 - /* wrong buffer type */ 498 - return -EINVAL; 499 496 500 497 return sh_veu_try_fmt(f, fmt); 501 498 } ··· 503 506 const struct sh_veu_format *fmt; 504 507 505 508 fmt = sh_veu_find_fmt(f); 506 - if (!fmt) 507 - /* wrong buffer type */ 508 - return -EINVAL; 509 509 510 510 return sh_veu_try_fmt(f, fmt); 511 511 }