Re: [PATCH] i386: Add a temporary to make put_user more type safe.

From: Andrew Morton
Date: Sun Jan 29 2006 - 14:31:45 EST


Ingo Oeser <ioe-lkml@xxxxxxxxxx> wrote:
>
> > #define put_user(x,ptr) \
> > ({ int __ret_pu; \
> > __chk_user_ptr(ptr); \
> > - __typeof__(*(ptr)) __pu_val = x; \
> > + __typeof__(x)*_p_; \
> > + __typeof__(x)__pu_val; \
> > + \
> > + _p_ = ptr; \
> > + __pu_val = x; \
> > switch(sizeof(*(ptr))) { \
>
> - switch(sizeof(*(ptr))) { \
> + switch(sizeof(*(_p_))) { \
>
> > - case 1: __put_user_1(__pu_val, ptr); break; \
> > - case 2: __put_user_2(__pu_val, ptr); break; \
> > - case 4: __put_user_4(__pu_val, ptr); break; \
> > - case 8: __put_user_8(__pu_val, ptr); break; \
> > - default:__put_user_X(__pu_val, ptr); break; \
> > + case 1: __put_user_1(__pu_val, _p_); break; \
> > + case 2: __put_user_2(__pu_val, _p_); break; \
> > + case 4: __put_user_4(__pu_val, _p_); break; \
> > + case 8: __put_user_8(__pu_val, _p_); break; \
> > + default:__put_user_X(__pu_val, _p_); break; \
> > } \
> > __ret_pu; \
> > })
>
> Does this now give less warnings?

No, it won't do. All the warnings were legitimate anyway.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/