From owner-svn-src-stable@FreeBSD.ORG Fri Feb 6 08:58:07 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AF3CD2A4; Fri, 6 Feb 2015 08:58:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A3AFDBD; Fri, 6 Feb 2015 08:58:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t168w7pU085908; Fri, 6 Feb 2015 08:58:07 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t168w7ia085907; Fri, 6 Feb 2015 08:58:07 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201502060858.t168w7ia085907@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 6 Feb 2015 08:58:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r278309 - stable/10/libexec/rtld-elf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Feb 2015 08:58:07 -0000 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;