public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Alex Elder <aelder@sgi.com>
To: Dave Chinner <david@fromorbit.com>
Cc: xfs@oss.sgi.com
Subject: [PATCH v4, 07/16] xfsprogs: metadump: use pointers in generate_obfuscated_name()
Date: Fri, 25 Feb 2011 12:13:40 -0600	[thread overview]
Message-ID: <1298657620.1990.6985.camel@doink> (raw)
In-Reply-To: <20110224014712.GU3166@dastard>

. . .
> One small comment below, otherwise:
> 
> Reviewed-by: Dave Chinner <dchinner@redhat.com>
> 
> > @@ -500,16 +502,17 @@ generate_obfuscated_name(
> >  		 */
> >  		newhash = rol32(newhash, 3) ^ hash;
> >  
> > +		first = newp;
> >  		high_bit = 0;
> > -		for (i = 5; i > 0; i--) {
> > -		    	int shift = (i - 1) * 7;
> > -
> > -			newp[namelen - i] = ((newhash >> shift) & 0x7f) ^ high_bit;
> > -			if (is_invalid_char(newp[namelen - i])) {
> > -				newp[namelen - i] ^= 1;
> > +		for (shift = 28; shift >= 0; shift -= 7) {
> > +			*newp = (newhash >> shift & 0x7f) ^ high_bit;
> 
> I'd prefer not to have to refer to my C bible to remind myself what
> the precedence of ">>" vs "&" is, so perhaps leaving the second set
> of () in this statement would be a good idea.

Done.




_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

      reply	other threads:[~2011-02-25 18:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-18 21:21 [PATCH v3, 07/16] xfsprogs: metadump: use pointers in generate_obfuscated_name() Alex Elder
2011-02-24  1:47 ` Dave Chinner
2011-02-25 18:13   ` Alex Elder [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=1298657620.1990.6985.camel@doink \
    --to=aelder@sgi.com \
    --cc=david@fromorbit.com \
    --cc=xfs@oss.sgi.com \
    /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