From patchwork Mon Mar 22 10:43:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 406095 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp3451383jai; Mon, 22 Mar 2021 03:45:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/i9cmoMpCqbGoMyTYkeuPno4U087UkC0gwTYkdrnmOw8a9/h3EnAw65iunmELq5GaQm7o X-Received: by 2002:aa7:d4d6:: with SMTP id t22mr25398854edr.376.1616409942541; Mon, 22 Mar 2021 03:45:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616409942; cv=none; d=google.com; s=arc-20160816; b=Ubmewd7T0FYC2ELLt1IJdRYQjRpYdT0J7AFJh+OMJeC0WhowCcX3Pb6hy/9zGK0aEj yScN11GLJqb3GYBw3qnz/TdcQPHcufEKj03w7nnjQvGRpe3QTyvn6mRhDdYdX6LXjf3Y HPQieJ9RA2rNK7jLpAOCagIlOzTZdjeNQ6GPRMB62aB4KXI3jpstX3DMD69BI9Zwh50g evPxnZ2k5uLqOFjOvrpLj/jL8DaHI8ZFBB8gxwzQcmz0fqzSv2XmFjgMuNIChcHBBCgn 3eGu9DwPSlJ/4SYcNPuFp6S/JWwLAd/5FUvyWqI4E2sEpvZw4ICOG672fr9BR0DIKp2g XZVQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=kEqwhha5bMNEn6WZsQwbSuBXlaC1z+zOYyiopeWvVZE=; b=JLi7MucYEoLWlKiI+vJRRu8UlMcwEuTBx294Qie3jkSvYho79Wp5fwcizqVJ7cCkNM 94fKOCIrZ5uoibNU2mOOWXt7zrosb5ROqnEq2+5CAHIwsjQzmt9dVQsaL/67L0mxYERI iI6r7Z9XZF+b3WkH2/AMnsfkFRfYvpQMLzlwIj844JgFUr+PCxCBs+b47tQI9Glol1fe USBUBVDXzCpfT2sEs8FPgUnrlvTXNAbK3FoDZMbCvnhi+6QUAb4Hi5OE8iL0fm3hNGpv bRmSVYTlL3RUfCCr8oSiBJbtpaEW0YqQX6rZAhcUuvqoSj9hV/afsGqEbRszNSiNC2Kn 7w/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cPqdnpIc; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-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.45.41; Mon, 22 Mar 2021 03:45:42 -0700 (PDT) Received-SPF: pass (google.com: domain of netdev-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=cPqdnpIc; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-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 S230299AbhCVKpK (ORCPT + 8 others); Mon, 22 Mar 2021 06:45:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:55236 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230285AbhCVKoi (ORCPT ); Mon, 22 Mar 2021 06:44:38 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4C6E561931; Mon, 22 Mar 2021 10:44:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616409878; bh=4DHr4ASfBHeq91iw3ENPpzdWKJXn5AZnZFrECFYNDQU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cPqdnpIc76Sfc4S0WxhticZnlpY46xJtVyxtipkLrFREoyJDHLvaO/JOmmYxuBWn2 Q0FCwxw6Vr4/fhlrJgzOVXrxEJh/QNygiAQyTlOcSVijlINs+eiK85+SosPEEv7Fxd 8oBK07+cbrYR03jU9PREWW2n1R/sW1vihSey94bPNz1rEkiqTuQQvCbV/pphwWOsUR HTquMlF8zDU10yLDmixg4KhY+reClZyxOHPp9D85pRg/4e0TgeCXDdxEVTbUAbN/BL uUTzQafLyU5Im+LELXwwuizxaAm0DYAjBRKAjYTUp2h940q/MYbRnKEK0i5TyK9AY6 bT5zKR5TkZb6g== From: Arnd Bergmann To: netdev@vger.kernel.org, "David S. Miller" , Jakub Kicinski Cc: Arnd Bergmann , dccp@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 2/5] dccp: avoid Wempty-body warning Date: Mon, 22 Mar 2021 11:43:32 +0100 Message-Id: <20210322104343.948660-2-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210322104343.948660-1-arnd@kernel.org> References: <20210322104343.948660-1-arnd@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Arnd Bergmann There are a couple of warnings in this driver when building with W=1: net/dccp/output.c: In function 'dccp_xmit_packet': net/dccp/output.c:283:71: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body] 283 | dccp_pr_debug("transmit_skb() returned err=%d\n", err); | ^ net/dccp/ackvec.c: In function 'dccp_ackvec_update_old': net/dccp/ackvec.c:163:80: error: suggest braces around empty body in an 'else' statement [-Werror=empty-body] 163 | (unsigned long long)seqno, state); | ^ Change the empty debug macros to no_printk(), which avoids the warnings and adds useful format string checks. Signed-off-by: Arnd Bergmann --- net/dccp/dccp.h | 6 +++--- net/dccp/proto.c | 2 -- 2 files changed, 3 insertions(+), 5 deletions(-) -- 2.29.2 diff --git a/net/dccp/dccp.h b/net/dccp/dccp.h index 9cc9d1ee6cdb..8a5163620bc3 100644 --- a/net/dccp/dccp.h +++ b/net/dccp/dccp.h @@ -41,9 +41,9 @@ extern bool dccp_debug; #define dccp_pr_debug_cat(format, a...) DCCP_PRINTK(dccp_debug, format, ##a) #define dccp_debug(fmt, a...) dccp_pr_debug_cat(KERN_DEBUG fmt, ##a) #else -#define dccp_pr_debug(format, a...) -#define dccp_pr_debug_cat(format, a...) -#define dccp_debug(format, a...) +#define dccp_pr_debug(format, a...) no_printk(format, ##a) +#define dccp_pr_debug_cat(format, a...) no_printk(format, ##a) +#define dccp_debug(format, a...) no_printk(format, ##a) #endif extern struct inet_hashinfo dccp_hashinfo; diff --git a/net/dccp/proto.c b/net/dccp/proto.c index 6d705d90c614..97a175eaf247 100644 --- a/net/dccp/proto.c +++ b/net/dccp/proto.c @@ -51,7 +51,6 @@ EXPORT_SYMBOL_GPL(dccp_hashinfo); /* the maximum queue length for tx in packets. 0 is no limit */ int sysctl_dccp_tx_qlen __read_mostly = 5; -#ifdef CONFIG_IP_DCCP_DEBUG static const char *dccp_state_name(const int state) { static const char *const dccp_state_names[] = { @@ -73,7 +72,6 @@ static const char *dccp_state_name(const int state) else return dccp_state_names[state]; } -#endif void dccp_set_state(struct sock *sk, const int state) {