From patchwork Mon Aug 21 09:27:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phil Sutter X-Patchwork-Id: 803909 X-Patchwork-Delegate: shemminger@vyatta.com Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3xbSyH5tsKz9s7g for ; Mon, 21 Aug 2017 19:27:19 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752764AbdHUJ1R (ORCPT ); Mon, 21 Aug 2017 05:27:17 -0400 Received: from orbyte.nwl.cc ([151.80.46.58]:43135 "EHLO mail.nwl.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751894AbdHUJ1Q (ORCPT ); Mon, 21 Aug 2017 05:27:16 -0400 Received: from mail.nwl.cc (orbyte.nwl.cc [127.0.0.1]) by mail.nwl.cc (Postfix) with ESMTP id AD6C663862; Mon, 21 Aug 2017 11:27:15 +0200 (CEST) Received: from xsao (localhost [IPv6:::1]) by mail.nwl.cc (Postfix) with ESMTP id 90D7C63860; Mon, 21 Aug 2017 11:27:15 +0200 (CEST) From: Phil Sutter To: Stephen Hemminger Cc: netdev@vger.kernel.org Subject: [iproute PATCH v3 4/6] ss: Use C99 initializer in netlink_show_one() Date: Mon, 21 Aug 2017 11:27:02 +0200 Message-Id: <20170821092704.21614-5-phil@nwl.cc> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20170821092704.21614-1-phil@nwl.cc> References: <20170821092704.21614-1-phil@nwl.cc> X-Virus-Scanned: ClamAV using ClamSMTP Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This has the additional benefit of initializing st.ino to zero which is used later in is_sctp_assoc() function. Signed-off-by: Phil Sutter --- misc/ss.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/misc/ss.c b/misc/ss.c index 10360e5a04ff8..63d12871dd826 100644 --- a/misc/ss.c +++ b/misc/ss.c @@ -3480,17 +3480,18 @@ static int netlink_show_one(struct filter *f, int rq, int wq, unsigned long long sk, unsigned long long cb) { - struct sockstat st; + struct sockstat st = { + .state = SS_CLOSE, + .rq = rq, + .wq = wq, + .local.family = AF_NETLINK, + .remote.family = AF_NETLINK, + }; SPRINT_BUF(prot_buf) = {}; const char *prot_name; char procname[64] = {}; - st.state = SS_CLOSE; - st.rq = rq; - st.wq = wq; - st.local.family = st.remote.family = AF_NETLINK; - if (f->f) { st.rport = -1; st.lport = pid;