lkml.org 
[lkml]   [2003]   [Sep]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] use size_t for the broken ioctl numbers
On Sun, Sep 07, 2003 at 07:22:48AM +0100, Matthew Wilcox wrote:

> Clearly it's too late to change the ioctl definitions, but we can at
> least stop people from copying them and making the same mistake.

> -#define BLKELVSET _IOW(0x12,107,sizeof(blkelv_ioctl_arg_t))/* elevator set */
> +#define BLKELVSET _IOW(0x12,107,size_t)/* elevator set */

Here we lose information - I don't like that.
Often it is important to know what kind of argument an ioctl has,
and that info should be easy to find.

I see other parts of this thread discuss the question on how to force people
to do things right in new cases. For old cases, instead of throwing out
the information that a blkelv_ioctl_arg_t is involved, I would like to write

#define BLKELVSET _IOW_BAD(0x12,107,blkelv_ioctl_arg_t)

with

#define _IOW_BAD( ... ) _IOW(..., sizeof(...))

(with s/_IOW/_IOW_NOCK/ in case _IOW is changed so as to check).

Andries

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:48    [W:0.116 / U:0.424 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site