From patchwork Mon Mar 22 11:34:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 406104 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp3485644jai; Mon, 22 Mar 2021 04:35:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzqrC31rAtRrueUA6vFmxTQ3d0YSwY+l73nsY9FUDfQ9wPR2DLp8Tan2EyAF0KD1ZS54d5k X-Received: by 2002:a7b:c396:: with SMTP id s22mr15412013wmj.38.1616412940250; Mon, 22 Mar 2021 04:35:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616412940; cv=none; d=google.com; s=arc-20160816; b=nhKr5PTFHzhe66xcY12eWM3Ille+rZSolT+KcETTnCgtUNbkITmpfH/d1OYV6kIqAZ YTqwXgrqQUaUT75o+VL4sC9nyIkqgzkb/xjJj1ckX2aWx/ei5bmnBiTdKUdVneVpXMmP uvKG02Te0bTCK1HHn2xmnqSwdPa+kyN0fykVVVknOOZdkOy/xY/GjPNvTGmPMGyj1rhp kZOp4viq8hqBw19MHUm2VR+So4YgojSOjY0X1yqXKnwmvVL1XCsqAJBwFlAElgSspA4f mnSd/NAjeYsfDASJdT1IKYsqixOv+OOwve7OaoYsyM9Lpc74v3EAor7isCnLLgrEhThV ypYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mime-version:message-id:date:subject:cc:to:from:dkim-signature :dkim-signature; bh=Z9qH87YVwkqrTKF045BGjBPt36YWTb1hUoA4NlryVWs=; b=L5qne3AGRX/QZhXIE34m1dDKaHB/VJBWsqKOe7KtGCwivK2oViCih0PC5f2Yto7pUL /Su44GCGVMZBeZzQ9eqMCfXBRicn+iSIvSCFbbZtFC5f+SQAjEsfMWDBnTVBsU1ukJBl 6LoDifYKCtCdUz1CRwvPG/zMCC0+4FC4kX8BCRNgPm19IIPwUpNvnFwANlbBbLzTB1W/ wCeLZoAzGluJt22Rz883+LEUP+nzl//pfVMG6B+9wSLaB5X1C4xQpaPPZGCjS/klhDhs 7s2uY8H2J2cp0tL1PBi5SV3w/lc1QX1u+waeQGW9bT89gPFUrWX+27SOFqtuRjHMmyyC I4PQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=desiato.20200630 header.b=BHVAZm9V; dkim=neutral (body hash did not verify) header.i=@kernel.org header.s=k20201202 header.b=lJSs0aAy; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 as permitted sender) smtp.mailfrom="linux-mtd-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from desiato.infradead.org (desiato.infradead.org. [2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by mx.google.com with ESMTPS id k11si13282562wrl.428.2021.03.22.04.35.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Mar 2021 04:35:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 as permitted sender) client-ip=2001:8b0:10b:1:d65d:64ff:fe57:4e05; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=desiato.20200630 header.b=BHVAZm9V; dkim=neutral (body hash did not verify) header.i=@kernel.org header.s=k20201202 header.b=lJSs0aAy; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 as permitted sender) smtp.mailfrom="linux-mtd-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=Z9qH87YVwkqrTKF045BGjBPt36YWTb1hUoA4NlryVWs=; b=BHVAZm9VU4nMTsDVHqasLqvto9 NJh5QgqmBNGv4PalYfkMSvfg+745QpqmOx6AycuK/CbrLIdfz2knfV/8IDhncWEQFZvpc2gIP8iFz 17OmLNbMYkGyDAlBExlTD5F2K26R0M4ucuEH3PRmI0tp8B8ga6u/eltQh1lOU9vacqiL7P/ua0KKT si4Wi7aNR0ocuvYxZyhrFQMBDMkJ5nHTV/4vIjef8p+UWSbPND+viv35ew5J1bADwtZAlPd9/PDDR r25AVs5S7mwhZWZLZTafvflWZof3qUwQrthiVFdTqWWWLbGcUOMIEVi6J0jmQoyKoqWyYRirQzXbc FOUs0MMw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lOIpY-00BTUK-Fo; Mon, 22 Mar 2021 11:34:44 +0000 Received: from mail.kernel.org ([198.145.29.99]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lOIpT-00BTT4-Ax for linux-mtd@lists.infradead.org; Mon, 22 Mar 2021 11:34:41 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id BA9D06198B; Mon, 22 Mar 2021 11:34:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616412878; bh=WOJn3MilWpAvLS3chkKdd2cGjmreOdFbGDpQTcekL6k=; h=From:To:Cc:Subject:Date:From; b=lJSs0aAy+xIkv/NifyM67kYKGfafnVHmdY8oNXXd7mVd7LfBpylUFh7IgFFjgW9AR A5MsiQ23qPVM7v7LAMjLCoajVmAd0bPfM7dC9JJSMVnW2uS+xPPCpt9a06Sq+2R041 xG5ATl8kLn/oMQ/AkDnh9wuN2zE8NoxmIcRMVvykSy9L+BVmDqG2k9XT0xPNcQED1/ E51Egkp+kICTwFPqZgv13fFb8ckPffG2GxKJCSJXdWDmkd/7fRKcMPqArKBA8lbRoA MJI6DdsZ0G9C3/uh7mFTZv+JD7dWANRjZgq5ER1YMdf9ROhEDTaYGx1L9GI1KVGTv5 Frmnf0XZm0DpQ== From: Arnd Bergmann To: David Woodhouse , Richard Weinberger Cc: Arnd Bergmann , "Gustavo A. R. Silva" , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] jffs2: avoid Wempty-body warnings Date: Mon, 22 Mar 2021 12:34:29 +0100 Message-Id: <20210322113434.3068844-1-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210322_113439_954033_E742F97D X-CRM114-Status: UNSURE ( 9.41 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -5.5 (-----) X-Spam-Report: Spam detection software, running on the system "desiato.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Arnd Bergmann Building with W=1 shows a few warnings for empty macros: fs/jffs2/scan.c: In function 'jffs2_scan_xattr_node': fs/jffs2/scan.c:378:66: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body] 378 | jffs2_sum_add_xattr_mem(s, rx, ofs [...] Content analysis details: (-5.5 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at https://www.dnswl.org/, high trust [198.145.29.99 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.3 DKIMWL_WL_HIGH DKIMwl.org - High trust sender X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org From: Arnd Bergmann Building with W=1 shows a few warnings for empty macros: fs/jffs2/scan.c: In function 'jffs2_scan_xattr_node': fs/jffs2/scan.c:378:66: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body] 378 | jffs2_sum_add_xattr_mem(s, rx, ofs - jeb->offset); | ^ fs/jffs2/scan.c: In function 'jffs2_scan_xref_node': fs/jffs2/scan.c:434:65: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body] 434 | jffs2_sum_add_xref_mem(s, rr, ofs - jeb->offset); | ^ fs/jffs2/scan.c: In function 'jffs2_scan_eraseblock': fs/jffs2/scan.c:893:88: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body] 893 | jffs2_sum_add_padding_mem(s, je32_to_cpu(node->totlen)); | ^ Change all these macros to 'do { } while (0)' statements to avoid the warnings and make the code a little more robust. Signed-off-by: Arnd Bergmann --- fs/jffs2/summary.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) -- 2.29.2 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ diff --git a/fs/jffs2/summary.h b/fs/jffs2/summary.h index e4131cb1f1d4..36d9a1280770 100644 --- a/fs/jffs2/summary.h +++ b/fs/jffs2/summary.h @@ -194,18 +194,18 @@ int jffs2_sum_scan_sumnode(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb #define jffs2_sum_active() (0) #define jffs2_sum_init(a) (0) -#define jffs2_sum_exit(a) +#define jffs2_sum_exit(a) do { } while (0) #define jffs2_sum_disable_collecting(a) #define jffs2_sum_is_disabled(a) (0) -#define jffs2_sum_reset_collected(a) +#define jffs2_sum_reset_collected(a) do { } while (0) #define jffs2_sum_add_kvec(a,b,c,d) (0) -#define jffs2_sum_move_collected(a,b) +#define jffs2_sum_move_collected(a,b) do { } while (0) #define jffs2_sum_write_sumnode(a) (0) -#define jffs2_sum_add_padding_mem(a,b) -#define jffs2_sum_add_inode_mem(a,b,c) -#define jffs2_sum_add_dirent_mem(a,b,c) -#define jffs2_sum_add_xattr_mem(a,b,c) -#define jffs2_sum_add_xref_mem(a,b,c) +#define jffs2_sum_add_padding_mem(a,b) do { } while (0) +#define jffs2_sum_add_inode_mem(a,b,c) do { } while (0) +#define jffs2_sum_add_dirent_mem(a,b,c) do { } while (0) +#define jffs2_sum_add_xattr_mem(a,b,c) do { } while (0) +#define jffs2_sum_add_xref_mem(a,b,c) do { } while (0) #define jffs2_sum_scan_sumnode(a,b,c,d,e) (0) #endif /* CONFIG_JFFS2_SUMMARY */