fbdev: atafb: fix sparse warnings
Helge Deller
maintainerPATCH 1/1 fbdev: atafb: fix sparse warnings
Fix two sparse warnings:
- atafb.c:1092: sparse: Using plain integer as NULL pointer
Use NULL instead of 0 when assigning a pointer.
- atafb.c:2824: sparse: switch with no cases
FBCMD_GET_CURRENTPAR and and FBCMD_SET_CURRENTPAR seem to be historic defines, which are not any longer in the kernel, and as such the code isn't built any longer and may be dropped.
--- drivers/video/fbdev/atafb.c | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-)
drivers/video/fbdev/atafb.c +1 -25
@@ -1089,7 +1089,7 @@ static int falcon_decode_var(struct fb_info *info, struct fb_var_screeninfo *var/* Choose largest pixelclock <= wanted clock */ int i;unsigned long pcl =ULONG_MAX ; - pclock =0 ; + pclock =NULL ;for (i =1 ; i <=4 ; i *=2 ) {if (f25.t * i >= var->pixclock && f25.t * i < pcl) {
@@ -2818,29 +2818,6 @@ static void atafb_imageblit(struct fb_info *info, const struct fb_image *image) } } -static int -atafb_ioctl (struct fb_info *info,unsigned int cmd,unsigned long arg) -{ -switch (cmd) { -#ifdef FBCMD_GET_CURRENTPAR -case FBCMD_GET_CURRENTPAR : -if (copy_to_user ((void *)arg, ¤t_par, -sizeof (struct atafb_par ))) -return -EFAULT ; -return 0 ; -#endif -#ifdef FBCMD_SET_CURRENTPAR -case FBCMD_SET_CURRENTPAR : -if (copy_from_user (¤t_par, (void *)arg, -sizeof (struct atafb_par ))) -return -EFAULT ; -ata_set_par (¤t_par); -return 0 ; -#endif - } -return -EINVAL ; -} -/* (un)blank/poweroff * 0 = unblank * 1 = blank
@@ -2922,7 +2899,6 @@ static struct fb_ops atafb_ops = { .fb_fillrect = atafb_fillrect, .fb_copyarea = atafb_copyarea, .fb_imageblit = atafb_imageblit, - .fb_ioctl = atafb_ioctl, __FB_DEFAULT_IOMEM_OPS_MMAP, };
Signature · 1 line
2.55.0
Quoted 11 lines · Helge Deller
Fix two sparse warnings:
- atafb.c:1092: sparse: Using plain integer as NULL pointerUse NULL instead of 0 when assigning a pointer.
- atafb.c:2824: sparse: switch with no cases
FBCMD_GET_CURRENTPARand andFBCMD_SET_CURRENTPARseem to be historic defines, which are not any longer in the kernel, and as such the code isn't built any longer and may be dropped.
Quoted 5 lines
Fixes d463633d63e6 ("fbdev: atafb: Add support for SuperVidel's SuperBlitter")Reported-by kernel test robot <[email protected]>Cc Miro Kropacek <[email protected]>Signed-off-by Helge Deller <[email protected]>
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds