mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Eric Paris <eparis@redhat.com>
To: Matt Mackall <mpm@selenic.com>
Cc: Neil Horman <nhorman@tuxdriver.com>,
	linux-kernel@vger.kernel.org, Al Viro <viro@zeniv.linux.org.uk>
Subject: Re: [PATCH] add additional audit info (read/write length & rng name) for RNG devices
Date: Mon, 06 Dec 2010 10:53:38 -0500	[thread overview]
Message-ID: <1291650818.4929.89.camel@localhost.localdomain> (raw)
In-Reply-To: <1291649535.3065.2088.camel@calx>

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


      reply	other threads:[~2010-12-06 15:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-06 15:21 Neil Horman
2010-12-06 15:32 ` Matt Mackall
2010-12-06 15:53   ` Eric Paris [this message]

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=1291650818.4929.89.camel@localhost.localdomain \
    --to=eparis@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpm@selenic.com \
    --cc=nhorman@tuxdriver.com \
    --cc=viro@zeniv.linux.org.uk \
    /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

Powered by JetHome