From: Russell King <rmk@arm.linux.org.uk>
To: Andrew Morton <akpm@osdl.org>
Cc: Arun Sharma <arun.sharma@intel.com>,
linux-kernel@vger.kernel.org, kevin.tian@intel.com,
Matthew Wilcox <willy@debian.org>
Subject: Re: [PATCH] incorrect use of sizeof() in ioctl definitions
Date: Tue, 30 Sep 2003 22:35:31 +0100 [thread overview]
Message-ID: <20030930223531.B10154@flint.arm.linux.org.uk> (raw)
In-Reply-To: <20030930140805.0e3158e7.akpm@osdl.org>; from akpm@osdl.org on Tue, Sep 30, 2003 at 02:08:05PM -0700
On Tue, Sep 30, 2003 at 02:08:05PM -0700, Andrew Morton wrote:
> diff -puN drivers/video/aty/aty128fb.c~sizeof-in-ioctl-fix drivers/video/aty/aty128fb.c
> --- 25/drivers/video/aty/aty128fb.c~sizeof-in-ioctl-fix Tue Sep 30 14:04:12 2003
> +++ 25-akpm/drivers/video/aty/aty128fb.c Tue Sep 30 14:04:12 2003
> @@ -2041,9 +2041,9 @@ aty128fb_setcolreg(u_int regno, u_int re
> #define ATY_MIRROR_CRT_ON 0x00000002
>
> /* out param: u32* backlight value: 0 to 15 */
> -#define FBIO_ATY128_GET_MIRROR _IOR('@', 1, sizeof(__u32*))
> +#define FBIO_ATY128_GET_MIRROR _IOR('@', 1, __u32*)
> /* in param: u32* backlight value: 0 to 15 */
> -#define FBIO_ATY128_SET_MIRROR _IOW('@', 2, sizeof(__u32*))
> +#define FBIO_ATY128_SET_MIRROR _IOW('@', 2, __u32*)
>
> static int aty128fb_ioctl(struct inode *inode, struct file *file, u_int cmd,
> u_long arg, struct fb_info *info)
>
>
> Matthew's conversion mainly converted things to size_t, but from the looks
> of it, __u32* is the right thing to use in this case, I think?
sizeof(__u32*) may not be sizeof(sizeof(__u32*)), so this would be an API
change... Therefore, all these wrong entries need to change to size_t
(preferably with the real type following inside a comment so we don't
loose useful information.)
--
Russell King (rmk@arm.linux.org.uk) http://www.arm.linux.org.uk/personal/
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 PCMCIA - http://pcmcia.arm.linux.org.uk/
2.6 Serial core
next prev parent reply other threads:[~2003-09-30 21:35 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-30 20:53 Arun Sharma
2003-09-30 21:08 ` Andrew Morton
2003-09-30 21:35 ` Russell King [this message]
2003-09-30 21:43 ` Andrew Morton
2003-09-30 22:27 ` Maciej Zenczykowski
2003-09-30 22:25 ` Matthew Wilcox
2003-10-01 0:32 ` Andries Brouwer
2003-10-08 8:40 Tian, Kevin
2003-10-08 10:01 ` Maciej Zenczykowski
2003-10-08 9:58 Tian, Kevin
2003-10-08 13:30 ` Matthew Wilcox
2003-10-08 11:42 Tian, Kevin
2003-10-08 13:33 ` Matthew Wilcox
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030930223531.B10154@flint.arm.linux.org.uk \
--to=rmk@arm.linux.org.uk \
--cc=akpm@osdl.org \
--cc=arun.sharma@intel.com \
--cc=kevin.tian@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=willy@debian.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome