Author: kib
Date: Fri Feb  6 08:58:06 2015
New Revision: 278309
URL: https://svnweb.freebsd.org/changeset/base/278309

Log:
  MFC r277936:
  Use powerof2().  Remove single-use variable.

Modified:
  stable/10/libexec/rtld-elf/rtld.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/libexec/rtld-elf/rtld.c
==============================================================================
--- stable/10/libexec/rtld-elf/rtld.c   Fri Feb  6 05:11:46 2015        
(r278308)
+++ stable/10/libexec/rtld-elf/rtld.c   Fri Feb  6 08:58:06 2015        
(r278309)
@@ -863,7 +863,6 @@ digest_dynamic1(Obj_Entry *obj, int earl
     const Elf32_Word *hashval;
     Elf32_Word bkt, nmaskwords;
     int bloom_size32;
-    bool nmw_power2;
     int plttype = DT_REL;
 
     *dyn_rpath = NULL;
@@ -973,16 +972,15 @@ digest_dynamic1(Obj_Entry *obj, int earl
                obj->symndx_gnu = hashtab[1];
                nmaskwords = hashtab[2];
                bloom_size32 = (__ELF_WORD_SIZE / 32) * nmaskwords;
-               /* Number of bitmask words is required to be power of 2 */
-               nmw_power2 = ((nmaskwords & (nmaskwords - 1)) == 0);
                obj->maskwords_bm_gnu = nmaskwords - 1;
                obj->shift2_gnu = hashtab[3];
                obj->bloom_gnu = (Elf_Addr *) (hashtab + 4);
                obj->buckets_gnu = hashtab + 4 + bloom_size32;
                obj->chain_zero_gnu = obj->buckets_gnu + obj->nbuckets_gnu -
                  obj->symndx_gnu;
-               obj->valid_hash_gnu = nmw_power2 && obj->nbuckets_gnu > 0 &&
-                 obj->buckets_gnu != NULL;
+               /* Number of bitmask words is required to be power of 2 */
+               obj->valid_hash_gnu = powerof2(nmaskwords) &&
+                   obj->nbuckets_gnu > 0 && obj->buckets_gnu != NULL;
            }
            break;
 
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to