From patchwork Wed Dec 10 23:13:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Ellcey X-Patchwork-Id: 419898 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45CB61400D5 for ; Thu, 11 Dec 2014 10:13:35 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:date:to:subject:mime-version:content-type :content-transfer-encoding:message-id; q=dns; s=default; b=T0ATk J+q9ClK1rRhoeNtIo+nG6AV1vZN5p21yXd1+cQ/upL1zRhCBBfS7Wl/huqgpIUVL RO4wyvJzSKa6H4klk0JVPvPspWBwogwt1rX1+/K2sg4ROzA+M7XHcD65C0pzWhpa mueOeEBhKI5+yB/DwDkUfpQiX1gqpDSUDunKZ4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:date:to:subject:mime-version:content-type :content-transfer-encoding:message-id; s=default; bh=6lfqaOuCsf4 AxcZ2rkM8yGMJy84=; b=GHHOfvXXGM3JTCmzw4ONDUfshebz5S9ad3YUb0X5erL u9zcbio/uQhxXftZ4JJCDyNGfyOa/OjmS/YHOZOazpSQ9fz0BbeI5AkgrAms7SPb dsoP3/fvjMNw3aahvDiDt6K/LkL5MZo8M9OqVAVqCYfZToFtk8Ao5qoG2mfo0YGQ = Received: (qmail 12497 invoked by alias); 10 Dec 2014 23:13:29 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 12487 invoked by uid 89); 10 Dec 2014 23:13:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mailapp01.imgtec.com From: "Steve Ellcey " Date: Wed, 10 Dec 2014 15:13:20 -0800 To: Subject: [Patch, MIPS] Fix warning from malloc/malloc.c User-Agent: Heirloom mailx 12.5 6/20/10 MIME-Version: 1.0 Message-ID: <5b13bf9e-b30c-4405-b2aa-cfa2b3e4c618@BAMAIL02.ba.imgtec.org> Here is a fix for another warning (now error) found in my MIPS build. malloc.c: In function '__posix_memalign': malloc.c:4976:50: error: logical not is only applied to the left hand side of comparison [-Werror=logical-not-parentheses] || !powerof2 (alignment / sizeof (void *)) != 0 ^ cc1: all warnings being treated as errors The fix is to remove the '!= 0' comparision since it is redundant. OK to checkin? Steve Ellcey sellcey@imgtec.com 2014-12-10 Steve Ellcey * malloc/malloc.c: Fix powerof2 check. diff --git a/malloc/malloc.c b/malloc/malloc.c index 6bfb859..cb91b97 100644 --- a/malloc/malloc.c +++ b/malloc/malloc.c @@ -4973,7 +4973,7 @@ __posix_memalign (void **memptr, size_t alignment, size_t size) /* Test whether the SIZE argument is valid. It must be a power of two multiple of sizeof (void *). */ if (alignment % sizeof (void *) != 0 - || !powerof2 (alignment / sizeof (void *)) != 0 + || !powerof2 (alignment / sizeof (void *)) || alignment == 0) return EINVAL;