From 957259c8fe95b25a40cf4c8508df0e29de5a43c9 Mon Sep 17 00:00:00 2001 From: Siarhei Siamashka Date: Mon, 9 Sep 2013 03:14:24 +0300 Subject: [PATCH] sunxi-disp: ignore invalid arguments for FBIOPUTCMAP Just do nothing and return 0 for the unsupported palette indexes instead of returning -EINVAL. The vesafb and uvesafb drivers do the same. Otherwise xf86-video-fbdev or anything else derived from it writes a lot of "FBIOPUTCMAP: Invalid argument" spam to /var/log/Xorg.0.log when the X server starts. And apparently also when the screensaver and/or screen blanking/unblanking kicks in. These error messages are scaring the users and also distracting attention when doing real troubleshooting. Not to mention slowing down the X server startup and wasting extra disk space for storing logs. Yes, it is ugly to ignore errors. And the right solution would be to fix the userland code not to use this ioctl with wrong arguments. But frankly speaking, I don't want to touch the prehistoric paletted formats in the X server as long as we don't have a real use case where they can be tested. Signed-off-by: Siarhei Siamashka Acked-by: Hans de Goede --- drivers/video/sunxi/disp/dev_fb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/sunxi/disp/dev_fb.c b/drivers/video/sunxi/disp/dev_fb.c index 53e4c27460c52b..a453b6fe94781d 100644 --- a/drivers/video/sunxi/disp/dev_fb.c +++ b/drivers/video/sunxi/disp/dev_fb.c @@ -1243,7 +1243,7 @@ static int Fb_setcolreg(unsigned regno, unsigned red, unsigned green, val); ((__u32 *) info->pseudo_palette)[regno] = val; } else { - ret = -EINVAL; + ret = 0; } break; default: