From patchwork Fri Dec 2 10:39:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phil Sutter X-Patchwork-Id: 701911 X-Patchwork-Delegate: shemminger@vyatta.com 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 3tVW0f5Y2tz9t9x for ; Fri, 2 Dec 2016 21:41:22 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934211AbcLBKlM (ORCPT ); Fri, 2 Dec 2016 05:41:12 -0500 Received: from orbyte.nwl.cc ([151.80.46.58]:57408 "EHLO mail.nwl.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933964AbcLBKlK (ORCPT ); Fri, 2 Dec 2016 05:41:10 -0500 Received: from mail.nwl.cc (orbyte.nwl.cc [127.0.0.1]) by mail.nwl.cc (Postfix) with ESMTP id 7FF1461BFF; Fri, 2 Dec 2016 11:41:09 +0100 (CET) Received: from xsao (localhost [IPv6:::1]) by mail.nwl.cc (Postfix) with ESMTP id 60A8661BFB; Fri, 2 Dec 2016 11:41:09 +0100 (CET) From: Phil Sutter To: Stephen Hemminger Cc: netdev@vger.kernel.org Subject: [iproute PATCH v2 15/18] ss: Make unix_state_map local to unix_show() Date: Fri, 2 Dec 2016 11:39:59 +0100 Message-Id: <20161202104002.17310-16-phil@nwl.cc> X-Mailer: git-send-email 2.10.0 In-Reply-To: <20161202104002.17310-1-phil@nwl.cc> References: <20161202104002.17310-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 Also make it const, since there won't be any write access happening. Signed-off-by: Phil Sutter --- misc/ss.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/misc/ss.c b/misc/ss.c index c7818eadf9e75..e82c416b5fa72 100644 --- a/misc/ss.c +++ b/misc/ss.c @@ -2914,9 +2914,6 @@ outerr: } while (0); } -int unix_state_map[] = { SS_CLOSE, SS_SYN_SENT, - SS_ESTABLISHED, SS_CLOSING }; - #define MAX_UNIX_REMEMBER (1024*1024/sizeof(struct sockstat)) static void unix_list_drop_first(struct sockstat **list) @@ -3058,6 +3055,8 @@ static int unix_show(struct filter *f) int newformat = 0; int cnt; struct sockstat *list = NULL; + const int unix_state_map[] = { SS_CLOSE, SS_SYN_SENT, + SS_ESTABLISHED, SS_CLOSING }; if (!filter_af_get(f, AF_UNIX)) return 0;