fix up sbuslib for new fb_comapt_ioctl prototype
PATCH 1/1 fix up sbuslib for new fb_comapt_ioctl prototype
After ages my fb ioctl prototype cleanup finally got in. Unfortunately the patch are so old that the sbus compat_ioctl helper didn't exist back then, so it's not covered. This patch should fix that issue.
Index: linux-2.6/drivers/video/sbuslib.c
=================================--- linux-2.6.orig/drivers/video/sbuslib.c 2005-12-27 18:30:31.000000000 +0100
+++ linux-2.6/drivers/video/sbuslib.c 2006-01-15 21:55:26.000000000 +0100
@@ -216,10 +216,10 @@
ret |= put_user(compat_ptr(addr), &p->blue); if (ret)
return -EFAULT;
- return info->fbops->fb_ioctl(file->f_dentry->d_inode, file,
+ return info->fbops->fb_ioctl(info,
(cmd = FBIOPUTCMAP32) ? FBIOPUTCMAP_SPARC : FBIOGETCMAP_SPARC,
- (unsigned long)p, info);
+ (unsigned long)p);
}
struct fbcursor32 {
@@ -260,12 +260,11 @@
ret |= put_user(compat_ptr(addr), &p->image); if (ret)
return -EFAULT;
- return info->fbops->fb_ioctl(file->f_dentry->d_inode, file,
- FBIOSCURSOR, (unsigned long)p, info);
+ return info->fbops->fb_ioctl(info, FBIOSCURSOR, (unsigned long)p);
}
-long sbusfb_compat_ioctl(struct file *file, unsigned int cmd,
- unsigned long arg, struct fb_info *info)
+long sbusfb_compat_ioctl(struct fb_info *info, unsigned int cmd,
+ unsigned long arg)
{
switch (cmd) {
case FBIOGTYPE:
@@ -278,14 +277,13 @@
case FBIOSCURPOS:
case FBIOGCURPOS:
case FBIOGCURMAX:
- return info->fbops->fb_ioctl(file->f_dentry->d_inode,
- file, cmd, arg, info);
+ return info->fbops->fb_ioctl(info, cmd, arg);
case FBIOPUTCMAP32:
- return fbiogetputcmap(file, info, cmd, arg);
+ return fbiogetputcmap(info, cmd, arg);
case FBIOGETCMAP32:
- return fbiogetputcmap(file, info, cmd, arg);
+ return fbiogetputcmap(info, cmd, arg);
case FBIOSCURSOR32:
- return fbiogscursor(file, info, arg);
+ return fbiogscursor(info, arg);
default:
return -ENOIOCTLCMD;
}
Index: linux-2.6/drivers/video/sbuslib.h
=================================--- linux-2.6.orig/drivers/video/sbuslib.h 2005-12-27 18:30:31.000000000 +0100
+++ linux-2.6/drivers/video/sbuslib.h 2006-01-15 21:51:45.000000000 +0100
@@ -20,7 +20,7 @@
int sbusfb_ioctl_helper(unsigned long cmd, unsigned long arg,
struct fb_info *info,
int type, int fb_depth, unsigned long fb_size);
-long sbusfb_compat_ioctl(struct file *file, unsigned int cmd,
- unsigned long arg, struct fb_info *info);
+long sbusfb_compat_ioctl(struct fb_info *info, unsigned int cmd,
+ unsigned long arg);
#endif /* _SBUSLIB_H */
From: Christoph Hellwig <[email protected]>
Date: Sun, 15 Jan 2006 21:55:54 +0100
Quoted 5 lines
After ages my fb ioctl prototype cleanup finally got in. Unfortunately the patch are so old that the sbus
compat_ioctlhelper didn't exist back then, so it's not covered. This patch should fix that issue.Signed-off-by Christoph Hellwig <[email protected]>
Please seek some way to get your sparc patches build tested in the future. This patch went into Linus's tree, which is extremely unfortunate because it is totally untested. And all it does is trade one build failure for another.
You updated the fb_ioctl() prototypes but not the ones of the functions that are called from them.
I was going to get to reviewing and fixing up this patch today.
drivers/video/sbuslib.c: In function 'sbusfb_compat_ioctl':drivers/video/sbuslib.c:282: warning: passing argument 1 of 'fbiogetputcmap' from incompatible pointer type drivers/video/sbuslib.c:282: warning: passing argument 2 of 'fbiogetputcmap' makes pointer from integer without a cast drivers/video/sbuslib.c:282: error: too few arguments to function 'fbiogetputcmap' drivers/video/sbuslib.c:284: warning: passing argument 1 of 'fbiogetputcmap' from incompatible pointer type drivers/video/sbuslib.c:284: warning: passing argument 2 of 'fbiogetputcmap' makes pointer from integer without a cast drivers/video/sbuslib.c:284: error: too few arguments to function 'fbiogetputcmap' drivers/video/sbuslib.c:286: warning: passing argument 1 of 'fbiogscursor' from incompatible pointer type drivers/video/sbuslib.c:286: warning: passing argument 2 of 'fbiogscursor' makes pointer from integer without a cast drivers/video/sbuslib.c:286: error: too few arguments to function 'fbiogscursor'
Quoted 4 lines · David S. Miller
From: Christoph Hellwig <[email protected]>
Date: Sun, 15 Jan 2006 21:55:54 +0100
Quoted 8 lines
Quoted 5 lines
After ages my fb ioctl prototype cleanup finally got in. Unfortunately the patch are so old that the sbus
compat_ioctlhelper didn't exist back then, so it's not covered. This patch should fix that issue.Signed-off-by Christoph Hellwig <[email protected]>Please seek some way to get your sparc patches build tested in the future.
fyi, I'm build testing for both sparc64 and sparc32 now, so some more such stuff will be caught early.
It would be soooooo much better if we had a warning-free build.
Quoted 10 lines
drivers/video/sbuslib.c: In function 'sbusfb_compat_ioctl':drivers/video/sbuslib.c:282: warning: passing argument 1 of 'fbiogetputcmap' from incompatible pointer typedrivers/video/sbuslib.c:282: warning: passing argument 2 of 'fbiogetputcmap' makes pointer from integer without a castdrivers/video/sbuslib.c:282: error: too few arguments to function 'fbiogetputcmap'drivers/video/sbuslib.c:284: warning: passing argument 1 of 'fbiogetputcmap' from incompatible pointer typedrivers/video/sbuslib.c:284: warning: passing argument 2 of 'fbiogetputcmap' makes pointer from integer without a castdrivers/video/sbuslib.c:284: error: too few arguments to function 'fbiogetputcmap'drivers/video/sbuslib.c:286: warning: passing argument 1 of 'fbiogscursor' from incompatible pointer typedrivers/video/sbuslib.c:286: warning: passing argument 2 of 'fbiogscursor' makes pointer from integer without a castdrivers/video/sbuslib.c:286: error: too few arguments to function 'fbiogscursor'
If the bug had produced only warnings and not an error, it might have snuck further through.
We should all take a pledge to fix one warning per day ;)
From: Andrew Morton <[email protected]>
Date: Tue, 17 Jan 2006 15:58:43 -0800
Quoted 1 line
We should all take a pledge to fix one warning per day ;)
Start sticking -Werror in a subdirectory from time to time :) arch/sparc64 has had this for, I don't know, 2 years now.
Sam R. has a patch which allowed specifying things like this and it worked very well. I used this to pinpoint a bug on sparc64 not too long ago.
Quoted 3 lines · David S. Miller
Start sticking -Werror in a subdirectory from time to time :)
CFLAGS += $(shell if [ $(whoami) != "akpm" ] ; then echo "-Werror" ; fi )