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

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>

authored by

Dan Carpenter and committed by
Tomi Valkeinen
a513ad2d c150a280

+2 -7
+2 -7
drivers/video/fbdev/mmp/fb/mmpfb.c
··· 554 554 static int mmpfb_probe(struct platform_device *pdev) 555 555 { 556 556 struct mmp_buffer_driver_mach_info *mi; 557 - struct fb_info *info = 0; 558 - struct mmpfb_info *fbi = 0; 557 + struct fb_info *info; 558 + struct mmpfb_info *fbi; 559 559 int ret, modes_num; 560 560 561 561 mi = pdev->dev.platform_data; ··· 569 569 if (info == NULL) 570 570 return -ENOMEM; 571 571 fbi = info->par; 572 - if (!fbi) { 573 - ret = -EINVAL; 574 - goto failed; 575 - } 576 572 577 573 /* init fb */ 578 574 fbi->fb_info = info; ··· 663 667 fbi->fb_start_dma); 664 668 failed_destroy_mutex: 665 669 mutex_destroy(&fbi->access_ok); 666 - failed: 667 670 dev_err(fbi->dev, "mmp-fb: frame buffer device init failed\n"); 668 671 669 672 framebuffer_release(info);