video: mmpfb: cleanup some static checker warnings in probe()

Sparse complains about using zero instead of NULL for pointers.
Probably, if we enabled the warning, then GCC would complain about the
unused initializers.  I've just removed them.

Smatch complains that we first check if "fbi" is NULL and then
dereference it in the error handling.  It turns out that "fbi" can't be
NULL so I've removed the check.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
This commit is contained in:
Dan Carpenter 2014-04-14 11:09:29 +03:00 коммит произвёл Tomi Valkeinen
Родитель c150a2803d
Коммит a513ad2d6d
1 изменённых файлов: 2 добавлений и 7 удалений

Просмотреть файл

@ -554,8 +554,8 @@ static void fb_info_clear(struct fb_info *info)
static int mmpfb_probe(struct platform_device *pdev) static int mmpfb_probe(struct platform_device *pdev)
{ {
struct mmp_buffer_driver_mach_info *mi; struct mmp_buffer_driver_mach_info *mi;
struct fb_info *info = 0; struct fb_info *info;
struct mmpfb_info *fbi = 0; struct mmpfb_info *fbi;
int ret, modes_num; int ret, modes_num;
mi = pdev->dev.platform_data; mi = pdev->dev.platform_data;
@ -569,10 +569,6 @@ static int mmpfb_probe(struct platform_device *pdev)
if (info == NULL) if (info == NULL)
return -ENOMEM; return -ENOMEM;
fbi = info->par; fbi = info->par;
if (!fbi) {
ret = -EINVAL;
goto failed;
}
/* init fb */ /* init fb */
fbi->fb_info = info; fbi->fb_info = info;
@ -667,7 +663,6 @@ failed_free_buff:
fbi->fb_start_dma); fbi->fb_start_dma);
failed_destroy_mutex: failed_destroy_mutex:
mutex_destroy(&fbi->access_ok); mutex_destroy(&fbi->access_ok);
failed:
dev_err(fbi->dev, "mmp-fb: frame buffer device init failed\n"); dev_err(fbi->dev, "mmp-fb: frame buffer device init failed\n");
framebuffer_release(info); framebuffer_release(info);