Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp421334pxk; Fri, 11 Sep 2020 10:24:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzANKqMjbgfq9Q5j8CE0if0TTtzQA9gZII8vzgtxSvC/RFXAA37Are8+CmHg3ppAQ9OfX0C X-Received: by 2002:a17:906:4a53:: with SMTP id a19mr3230861ejv.56.1599845060277; Fri, 11 Sep 2020 10:24:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599845060; cv=none; d=google.com; s=arc-20160816; b=X86j5cxi7a496O+3U+bDLf/KMMHSS8ayXiOaq68NEmJxP1+Gx1T4grnIbFdDUfBlLs K6TV6KMbyttfn7201rrivjlAy56jLdzmej70gD6aBsU+XX8NVA3UxS56WoXb+uswAegy bJfwzie4Ecka6FqzF0w7vhv97CgtMKKm1/IrPuGIjtz457wySCewU0/y0Ehx4PX+eczz uoH/S/zokq9mo9hVwZbntdQP6lrfnNqL+mJsGbaZw0UdP76zbktI8tIQZxy4V4VCmIlL 9W/cTaIY9Z/tMQ5agQu4P/LHIREHFAD/8/A4TTL09WGSi/i3xoc3E365J3YBRhVDKBUw Iffw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=2fTBmuUqV7w9yVbRMzjBJhIvzS77u+JZvg9m/r6YzfI=; b=TGDMZ748xgcAeKkjwDCUyTtTK6C+HsLsPeiW/0eqqsTbQ22BlUQovXfOKqXBIHO5mm VKJIfp9xeTmWZxI/gCBYA8yJYVnIkfuwtly3rE3G3Cr2jhaopGDNV0tPHrpHmo+NRuZj HXOM3zNvibPjXs0Ae5TcKcxz+c6LHE0ZDB9bQnTSgQOJXi/aH3avMs46qGFuSkp/eExn KkxLiXJUG2UlfMeaqUyaiOfQMAMg6BBS9h0FKQuXfoLYNzxzHIuOTmcQajgPdExS/OVb Q3JXZEGtGy1PNlIl2OahdyKNPVE1KqHwvfBdK3E18jM2r5FN0riepFvM+sNKlXITtJmd y34g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MkSuYtEP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e22si1678508edv.198.2020.09.11.10.23.57; Fri, 11 Sep 2020 10:24:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MkSuYtEP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726041AbgIKRUk (ORCPT + 99 others); Fri, 11 Sep 2020 13:20:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:53760 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726150AbgIKNBU (ORCPT ); Fri, 11 Sep 2020 09:01:20 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 63B702222D; Fri, 11 Sep 2020 12:56:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599829004; bh=6XiXYf1OQACfz6Pl7MUVTDtIWF63t2t/6FVZNrXz7CA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MkSuYtEPJbNoqYhNCXSpTgL67XPtgSAJAU5LY3GrQx9UiDozXk1SzoWSSAabUQtrv TbJ8HLfPVkEsRWXIjkYrXA+3My6hdaE/J3A/9rdNYPuskMAI7NDqjB37o0cCQg0nr+ y7E9X+cmKdBq6iCpLzOrun/XNnzyEB6cOXsBXPO8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jason Gunthorpe , Andrew Morton , Linus Torvalds , Sasha Levin Subject: [PATCH 4.9 28/71] include/linux/log2.h: add missing () around n in roundup_pow_of_two() Date: Fri, 11 Sep 2020 14:46:12 +0200 Message-Id: <20200911122506.337164398@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200911122504.928931589@linuxfoundation.org> References: <20200911122504.928931589@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jason Gunthorpe [ Upstream commit 428fc0aff4e59399ec719ffcc1f7a5d29a4ee476 ] Otherwise gcc generates warnings if the expression is complicated. Fixes: 312a0c170945 ("[PATCH] LOG2: Alter roundup_pow_of_two() so that it can use a ilog2() on a constant") Signed-off-by: Jason Gunthorpe Signed-off-by: Andrew Morton Link: https://lkml.kernel.org/r/0-v1-8a2697e3c003+41165-log_brackets_jgg@nvidia.com Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- include/linux/log2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/log2.h b/include/linux/log2.h index c373295f359fa..cca606609e1bc 100644 --- a/include/linux/log2.h +++ b/include/linux/log2.h @@ -159,7 +159,7 @@ unsigned long __rounddown_pow_of_two(unsigned long n) #define roundup_pow_of_two(n) \ ( \ __builtin_constant_p(n) ? ( \ - (n == 1) ? 1 : \ + ((n) == 1) ? 1 : \ (1UL << (ilog2((n) - 1) + 1)) \ ) : \ __roundup_pow_of_two(n) \ -- 2.25.1