Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3764706ybt; Tue, 23 Jun 2020 10:09:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzcbCtsoBC+oBfx0Eb8P/onNS99/N2qgY1em+qeu/PXYuZJqH5nmhm+6EvvbfUC7sGDOls9 X-Received: by 2002:a17:906:5f98:: with SMTP id a24mr117368eju.241.1592932151978; Tue, 23 Jun 2020 10:09:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592932151; cv=none; d=google.com; s=arc-20160816; b=zoMPy/bWWvEVn7cszqVUfF5bOBMMl0+7k/8WTxbF+2CGR0P/NH8YLKimDAxfR4+tfx YyXBsxB302hf8dnXl4ja8Tv51W+Fsn9hVNjTD+pomXSNBGuWura6dM9KHkNUGuFWYFFw j6JgDDWKh+OuHjxIEhASkOsEaPUbMM0ruI3FQvbQFdngIdvPBUVysMCUgzH0v6LCiqTd 3DqtHg8R6Da4y2gk32TMhfjwMqcdJe7WKpTVOTx+w5asHTjTZpUgbs73v87WbwJq6Y6N xliMFfhBU6A3xMCd6vS7O4vmJlXD+RKV0EvxIvCB7OZNj6FzmuyxDDbR1oNa06XoVMtt LcVw== 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 :message-id:date:subject:smtp-origin-cluster:cc:to :smtp-origin-hostname:from:smtp-origin-hostprefix; bh=Aw8VARnGR0XEKr4x/HiUuJXYzGqnipRQQVHQ+pLeIwA=; b=icsnMit8+JWAGdNWh+R2immOI3BzjMVghd7GhzKBC3vSdqMCKZz39Iumn/tn6QthsX evGrmxmm8wRqKPyzFkE+krUZyfcZC1HEsye2nq2oozqMPa3tQ5HrjfnGRM2Ygik7w5tV ScpLjf28UnZYMQPEyD3YwUyqn0v0Vio/yh+rA7K2WhnTqsaZuCNtwNb7nmD49IzuX2Ww 2xL84tXwFKe+gBjsyn4MpQZ7kG5pdc/QEtP38Ldf2Nqw78fX1ZLgQEDbVfLO0zozX7Eu Yovi44L5QxBdT0aHCbV693MzJeu7tdd2s+M+pmPTBhAfziy7h+TnfvvISV1ee25ACKVR oamw== ARC-Authentication-Results: i=1; mx.google.com; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i6si10973495ejj.508.2020.06.23.10.08.48; Tue, 23 Jun 2020 10:09:11 -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; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733043AbgFWRHr convert rfc822-to-8bit (ORCPT + 99 others); Tue, 23 Jun 2020 13:07:47 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:7610 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728916AbgFWRHr (ORCPT ); Tue, 23 Jun 2020 13:07:47 -0400 Received: from pps.filterd (m0148460.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 05NGoKxT012000 for ; Tue, 23 Jun 2020 10:07:46 -0700 Received: from maileast.thefacebook.com ([163.114.130.16]) by mx0a-00082601.pphosted.com with ESMTP id 31uk2ugyu7-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Tue, 23 Jun 2020 10:07:46 -0700 Received: from intmgw003.06.prn3.facebook.com (2620:10d:c0a8:1b::d) by mail.thefacebook.com (2620:10d:c0a8:82::d) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Tue, 23 Jun 2020 10:07:44 -0700 Received: by devvm1828.vll1.facebook.com (Postfix, from userid 172786) id 1C8A73D84E272; Tue, 23 Jun 2020 10:07:39 -0700 (PDT) Smtp-Origin-Hostprefix: devvm From: Jonathan Lemon Smtp-Origin-Hostname: devvm1828.vll1.facebook.com To: CC: , Smtp-Origin-Cluster: vll1c12 Subject: [PATCH] linux/log2.h: enclose macro arg in parens Date: Tue, 23 Jun 2020 10:07:39 -0700 Message-ID: <20200623170739.3151706-1-jonathan.lemon@gmail.com> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216,18.0.687 definitions=2020-06-23_11:2020-06-23,2020-06-23 signatures=0 X-Proofpoint-Spam-Details: rule=fb_default_notspam policy=fb_default score=0 mlxlogscore=790 bulkscore=0 priorityscore=1501 spamscore=0 malwarescore=0 suspectscore=1 adultscore=0 clxscore=1034 phishscore=0 impostorscore=0 mlxscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006120000 definitions=main-2006230122 X-FB-Internal: deliver Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jonathan Lemon roundup_pow_of_two uses its arg without enclosing it in parens. A call of the form: roundup_pow_of_two(boolval ? PAGE_SIZE : frag_size) resulted in an compile warning: warning: ?: using integer constants in boolean context [-Wint-in-bool-context] PAGE_SIZE : ../include/linux/log2.h:176:4: note: in definition of macro ‘roundup_pow_of_two’ (n == 1) ? 1 : \ ^ And the resulting code used '1' as the result of the operation. Fixes: 312a0c170945 ("[PATCH] LOG2: Alter roundup_pow_of_two() so that it can use a ilog2() on a constant") Signed-off-by: Jonathan Lemon --- 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 83a4a3ca3e8a..c619ec6eff4a 100644 --- a/include/linux/log2.h +++ b/include/linux/log2.h @@ -173,7 +173,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.24.1