Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3359182pxf; Mon, 22 Mar 2021 04:47:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJynzl24Z4MuTm1BR/gG0BbNVxPcjnNwHF8WRloEj6Sij76h74Jv2/uWRENji6NrUERd+m7W X-Received: by 2002:a17:907:20f5:: with SMTP id rh21mr19395374ejb.27.1616413655150; Mon, 22 Mar 2021 04:47:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616413655; cv=none; d=google.com; s=arc-20160816; b=TXlQ95GsipwCbL0l291LGSjGbVnaRhhL1pWOSRAKBbULn4AzRBY6YIA7EXIqiUcGKq TFY5DdOfg9J+LwfUSp6EdhI97CZB27G9zLCMmwhXD1FOIH8iqVgGsECTlHC7HwYsDM6x AvAbgM3dhlLhJAUQVM8PKZNgrcG60STC7trljNf4qMKGc+WrqhVpLr+97QPTjHmdGhBm qnmYIYMY6Wm2wOYnVoMJYfffRRsIYb698B1y4s5Fw+Q2Nm+vYl6UXwCr4um2D0F6MqD0 h2V24qaaR7CMoccGbx26qYYSvfbacB1NDvsBokXqkMqyrZWt54/TuZMmVumRniTHhYHH 1WjA== 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=b92HnWORKgzgn8etHZY/k2x93w2oPCzhR+Qb76pLGVk=; b=FMUKK26q8HjSXqvySSwMstS5yGoyOdBezbG1KqeYzAxBSDtcvs9fACC7DKa+Vsu3yp qg0tqVjMDAgy3J4UN0a7FHfir/CJ42vMtmAKR9jpoPfBtLooR+/9VIiPQZ71ya3Ray72 JwCSywhf2ntT6AaTYIXi07ydXDby0CDj3snHXLg95ul6jzz+i2ZIH/NhWKNCQiNOIpjs EIjvktD+GJ20yLlQTFPeavK7QFiC5MP54rbDf5U9jfUyhbXIAmQEyO/TxN1iT/8u9USL c4v8XsQcUWA7vSTyyFNM6nyflMqmJ3/EgKcfNdlurFch2JX3mlAhpahXn+/AZAqF/qoE NeZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=STqHgweU; 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=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 w5si11610388ejk.167.2021.03.22.04.47.12; Mon, 22 Mar 2021 04:47:35 -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=k20201202 header.b=STqHgweU; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229893AbhCVLqO (ORCPT + 99 others); Mon, 22 Mar 2021 07:46:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:44180 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230015AbhCVLpk (ORCPT ); Mon, 22 Mar 2021 07:45:40 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 71BF76198D; Mon, 22 Mar 2021 11:45:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616413539; bh=AhqyUvuSkgwMKFkXzmAQIx+J10dGdjipgYaeKlOyw2E=; h=From:To:Cc:Subject:Date:From; b=STqHgweUfzSJ9/f7W4KQSwiYvG6U+oaTg+zVY1VgB8IK+1PgrYJyClD7TM0nrBIJx WdVPuBrKnGWrAVkl0l9QjgP+aeKSr+Ds8oreLfUwDQ1EhPjNkIT9OVyXFIOYzHRlZn zaT7vN89vSkRkoXto2S/v/MK8qW/hIj0E7bt6bGxxRZ8PEQX/j01kHp78p8QJScxk8 x1iTg1vxrXDUJLw4PCEphioUvmLgprGrDbCzVo9k4baudDNhejGJUq7Q3HOMTB6zud 1tJgT2GlNzajrdH3GqBFVFG2S4yrlsj38GfgmbzB/ylwuFQJPb1zCQHnGNvQ7KoQED AGlcpPuO+zg4Q== From: Arnd Bergmann To: Paul Moore , Eric Paris Cc: Arnd Bergmann , Richard Guy Briggs , Jules Irenge , linux-audit@redhat.com, linux-kernel@vger.kernel.org Subject: [PATCH] audit: avoid -Wempty-body warning Date: Mon, 22 Mar 2021 12:45:32 +0100 Message-Id: <20210322114536.3517661-1-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann gcc warns about an empty statement when audit_remove_mark is defined to nothing: kernel/auditfilter.c: In function 'audit_data_to_entry': kernel/auditfilter.c:609:51: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body] 609 | audit_remove_mark(entry->rule.exe); /* that's the template one */ | ^ Change the macros to use the usual "do { } while (0)" instead, and change a few more that were (void)0, for consistency. Signed-off-by: Arnd Bergmann --- kernel/audit.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kernel/audit.h b/kernel/audit.h index 3b9c0945225a..c39c5f3b8422 100644 --- a/kernel/audit.h +++ b/kernel/audit.h @@ -302,8 +302,8 @@ extern struct list_head *audit_killed_trees(void); #define audit_alloc_mark(k, p, l) (ERR_PTR(-EINVAL)) #define audit_mark_path(m) "" -#define audit_remove_mark(m) -#define audit_remove_mark_rule(k) +#define audit_remove_mark(m) do { } while (0) +#define audit_remove_mark_rule(k) do { } while (0) #define audit_mark_compare(m, i, d) 0 #define audit_exe_compare(t, m) (-EINVAL) #define audit_dupe_exe(n, o) (-EINVAL) @@ -311,8 +311,8 @@ extern struct list_head *audit_killed_trees(void); #define audit_remove_tree_rule(rule) BUG() #define audit_add_tree_rule(rule) -EINVAL #define audit_make_tree(rule, str, op) -EINVAL -#define audit_trim_trees() (void)0 -#define audit_put_tree(tree) (void)0 +#define audit_trim_trees() do { } while (0) +#define audit_put_tree(tree) do { } while (0) #define audit_tag_tree(old, new) -EINVAL #define audit_tree_path(rule) "" /* never called */ #define audit_kill_trees(context) BUG() -- 2.29.2