Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7230713ybi; Wed, 5 Jun 2019 13:36:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqznGyWb0sEd2NaAfGMKUNc0V9+XLCxY/ISu+9pBiSf0rADn0C/shZMTS8YcfMZewRmdl7+n X-Received: by 2002:a63:f509:: with SMTP id w9mr891788pgh.134.1559766980945; Wed, 05 Jun 2019 13:36:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559766980; cv=none; d=google.com; s=arc-20160816; b=nA+qgaMDhT+yF/clP8abKFC/0S4pB/sG2dLBlMMD5cEv5ML1dd0uyGly9Dd/zxMraj +RBY6gnJplzfNBeO/Q00n0QgAXPbOh7bCmDgDVP/0yzZZgA7Igij9ZGMQ7C1eYFVLkqn kQKEy7A1hkio3w6VH2foMjVVQNkLkiJzqn56cMX0hppBjPjmqGUMylu+b6BJKCwtd+pm WlwITW2edfOt5awyTKuL8jGCqTBFbe8VX+SkBg4pNLfw+uT5YTwVScBxnotaiJSSNS58 TZaxxg94BoOwQVjeIxxgRYmo3UEqkD9+vn6EMu3gEsoMzq3+9ulBKUBT5MyDh17q6AI5 vANA== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=3rxvRqT/R68FlNEBDVyHZs+udNx1mLcwvRstHQ2VrEU=; b=U+L6WmPOVtec7RxRWU3BBAKMT6Oyhypl6kAdDIDkJcg6OtpIpNtDiHvHdpJtKtfSaf yyXcFuKtsJBGkfZcL7YWKTR9WoqYU2/r6WxV7tLZLGWYxGFA4qBxe3TbDLi127gYK93U x73OH9zHVPNrBEWnpG0K7v3/I5UraA69aarlYKhG+tLrsjXThJ1INO59YLDDOjf7hZpu MqpRLCEfwvCipI5yOoiGT/xo7q0BtIDMx2Lel3SpFZg+SIBfc1Zjlp8WzTbLQ6u23gWc 0R4XRDwRZsIoyhBLkbbZa8Y7sMjl2y6fQ7z2Sb71dpz1TLuyuJETwO6aouSm0OoxO5YE JDAg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i11si27354003plt.92.2019.06.05.13.36.04; Wed, 05 Jun 2019 13:36:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726638AbfFEUd0 (ORCPT + 99 others); Wed, 5 Jun 2019 16:33:26 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:46728 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726305AbfFEUd0 (ORCPT ); Wed, 5 Jun 2019 16:33:26 -0400 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x55KWCS1033242; Wed, 5 Jun 2019 16:33:04 -0400 Received: from ppma01dal.us.ibm.com (83.d6.3fa9.ip4.static.sl-reverse.com [169.63.214.131]) by mx0b-001b2d01.pphosted.com with ESMTP id 2sxkuh2wd8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 Jun 2019 16:33:03 -0400 Received: from pps.filterd (ppma01dal.us.ibm.com [127.0.0.1]) by ppma01dal.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id x55IEFE9014734; Wed, 5 Jun 2019 18:16:24 GMT Received: from b01cxnp23034.gho.pok.ibm.com (b01cxnp23034.gho.pok.ibm.com [9.57.198.29]) by ppma01dal.us.ibm.com with ESMTP id 2swyby2s41-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 Jun 2019 18:16:24 +0000 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x55KX1E233423808 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 5 Jun 2019 20:33:01 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D6E18AC05F; Wed, 5 Jun 2019 20:33:01 +0000 (GMT) Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 14447AC059; Wed, 5 Jun 2019 20:33:01 +0000 (GMT) Received: from oc6857751186.ibm.com (unknown [9.85.191.102]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP; Wed, 5 Jun 2019 20:33:00 +0000 (GMT) Subject: Re: [PATCH] powerpc/setup_64: fix -Wempty-body warnings To: Qian Cai , mpe@ellerman.id.au Cc: paulus@samba.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org References: <1559765875-6328-1-git-send-email-cai@lca.pw> From: Tyrel Datwyler Message-ID: Date: Wed, 5 Jun 2019 13:33:00 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <1559765875-6328-1-git-send-email-cai@lca.pw> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-06-05_12:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=27 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906050129 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/05/2019 01:17 PM, Qian Cai wrote: > At the beginning of setup_64.c, it has, > > #ifdef DEBUG > #define DBG(fmt...) udbg_printf(fmt) > #else > #define DBG(fmt...) > #endif Simpler solution is just to define the debug in the else clause as such: #define DBG(fmt...) do { } while(0) -Tyrel > > where DBG() could be compiled away, and generate warnings, > > arch/powerpc/kernel/setup_64.c: In function 'initialize_cache_info': > arch/powerpc/kernel/setup_64.c:579:49: warning: suggest braces around > empty body in an 'if' statement [-Wempty-body] > DBG("Argh, can't find dcache properties !\n"); > ^ > arch/powerpc/kernel/setup_64.c:582:49: warning: suggest braces around > empty body in an 'if' statement [-Wempty-body] > DBG("Argh, can't find icache properties !\n"); > > Signed-off-by: Qian Cai > --- > arch/powerpc/kernel/setup_64.c | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > > diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c > index 44b4c432a273..23758834324f 100644 > --- a/arch/powerpc/kernel/setup_64.c > +++ b/arch/powerpc/kernel/setup_64.c > @@ -575,12 +575,13 @@ void __init initialize_cache_info(void) > * d-cache and i-cache sizes... -Peter > */ > if (cpu) { > - if (!parse_cache_info(cpu, false, &ppc64_caches.l1d)) > + /* Add an extra brace to silence -Wempty-body warnings. */ > + if (!parse_cache_info(cpu, false, &ppc64_caches.l1d)) { > DBG("Argh, can't find dcache properties !\n"); > - > - if (!parse_cache_info(cpu, true, &ppc64_caches.l1i)) > + } > + if (!parse_cache_info(cpu, true, &ppc64_caches.l1i)) { > DBG("Argh, can't find icache properties !\n"); > - > + } > /* > * Try to find the L2 and L3 if any. Assume they are > * unified and use the D-side properties. >