selinux November 2010 archive
Main Archive Page > Month Archives  > selinux archives
selinux: Re: [PATCH 1/4] flex_array: fix flex_array_put_ptr macr

Re: [PATCH 1/4] flex_array: fix flex_array_put_ptr macro to be valid C

From: James Morris <jmorris_at_nospam>
Date: Sun Nov 28 2010 - 21:15:38 GMT
To: Eric Paris <eparis@redhat.com>

On Tue, 23 Nov 2010, Eric Paris wrote:

> Using flex_array_put_ptr() results in a compile error "error: lvalue
> required as unary ?&? operand" fix the casting order to fix this.
>
> Signed-off-by: Eric Paris <eparis@redhat.com>

These all look good to me. Consider cc'ing the LSM list with
SELinux kernel changes.

> ---
>
> include/linux/flex_array.h | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/include/linux/flex_array.h b/include/linux/flex_array.h
> index 631b77f..70e4efa 100644
> --- a/include/linux/flex_array.h
> +++ b/include/linux/flex_array.h
> @@ -71,7 +71,7 @@ void *flex_array_get(struct flex_array *fa, unsigned int element_nr);
> int flex_array_shrink(struct flex_array *fa);
>
> #define flex_array_put_ptr(fa, nr, src, gfp) \
> - flex_array_put(fa, nr, &(void *)(src), gfp)
> + flex_array_put(fa, nr, (void *)&(src), gfp)
>
> void *flex_array_get_ptr(struct flex_array *fa, unsigned int element_nr);
>
>

-- James Morris <jmorris@namei.org> -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with the words "unsubscribe selinux" without quotes as the message.