Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp847963ybe; Fri, 6 Sep 2019 08:11:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqxP9xhHKEM1iue9W2U4YSOFvOIC/t4WFg4SrShBmCLth+CN+uHtlZB63gRNrEUgn899tUhE X-Received: by 2002:a63:4612:: with SMTP id t18mr8414838pga.85.1567782710250; Fri, 06 Sep 2019 08:11:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567782710; cv=none; d=google.com; s=arc-20160816; b=Se3xL7D3aZPZFgeEEAOgaC6CW6gNVNFt6rwwQ8pHxrOWRJjqVeWMju7hEI797kPx4S pEhCiFLP/NP5rz6uP3mAfX1eK8ZXE3ownIAIhBJLDIM/c4vJ2yIcIELsn5kIcWDgfYjD TPWOstnYLZPhcGud+kYsU6Bn3dDF7kaJnaifQPvK4N0l2ntyt57XEEwwbz/Aw6cVUfP/ +DU0xYD44IZDfauzbvJds3wHKrRNO4gjjTk9VqK1dB4snVVzJ0wx/Pv/o+iyLGYzuFyk VlZoUiwEVhQu46FPqvvkyutiQOeAk3OHByP2iURCmPz3ZheHx8txSHg4jnLWxqtsOGWh xHcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=bU8NcpcD0eB7Cbke5+/WhVrdfRbaz+tLs8w+dzm17wQ=; b=ykrS4Ftw86wnFrHlTCNz8pYTimcZxsccDPDU/HMXCxwaVUx0he32v0WHYwt25gK+8q /sy/zOjLLOWlmSjwN67Mff0Qa2XY4iHkFqXYA5v1yQp5hEnS3KTr7o55AjIjalSfVBok tcJVjXi8MGL2iveVWWbA+5SpN1dgNJzucZMclZSWEMlJ0tH9HXKObMAmEIuA22WYCZ0D Ow1WriXotlgRERPTY6l7YDQtNmGxlImIAjCsrsYmT7z/2A/UJ+HyIgF0p+QtckrB7XYB TUCwp+Ze8dlqwqxonw4g51YRcS9XviBMXge+q4SF2wlKqj902+jGjicxqZ8cVXaWzUK1 T/xQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 72si5255971ple.381.2019.09.06.08.11.28; Fri, 06 Sep 2019 08:11:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389525AbfIFLeD (ORCPT + 99 others); Fri, 6 Sep 2019 07:34:03 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:38045 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388752AbfIFLeD (ORCPT ); Fri, 6 Sep 2019 07:34:03 -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 1i6CV2-0006NC-VZ; Fri, 06 Sep 2019 11:33:57 +0000 From: Colin King To: gJeff Kirsher , "David S . Miller" , intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] net/ixgbevf: make array api static const, makes object smaller Date: Fri, 6 Sep 2019 12:33:56 +0100 Message-Id: <20190906113356.9985-1-colin.king@canonical.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Colin Ian King Don't populate the array api on the stack but instead make it static const. Makes the object code smaller by 58 bytes. Before: text data bss dec hex filename 82969 9763 256 92988 16b3c ixgbevf/ixgbevf_main.o After: text data bss dec hex filename 82815 9859 256 92930 16b02 ixgbevf/ixgbevf_main.o (gcc version 9.2.1, amd64) Signed-off-by: Colin Ian King --- drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c index 8c011d4ce7a9..46c8e2501084 100644 --- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c @@ -2261,12 +2261,14 @@ static void ixgbevf_init_last_counter_stats(struct ixgbevf_adapter *adapter) static void ixgbevf_negotiate_api(struct ixgbevf_adapter *adapter) { struct ixgbe_hw *hw = &adapter->hw; - int api[] = { ixgbe_mbox_api_14, - ixgbe_mbox_api_13, - ixgbe_mbox_api_12, - ixgbe_mbox_api_11, - ixgbe_mbox_api_10, - ixgbe_mbox_api_unknown }; + static const int api[] = { + ixgbe_mbox_api_14, + ixgbe_mbox_api_13, + ixgbe_mbox_api_12, + ixgbe_mbox_api_11, + ixgbe_mbox_api_10, + ixgbe_mbox_api_unknown + }; int err, idx = 0; spin_lock_bh(&adapter->mbx_lock); -- 2.20.1