[PATCH v4, 07/16] xfsprogs: metadump: use pointers in generate_obfuscated_name()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



. . .
> One small comment below, otherwise:
> 
> Reviewed-by: Dave Chinner <dchinner@xxxxxxxxxx>
> 
> > @@ -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@xxxxxxxxxxx
http://oss.sgi.com/mailman/listinfo/xfs


[Index of Archives]     [Linux XFS Devel]     [Linux Filesystem Development]     [Filesystem Testing]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux