From patchwork Mon Mar 22 10:58:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 406100 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp3458613jai; Mon, 22 Mar 2021 03:59:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxBRuINlknel5zOvUdD56FQgEwTwbg/JN/qhcvDPm+OjfGcMSRuQ8SIAR8FnER7TfVG0j+L X-Received: by 2002:a17:906:86c1:: with SMTP id j1mr19032933ejy.373.1616410746521; Mon, 22 Mar 2021 03:59:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616410746; cv=none; d=google.com; s=arc-20160816; b=WLo6bCaiIb8QOx6jrONKlWhMyDgNsdc9sy2uMDlA96kjDF+CARLdip11MedXjChtR8 UMWLu5jYxXIiyPqC5es2MYlLeuJX3aYXKepXoYr5E2jMa4yviu9HbhqvAjlQbX/W0nL9 5GCpArHW++rKTUsMvfUbMcpjshCNlr4ywM/XXfQs1wfS4DmepHUbcZQKulV9auhdNNC2 jU6tJys+nQGd1i/O6u/QuybbpSpFoLufXaLxndlQWLvaBnVXmOnIn/qppXkjoMbmhID8 SPz5mvWqsYFD2oqoZ28bbgy8HQnrDody/r/q+9gdWEXAw8UTFiPuO4GtFMvs85ArHCWf cFNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=h92TBcxJRWruLCHELvtbf8MOTQokTl+u8fSOKtfwZos=; b=fEK08xFyQkeYJkEKm8Tu6r84MdjwCg4tTabP+kBrw/pMJeIoNXI+XxoyNpal9O6KeH U6gedBLh2AtoNB3Xz0+mJnDJOkMSW2INa8Ipwh0M4gNnl5HQGBk0X2nWRnjzSYClEH9J 8RwCw8NLDoqu5SbJUuDcLS8neo3nSXLxwvkFvJyowOEs4qNk4qVyT8fsfpr5eOXxzFFX 2Z7+lzsPVhqBYRcrdwoJt33+pII+iqjML8G/YsfC8v/0kBYA9W3IkPOuR79wLziudVTN j9+wePHFj/Ey6ETY/j1mM4uWq9jLn++PX/gqqobFd8ZGbunNkkNZbahxeBgIDBBQojuH 5W+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hbXWGIPH; spf=pass (google.com: domain of linux-acpi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-acpi-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hc39si10809881ejc.125.2021.03.22.03.59.06; Mon, 22 Mar 2021 03:59:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-acpi-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=k20201202 header.b=hbXWGIPH; spf=pass (google.com: domain of linux-acpi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-acpi-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230314AbhCVK6e (ORCPT + 4 others); Mon, 22 Mar 2021 06:58:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:58552 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230448AbhCVK6J (ORCPT ); Mon, 22 Mar 2021 06:58:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C1D9761931; Mon, 22 Mar 2021 10:58:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616410689; bh=D6etE+5ZjccFIlpT9IufI3R6p4hC1yihNdzOnUUrLqw=; h=From:To:Cc:Subject:Date:From; b=hbXWGIPHRU2BW1goVDukx98kZO8FW1mDVOBE3/yG9MRxnbfIAVtOODvl4/k8QZAxx 0602wWOjw4SlM3OBt/97z/8pSm9fpfr6zdmluYPTi9zUrRctqGgIaD7o1plV+nQuUj X+u6ix8IxvsnzmGBik3hdWRSir/uspc2vhlJi/5StLYP2Gg0W+P6qK4lww4GMYhJLl 9fZhVBqQ4ZDtKTLYmOSuFPc2IzgVIgAKezhhgsPI50c3s8W49TlojM0CNw5mIhEO5F Hatm0HRZHGx1pLi+6tAonS3cGk+2nNKI0VwQ7dIw6HAagK3/10zC52dTlSzk7yyCon cK8ox7ZRKcn/w== From: Arnd Bergmann To: Robert Moore , Erik Kaneda , "Rafael J. Wysocki" , Len Brown Cc: Arnd Bergmann , linux-acpi@vger.kernel.org, devel@acpica.org, linux-kernel@vger.kernel.org Subject: [PATCH] acpi: avoid -Wempty-body warnings Date: Mon, 22 Mar 2021 11:58:00 +0100 Message-Id: <20210322105805.1498602-1-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org From: Arnd Bergmann The acpi drivers produce a number of avoidable warnings for empty macros when building with 'make W=1': drivers/acpi/acpi_processor.c: In function 'acpi_processor_errata_piix4': drivers/acpi/acpi_processor.c:133:95: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body] 133 | "Bus master activity detection (BM-IDE) erratum enabled\n")); | ^ drivers/acpi/acpi_processor.c:136:82: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body] 136 | "Type-F DMA livelock erratum (C3 disabled)\n")); | ^ drivers/acpi/acpi_processor.c: In function 'acpi_processor_get_info': drivers/acpi/acpi_processor.c:251:77: error: suggest braces around empty body in an 'else' statement [-Werror=empty-body] 251 | "No bus mastering arbitration control\n")); | ^ drivers/acpi/processor_pdc.c: In function 'acpi_processor_eval_pdc': drivers/acpi/processor_pdc.c:136:79: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body] 136 | "Could not evaluate _PDC, using legacy perf. control.\n")); | ^ I tried making these call no_printk() instead, which would add proper format string checking, but that turned out to be a rather invasive change, so just shut up the warning by turning the macros into empty "do {} while (0)" statements. Signed-off-by: Arnd Bergmann --- include/acpi/acoutput.h | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) -- 2.29.2 diff --git a/include/acpi/acoutput.h b/include/acpi/acoutput.h index 1538a6853822..b5484ef31f27 100644 --- a/include/acpi/acoutput.h +++ b/include/acpi/acoutput.h @@ -433,23 +433,23 @@ * This is the non-debug case -- make everything go away, * leaving no executable debug code! */ -#define ACPI_DEBUG_PRINT(pl) -#define ACPI_DEBUG_PRINT_RAW(pl) -#define ACPI_DEBUG_EXEC(a) -#define ACPI_DEBUG_ONLY_MEMBERS(a) -#define ACPI_FUNCTION_NAME(a) -#define ACPI_FUNCTION_TRACE(a) -#define ACPI_FUNCTION_TRACE_PTR(a, b) -#define ACPI_FUNCTION_TRACE_U32(a, b) -#define ACPI_FUNCTION_TRACE_STR(a, b) -#define ACPI_FUNCTION_ENTRY() -#define ACPI_DUMP_STACK_ENTRY(a) -#define ACPI_DUMP_OPERANDS(a, b, c) -#define ACPI_DUMP_ENTRY(a, b) -#define ACPI_DUMP_PATHNAME(a, b, c, d) -#define ACPI_DUMP_BUFFER(a, b) +#define ACPI_DEBUG_PRINT(pl) do { } while (0) +#define ACPI_DEBUG_PRINT_RAW(pl) do { } while (0) +#define ACPI_DEBUG_EXEC(a) do { } while (0) +#define ACPI_DEBUG_ONLY_MEMBERS(a) do { } while (0) +#define ACPI_FUNCTION_NAME(a) do { } while (0) +#define ACPI_FUNCTION_TRACE(a) do { } while (0) +#define ACPI_FUNCTION_TRACE_PTR(a, b) do { } while (0) +#define ACPI_FUNCTION_TRACE_U32(a, b) do { } while (0) +#define ACPI_FUNCTION_TRACE_STR(a, b) do { } while (0) +#define ACPI_FUNCTION_ENTRY() do { } while (0) +#define ACPI_DUMP_STACK_ENTRY(a) do { } while (0) +#define ACPI_DUMP_OPERANDS(a, b, c) do { } while (0) +#define ACPI_DUMP_ENTRY(a, b) do { } while (0) +#define ACPI_DUMP_PATHNAME(a, b, c, d) do { } while (0) +#define ACPI_DUMP_BUFFER(a, b) do { } while (0) #define ACPI_IS_DEBUG_ENABLED(level, component) 0 -#define ACPI_TRACE_POINT(a, b, c, d) +#define ACPI_TRACE_POINT(a, b, c, d) do { } while (0) /* Return macros must have a return statement at the minimum */