From patchwork Fri Oct 5 14:55:22 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 12012 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id EFFC223E57 for ; Fri, 5 Oct 2012 14:56:06 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id B7E55A1909A for ; Fri, 5 Oct 2012 14:56:06 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so3893275iej.11 for ; Fri, 05 Oct 2012 07:56:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-provags-id:x-gm-message-state; bh=XMeRUfrJZiLON+n/VCNtYYm5ogbf7LsbKVEcMI3jGQs=; b=DeFwKSYgKsEN3dYM29TXF1zRyKFUcyWgRj8tSGKNUPVTMOYjVx1cs7rHZVNrUOzued 2i+PF4kPZViosHzHZONG2aC5fyHAM45jI+75TjfTxIzgelk6fn/gGXd0sNpZbvLcZQEs 4cPUyJOGXYv7tZOpyvHA8YMAXEc6SDg8Tu2DhUI+IWvK85UavjVjm9qYuEcCSkftJx9H KjXix0eZEIjOtTq6T3mWKy5HJiA7jfdadH3uuAf6yaBwdq5Pup5l31RJtIIjB8uWh1XT TLTjeOtn7Be07VAD7xQUoVtlMbfDXSd/1AF7CH6nTwyTz+5E8Ba+GLTUXQ1VN74kAGW2 /7ew== Received: by 10.50.194.136 with SMTP id hw8mr1399536igc.28.1349448965306; Fri, 05 Oct 2012 07:56:05 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.184.232 with SMTP id ex8csp130624igc; Fri, 5 Oct 2012 07:56:04 -0700 (PDT) Received: by 10.14.211.3 with SMTP id v3mr13409537eeo.43.1349448964020; Fri, 05 Oct 2012 07:56:04 -0700 (PDT) Received: from moutng.kundenserver.de (moutng.kundenserver.de. [212.227.126.187]) by mx.google.com with ESMTPS id p48si1932352eem.118.2012.10.05.07.56.03 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 05 Oct 2012 07:56:04 -0700 (PDT) Received-SPF: neutral (google.com: 212.227.126.187 is neither permitted nor denied by best guess record for domain of arnd@arndb.de) client-ip=212.227.126.187; Authentication-Results: mx.google.com; spf=neutral (google.com: 212.227.126.187 is neither permitted nor denied by best guess record for domain of arnd@arndb.de) smtp.mail=arnd@arndb.de Received: from klappe2.boeblingen.de.ibm.com (deibp9eh1--blueice3n2.emea.ibm.com [195.212.29.180]) by mrelayeu.kundenserver.de (node=mreu3) with ESMTP (Nemesis) id 0MFVyq-1TEarQ1k28-00ELUe; Fri, 05 Oct 2012 16:55:48 +0200 From: Arnd Bergmann To: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, arm@kernel.org, Arnd Bergmann , "David S. Miller" , netdev@vger.kernel.org, Simon Horman , Julian Anastasov , netfilter-devel@vger.kernel.org, netfilter@vger.kernel.org, coreteam@netfilter.org Subject: [PATCH 08/16] ipvs: fix ip_vs_set_timeout debug messages Date: Fri, 5 Oct 2012 16:55:22 +0200 Message-Id: <1349448930-23976-9-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1349448930-23976-1-git-send-email-arnd@arndb.de> References: <1349448930-23976-1-git-send-email-arnd@arndb.de> X-Provags-ID: V02:K0:15PWLEmIEoMWV8roWyUOu+kbM8WPb8gdE6moE2RrSEZ wpH81CFYKbfC0Wnn9ylbDjzA4r65FSacFpRIX/cZH+dLELvJSl 82rirP0W0OBlJoCIoDbvZJJUOBLb2/DnjIk/26EbNwFIhyyJVx ccXHwh2u/avZanxfR+IGNmtJHT6iXL7nKXMzn3dJwI3XE8zrLl ctUKcC5whjeCJ71S8RKxNxLfWig9k285U5x1RI1Rnf7AafBzvY 6FpgRTl0AkayYrmIvvuif35/EWVRL+UxKdDfNGAxIzwYvEhg2t SUXe7eBgpJUxpu45Gl8oUhnBmR+yYkI6WGH09K37/8wfXGulCE XPsihERSsaCUNDJCSJFSrsOeYmtH4a9+uPYM/TUKWdiUsoQrPa AllfrULIukg3yWXqs1I7A5V0iD/MM3Vv4Y= X-Gm-Message-State: ALoCoQkb7U0fMGRZptMpi1YNk1iOdW76VXrqjX9V5d6bHB9GG6UBd86np2aWp9egy6rFGfud2pOc The ip_vs_set_timeout function sets timeouts for TCP and UDP, which can be enabled independently at compile time. The debug message always prints both timeouts that are passed into the function, but if one is disabled, the message will show uninitialized data. This splits the debug message into two separte IP_VS_DBG statements that are in the same #ifdef section to ensure we only print the text about what is actually going on. Without this patch, building ARM ixp4xx_defconfig results in: net/netfilter/ipvs/ip_vs_ctl.c: In function 'ip_vs_genl_set_cmd': net/netfilter/ipvs/ip_vs_ctl.c:2238:47: warning: 't.udp_timeout' may be used uninitialized in this function [-Wuninitialized] net/netfilter/ipvs/ip_vs_ctl.c:3322:28: note: 't.udp_timeout' was declared here net/netfilter/ipvs/ip_vs_ctl.c:2238:47: warning: 't.tcp_fin_timeout' may be used uninitialized in this function [-Wuninitialized] net/netfilter/ipvs/ip_vs_ctl.c:3322:28: note: 't.tcp_fin_timeout' was declared here net/netfilter/ipvs/ip_vs_ctl.c:2238:47: warning: 't.tcp_timeout' may be used uninitialized in this function [-Wuninitialized] net/netfilter/ipvs/ip_vs_ctl.c:3322:28: note: 't.tcp_timeout' was declared here Signed-off-by: Arnd Bergmann Cc: David S. Miller Cc: netdev@vger.kernel.org Cc: Simon Horman Cc: Julian Anastasov Cc: netfilter-devel@vger.kernel.org Cc: netfilter@vger.kernel.org Cc: coreteam@netfilter.org --- net/netfilter/ipvs/ip_vs_ctl.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c index f51013c..f3a66c3 100644 --- a/net/netfilter/ipvs/ip_vs_ctl.c +++ b/net/netfilter/ipvs/ip_vs_ctl.c @@ -2237,12 +2237,11 @@ static int ip_vs_set_timeout(struct net *net, struct ip_vs_timeout_user *u) struct ip_vs_proto_data *pd; #endif - IP_VS_DBG(2, "Setting timeout tcp:%d tcpfin:%d udp:%d\n", +#ifdef CONFIG_IP_VS_PROTO_TCP + IP_VS_DBG(2, "Setting timeout tcp:%d tcpfin:%d\n", u->tcp_timeout, - u->tcp_fin_timeout, - u->udp_timeout); + u->tcp_fin_timeout); -#ifdef CONFIG_IP_VS_PROTO_TCP if (u->tcp_timeout) { pd = ip_vs_proto_data_get(net, IPPROTO_TCP); pd->timeout_table[IP_VS_TCP_S_ESTABLISHED] @@ -2257,6 +2256,9 @@ static int ip_vs_set_timeout(struct net *net, struct ip_vs_timeout_user *u) #endif #ifdef CONFIG_IP_VS_PROTO_UDP + IP_VS_DBG(2, "Setting timeout udp:%d\n", + u->udp_timeout); + if (u->udp_timeout) { pd = ip_vs_proto_data_get(net, IPPROTO_UDP); pd->timeout_table[IP_VS_UDP_S_NORMAL]