From patchwork Wed Jun 5 04:24:12 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 248897 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 E6A8E2C0087 for ; Wed, 5 Jun 2013 14:25:00 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751323Ab3FEEYs (ORCPT ); Wed, 5 Jun 2013 00:24:48 -0400 Received: from mail-pb0-f50.google.com ([209.85.160.50]:51670 "EHLO mail-pb0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751117Ab3FEEYb (ORCPT ); Wed, 5 Jun 2013 00:24:31 -0400 Received: by mail-pb0-f50.google.com with SMTP id wy17so1213810pbc.37 for ; Tue, 04 Jun 2013 21:24:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=sPDP4kmXB1YT9VUfmNYfgWOslP1Ckez/QJC9bOcekaU=; b=F7hsn1VdjPIATnX8hZa3zBpPNTKxR1LFeg+hPVz5mMTAzNrCJQwzz6lqrw68caPM3X ezQkkRmqi4mKazSTBRHvEDE5ewBCqfSF7buroXphMr3Nfqys424kEoCCLnbkzKbQkVZ6 DP7PwYqz971xSdqVUJ3pnbBaGFNtdfJjv0Zh/cmgTCzWS1yALeyMCIGpoAk/wet0Qzft kF8Y2MeaRjQCky5TAa7Qog1uzTBGkcaumNv5BZz/AzrFfjDQSFvYiNKyXoaUpC6JT0fI RGvWvkz29coO2IdhdIEDxSBJ1jsRqHLFmb3ehoLq1uSSvJLYn/mlbxY0eXWxflNdrql4 GaBQ== X-Received: by 10.66.27.172 with SMTP id u12mr9223482pag.209.1370406270117; Tue, 04 Jun 2013 21:24:30 -0700 (PDT) Received: from nehalam.home.lan (static-50-53-71-109.bvtn.or.frontiernet.net. [50.53.71.109]) by mx.google.com with ESMTPSA id qp4sm66024444pbc.41.2013.06.04.21.24.28 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 04 Jun 2013 21:24:29 -0700 (PDT) From: Stephen Hemminger To: davem@davemloft.net Cc: netdev@vger.kernel.org, Stephen Hemminger Subject: [PATCH net-next 08/10] vxlan: use initializer for dummy structures Date: Tue, 4 Jun 2013 21:24:12 -0700 Message-Id: <1370406254-6341-8-git-send-email-stephen@networkplumber.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1370406254-6341-1-git-send-email-stephen@networkplumber.org> References: <1370406254-6341-1-git-send-email-stephen@networkplumber.org> X-Gm-Message-State: ALoCoQl+3dEpdUG3/3ryWhiTtly/r3UnLOF068/OwnERRfvApw7IaqlzEmyiKi5+95+eFPw2KH6F Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org For the notification code, a couple of places build fdb entries on the stack, use structure initialization instead and fix formatting. Signed-off-by: Stephen Hemminger --- drivers/net/vxlan.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index 57b5274..664381a 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c @@ -305,14 +305,13 @@ errout: static void vxlan_ip_miss(struct net_device *dev, __be32 ipa) { struct vxlan_dev *vxlan = netdev_priv(dev); - struct vxlan_fdb f; - struct vxlan_rdst remote; - - memset(&f, 0, sizeof f); - f.state = NUD_STALE; - - remote.remote_ip = ipa; /* goes to NDA_DST */ - remote.remote_vni = VXLAN_N_VID; + struct vxlan_fdb f = { + .state = NUD_STALE, + }; + struct vxlan_rdst remote = { + .remote_ip = ipa, /* goes to NDA_DST */ + .remote_vni = VXLAN_N_VID, + }; INIT_LIST_HEAD(&f.remotes); list_add_rcu(&remote.list, &f.remotes); @@ -322,11 +321,11 @@ static void vxlan_ip_miss(struct net_device *dev, __be32 ipa) static void vxlan_fdb_miss(struct vxlan_dev *vxlan, const u8 eth_addr[ETH_ALEN]) { - struct vxlan_fdb f; + struct vxlan_fdb f = { + .state = NUD_STALE, + }; - memset(&f, 0, sizeof f); INIT_LIST_HEAD(&f.remotes); - f.state = NUD_STALE; memcpy(f.eth_addr, eth_addr, ETH_ALEN); vxlan_fdb_notify(vxlan, &f, RTM_GETNEIGH);