From patchwork Mon Jun 11 06:05:24 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roland Dreier X-Patchwork-Id: 164068 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id CCBB8B7005 for ; Mon, 11 Jun 2012 16:05:32 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751320Ab2FKGFa (ORCPT ); Mon, 11 Jun 2012 02:05:30 -0400 Received: from na3sys010aog107.obsmtp.com ([74.125.245.82]:57289 "HELO na3sys010aog107.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1751144Ab2FKGF3 (ORCPT ); Mon, 11 Jun 2012 02:05:29 -0400 Received: from mail-pb0-f42.google.com ([209.85.160.42]) (using TLSv1) by na3sys010aob107.postini.com ([74.125.244.12]) with SMTP ID DSNKT9WKqQF2pJekTyElyDZZMVceVSL087Xf@postini.com; Sun, 10 Jun 2012 23:05:29 PDT Received: by pbbrp12 with SMTP id rp12so5468517pbb.29 for ; Sun, 10 Jun 2012 23:05:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=purestorage.com; s=google; h=sender:from:to:cc:subject:date:message-id:x-mailer; bh=TboOhINi0FHviMXnoqwpzjxIRMNZOy9IwBfBLdA+2oM=; b=dNzpAtCZ6mlhP7UcKUYn8D4SD1ypT1gqtTKMuRSSsuiR1MqeSrVozZgMtIURrfCDl6 KFRydkEhND49c2QxLFw2XQeqv47tGpS1ZKhRzxzteQ+ij35mQRNFGVBRfPQ8VZ/qHUeV 93WTqW3zHvKPiULI4YptuTnMdzZo64svUeS0k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=TboOhINi0FHviMXnoqwpzjxIRMNZOy9IwBfBLdA+2oM=; b=BN8EavQdigORoE1N4W0pEbwCN1/fuR/06s9H5gpJNmbs3EkHX72ZjXcgx0na4t1lhI hqJ4f/Wkcz73rt7BiRbULqbIaXuJGd15b2LKxyziWnmTYKqVpB7vwTn5ictdBaXWZiou RIICFu2JKuF9nJI8H1tr5haFj6VKmAt/c9PiUmDEiVsvJdh5az4PxQFDo/y8bk6YS7l/ CIiARyS9iZU6qLNb+rvZtcJxDEFJ1SAtrGQEvGMJYiBOrzkV9cPTW/kfO1hm/tQHR2ll SmN6biWWnz0LPBI/u6pbVCFZvz7pDbE1zI3oDn+Jju2HAHbUAO3w1JN9uRAtRjOxNigE qXYg== Received: by 10.68.221.74 with SMTP id qc10mr23105433pbc.31.1339394728544; Sun, 10 Jun 2012 23:05:28 -0700 (PDT) Received: from roland-t410s.home.digitalvampire.org (c-69-181-166-205.hsd1.ca.comcast.net. [69.181.166.205]) by mx.google.com with ESMTPS id pj5sm17321109pbb.51.2012.06.10.23.05.27 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 10 Jun 2012 23:05:28 -0700 (PDT) From: Roland Dreier To: "David S. Miller" Cc: netdev@vger.kernel.org, Roland Dreier Subject: [PATCH] net: Reorder initialization in ip_route_output to fix gcc warning Date: Sun, 10 Jun 2012 23:05:24 -0700 Message-Id: <1339394724-28296-1-git-send-email-roland@kernel.org> X-Mailer: git-send-email 1.7.9.5 X-Gm-Message-State: ALoCoQlgmVvwH4sdk6Rk2hIqfZW9asauk2DZ1WyqtIOfTbE+2pIvFSp1RJQp+DsZ2LA633qmjvsk Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Roland Dreier If I build with W=1, for every file that includes , I get the warning include/net/route.h: In function 'ip_route_output': include/net/route.h:135:3: warning: initialized field overwritten [-Woverride-init] include/net/route.h:135:3: warning: (near initialization for 'fl4') [-Woverride-init] (This is with "gcc (Debian 4.6.3-1) 4.6.3") A fix seems pretty trivial: move the initialization of .flowi4_tos earlier. As far as I can tell, this has no effect on code generation. Signed-off-by: Roland Dreier --- include/net/route.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/net/route.h b/include/net/route.h index ed2b78e..9870546 100644 --- a/include/net/route.h +++ b/include/net/route.h @@ -130,9 +130,9 @@ static inline struct rtable *ip_route_output(struct net *net, __be32 daddr, { struct flowi4 fl4 = { .flowi4_oif = oif, + .flowi4_tos = tos, .daddr = daddr, .saddr = saddr, - .flowi4_tos = tos, }; return ip_route_output_key(net, &fl4); }