From: Andries Brouwer <aebr@win.tue.nl>
To: Matthew Wilcox <willy@debian.org>
Cc: Andrew Morton <akpm@osdl.org>,
Arun Sharma <arun.sharma@intel.com>,
linux-kernel@vger.kernel.org, kevin.tian@intel.com
Subject: Re: [PATCH] incorrect use of sizeof() in ioctl definitions
Date: Wed, 1 Oct 2003 02:32:11 +0200 [thread overview]
Message-ID: <20031001003211.GA1520@win.tue.nl> (raw)
In-Reply-To: <20030930222556.GG24824@parcelfarce.linux.theplanet.co.uk>
On Tue, Sep 30, 2003 at 11:25:56PM +0100, Matthew Wilcox wrote:
> On Tue, Sep 30, 2003 at 02:08:05PM -0700, Andrew Morton wrote:
> > Arun Sharma <arun.sharma@intel.com> wrote:
> > >
> > > Some drivers seem to use macros such as _IOR/_IOW in a way that ends up
> > > calling the sizeof() operator twice. For eg:
> > >
> > > -#define FBIO_ATY128_GET_MIRROR _IOR('@', 1, sizeof(__u32*))
> > > +#define FBIO_ATY128_GET_MIRROR _IOR('@', 1, __u32*)
But this changes the define. You want
#define FBIO_ATY128_GET_MIRROR _IOR_BAD('@', 1, __u32*)
> +#define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),(_IOC_TYPECHECK(size)
> ))
> +#define _IOR_BAD(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size))
Something else we should do is to change all occurrences of 'size'
here into 'argtype'. All this nonsense came because of the bad choice
of identifier.
next prev parent reply other threads:[~2003-10-01 0:32 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-30 20:53 [PATCH] incorrect use of sizeof() in ioctl definitions Arun Sharma
2003-09-30 21:08 ` Andrew Morton
2003-09-30 21:35 ` Russell King
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 [this message]
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=20031001003211.GA1520@win.tue.nl \
--to=aebr@win.tue.nl \
--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;
as well as URLs for NNTP newsgroup(s).