public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: Dean Nelson <dcn@sgi.com>
To: linux-ia64@vger.kernel.org
Subject: Re: [PATCH 3/4] SGI Altix cross partition functionality
Date: Wed, 07 Jul 2004 19:40:17 +0000	[thread overview]
Message-ID: <20040707194017.GA31289@sgi.com> (raw)
In-Reply-To: <20040617183638.GA3712@sgi.com>

On Thu, Jun 17, 2004 at 08:22:29PM +0100, Christoph Hellwig wrote:
> +	/*
> +	 * Zero out MOST of the entry for this partition. Only the fields
> +	 * following `references' will be zeroed. The others must remain
> +	 * `viable' across partition ups and downs, since they may be
> +	 * referenced during this memset() operation.
> +	 */
> +	memset((u8 *)&part->references + sizeof(part->references), 0,
> 
> cast to u8 * in memset? Ummm..

I'm not exactly sure what you're objecting to here. The cast is necessary for
a correct result. The following two lines do not give the same result (the
'references' field is an atomic_t):
 
        (u8 *)&part->references + sizeof(part->references)
        &part->references + sizeof(part->references)
 
So is it the use of 'u8' instead of 'unsigned char' or 'char' that you object
to? Or is it the complexity of the args to memset? The entire memset call was
originally as follows:
 
        memset((u8 *)&part->references + sizeof(part->references), 0,
                (u64)(part + 1) - (u64)((u8 *)&part->references +
                                                sizeof(part->references)));
 
Would you prefer it to be something like?
 
        u8 *addr;
        size_t nbytes;
 
 
        addr = (u8 *) &part->references + sizeof(part->references);
        nbytes = (size_t) (part + 1) - (size_t) addr;
        memset(addr, 0, nbytes);
 
Or is it something else that you object to?
 
Thanks,
Dean


  parent reply	other threads:[~2004-07-07 19:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-17 18:36 [PATCH 3/4] SGI Altix cross partition functionality Dean Nelson
2004-06-17 19:22 ` Christoph Hellwig
2004-06-17 19:42 ` Dean Nelson
2004-06-22 18:17 ` Dean Nelson
2004-06-22 18:26 ` Christoph Hellwig
2004-07-07 19:40 ` Dean Nelson [this message]
2004-07-11 10:11 ` Christoph Hellwig

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=20040707194017.GA31289@sgi.com \
    --to=dcn@sgi.com \
    --cc=linux-ia64@vger.kernel.org \
    /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