Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp794785ybx; Wed, 30 Oct 2019 05:15:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqxc3khSBJ4prgWRx3/qTdZDEMJTW1A3qlxLGQ55SdlvbEgSXKQBwV0YzfQk5yZ/eNWvkXK/ X-Received: by 2002:a17:906:7097:: with SMTP id b23mr8745410ejk.252.1572437713059; Wed, 30 Oct 2019 05:15:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572437713; cv=none; d=google.com; s=arc-20160816; b=BX6xmoLI1AHVfQIIj8tEA+SV0wndM8hGdnplZJ0KTgo6eqO1yVeOqi0NSk+4ABFjHK bSkvoekctJFGPuJYKaTttmvqnIGvAlXaIg9YBAoEGtfeckVoLKQYZ1uNd1IaReZWt30C H9va1lOdXoFWU8HU1AwfzSbAyAoVINB/iC1tN021CxFFGi2xbKD+Mg8IuTA5+UcxtxuY GFdzDVI+Q9iYKLFWH6wLLI/2/9nRvVoCoPEuCO+wHaFe7WEXxwH7l3BNI8dUvy84Ek5K TyMbl5TZeTRCwB4OehZPcpsKSikkJEEZf/i2PJfJzyExK7D8jDV5FXIIDHFPOsweq0ba 157w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:message-id:subject:cc:from:to :in-reply-to; bh=rPr9ETWwF2AfUnoL5iyUXEUAR8qUE5m6BDJBmZptihE=; b=aPAX84J6XLXZ7KcHVO5BqZpE/OPdQt7OBoF75G4VIRDmm5wKbQxaHFijL889TXXicx 8T7nzbnZKawPryl5b+GmbFlc3/OKxxUUZNVOgO1ueH21mxZsFsdllKgsN2oQUJeZGzoz mtWshP/ZvISBrY51IT7p+UQy8FE1kbwS0yR6yXZPFZWB7Q6fIrb1X6W35ND1QG9Hbsqo rSuh6gD3IjvQkSotJWSDjY27Yx3MHFMSuoyW7eZ9rIqVDnx2VoDLeJlMtunEw1g3T5h4 iQU+Hy1ZxcfnAQpZ6veCa5kWx29JGxZlQT2ZeL5rPrXo8/edcAO++PfjC+TZ3GvdoQ86 fA8g== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h5si1422689edj.25.2019.10.30.05.14.49; Wed, 30 Oct 2019 05:15:13 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726332AbfJ3MOR (ORCPT + 99 others); Wed, 30 Oct 2019 08:14:17 -0400 Received: from ozlabs.org ([203.11.71.1]:43971 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726088AbfJ3MOR (ORCPT ); Wed, 30 Oct 2019 08:14:17 -0400 Received: by ozlabs.org (Postfix, from userid 1034) id 4736nf5bR0z9sPq; Wed, 30 Oct 2019 23:14:14 +1100 (AEDT) X-powerpc-patch-notification: thanks X-powerpc-patch-commit: 3b9176e9a874a848afa7eb2f6943639eb18b7a17 In-Reply-To: <1563215552-8166-1-git-send-email-cai@lca.pw> To: Qian Cai From: Michael Ellerman Cc: linux-kernel@vger.kernel.org, paulus@samba.org, tyreld@linux.vnet.ibm.com, joe@perches.com, Qian Cai , linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH v4] powerpc/setup_64: fix -Wempty-body warnings Message-Id: <4736nf5bR0z9sPq@ozlabs.org> Date: Wed, 30 Oct 2019 23:14:14 +1100 (AEDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2019-07-15 at 18:32:32 UTC, 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 > > 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"); > > Fix it by using the suggestions from Michael: > > "Neither of those sites should use DBG(), that's not really early boot > code, they should just use pr_warn(). > > And the other uses of DBG() in initialize_cache_info() should just be > removed. > > In smp_release_cpus() the entry/exit DBG's should just be removed, and > the spinning_secondaries line should just be pr_debug(). > > That would just leave the two calls in early_setup(). If we taught > udbg_printf() to return early when udbg_putc is NULL, then we could just > call udbg_printf() unconditionally and get rid of the DBG macro > entirely." > > Suggested-by: Michael Ellerman > Signed-off-by: Qian Cai Applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/3b9176e9a874a848afa7eb2f6943639eb18b7a17 cheers