[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1291650818.4929.89.camel@localhost.localdomain>
Date: Mon, 06 Dec 2010 10:53:38 -0500
From: Eric Paris <eparis@...hat.com>
To: Matt Mackall <mpm@...enic.com>
Cc: Neil Horman <nhorman@...driver.com>, linux-kernel@...r.kernel.org,
Al Viro <viro@...iv.linux.org.uk>
Subject: Re: [PATCH] add additional audit info (read/write length & rng
name) for RNG devices
On Mon, 2010-12-06 at 09:32 -0600, Matt Mackall wrote:
> On Mon, 2010-12-06 at 10:21 -0500, Neil Horman wrote:
+int __audit_rng(const char *name, size_t len)
+{
+ struct audit_aux_data_rng *ax;
+ struct audit_context *context = current->audit_context;
[snip]
+ ax->d.next = context->aux;
+ context->aux = (void *)ax;
+ return 0;
+}
> > + context->aux = (void *)ax;
>
> Redundant cast to void *?
It's not redundant. ax is struct audit_aux_data_rng where the first
entry in the struct is a struct audit_aux_data. context->aux is a
struct audit_aux_data. The 'best' thing to do would really be to do
something like:
context->aux = &(ax->d);
Second best would be:
context->aux = (struct audit_aux_data *)ax;
Third best would be what we have. But since the rest of the aux
structures in the audit code do it this way we do it this way for
consistency. If we ever fix the rest to do it like the 'best' example
we'll update this one, but I'd rather have consistency that have only
this 'one' be 'more correct'
-Eric
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists