From patchwork Fri Sep 6 11:53:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin King X-Patchwork-Id: 11135049 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 26E4115E6 for ; Fri, 6 Sep 2019 11:53:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0F161206CD for ; Fri, 6 Sep 2019 11:53:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732341AbfIFLxw (ORCPT ); Fri, 6 Sep 2019 07:53:52 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:38883 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727381AbfIFLxw (ORCPT ); Fri, 6 Sep 2019 07:53:52 -0400 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1i6CoG-0007oJ-PY; Fri, 06 Sep 2019 11:53:48 +0000 From: Colin King To: Tariq Toukan , "David S . Miller" , netdev@vger.kernel.org, linux-rdma@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] net/mlx4_en: ethtool: make array modes static const, makes object smaller Date: Fri, 6 Sep 2019 12:53:48 +0100 Message-Id: <20190906115348.16621-1-colin.king@canonical.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Colin Ian King Don't populate the array modes on the stack but instead make it static const. Makes the object code smaller by 303 bytes. Before: text data bss dec hex filename 51240 5008 1312 57560 e0d8 mellanox/mlx4/en_ethtool.o After: text data bss dec hex filename 50937 5008 1312 57257 dfa9 mellanox/mlx4/en_ethtool.o (gcc version 9.2.1, amd64) Signed-off-by: Colin Ian King --- drivers/net/ethernet/mellanox/mlx4/en_ethtool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c index 94c59939a8cf..d8313e2ee600 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c @@ -639,7 +639,7 @@ static unsigned long *ptys2ethtool_link_mode(struct ptys2ethtool_config *cfg, #define MLX4_BUILD_PTYS2ETHTOOL_CONFIG(reg_, speed_, ...) \ ({ \ struct ptys2ethtool_config *cfg; \ - const unsigned int modes[] = { __VA_ARGS__ }; \ + static const unsigned int modes[] = { __VA_ARGS__ }; \ unsigned int i; \ cfg = &ptys2ethtool_map[reg_]; \ cfg->speed = speed_; \