Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp989068pxy; Sun, 1 Aug 2021 08:39:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwFHz0S3KdQLt6Zq6pab548PdNtQ9gm8JRxzeo3luB7YX7fysttfFas3m3u9tuOPpOLEdme X-Received: by 2002:a92:c805:: with SMTP id v5mr5548169iln.293.1627832384860; Sun, 01 Aug 2021 08:39:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627832384; cv=none; d=google.com; s=arc-20160816; b=CPk5rGBl3a2Ew1HF2gkGbLWoVO9BME0B8KouxVGUxIuFdIhMiILlOGR+uqq+bUrYVo 7YKvd0qfVwkJN5yHT8bn1OoNyDeWHXRMllZdNUOU6Elk2fyM5lzDx37taktXSPtr4S8H 6IYI6YtKHtfeM2eqD8rBbRPIB8GYxNNCOfp3seWl5TwqbhTmC5Vd7JKhNz1nDdQMhgGf gKGWoCpdD5kqP5VtGn5VTbYA6oEG8TTYjMR7bPv1lsRtRuqMoX1eIicm9asCK8evqmVz 8OodDQQGdet9ii2qZntebKFK8jEQBVkfS65Nai0E+xdtLh1olxTOe2Se1qbcN+GAKB6Z 5FpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=iLN8TLgdbvtmYaSUrV7g9uz/p2+EVNuytQVWi86ahzk=; b=D0SfR3drJce1npy+IjcOFkRRrh8lBpzI8WliUGeU2Vfis9H8IHTfEyQdWwib9SbED4 sCREqVaVzS9SVjX6Av9Xw7dtGSmHWGu0xU+6m4yKzRZiv+oVVOZQ+AY+FWX2Qga3exDY bA4roQhto77W97kggYKuBDA/+jmZBMnixDp1bYq6IYXJagphVDWvyC94nxUYvLePoxji 5cs0qnAiHXOTXbvymr5WShSM5Q7mk4r5iApMUxLL3OE2bNFdkHtFXm/Ruz/Aewnhmx9D qC28sx8EdtOA7MoyRwOJ9jJow8bPl7u+aNAfytRKafyO5WgFk/w+iS6sRE4+q6RcFeeQ umzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=t8Fam8VC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v18si9060886ilo.15.2021.08.01.08.39.32; Sun, 01 Aug 2021 08:39:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=t8Fam8VC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232292AbhHAPhz (ORCPT + 99 others); Sun, 1 Aug 2021 11:37:55 -0400 Received: from smtp-relay-canonical-0.canonical.com ([185.125.188.120]:34980 "EHLO smtp-relay-canonical-0.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232117AbhHAPhy (ORCPT ); Sun, 1 Aug 2021 11:37:54 -0400 Received: from localhost (1.general.cking.uk.vpn [10.172.193.212]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-0.canonical.com (Postfix) with ESMTPSA id 5EE3A3F0A6; Sun, 1 Aug 2021 15:37:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1627832265; bh=iLN8TLgdbvtmYaSUrV7g9uz/p2+EVNuytQVWi86ahzk=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Content-Type; b=t8Fam8VC535Ic8aJxhQoRDVyQCzWKu3d4lIVBZ/POU19Bi0STVDy2y8lyutq5WdAD 8Q8BHNSVEF63yv55++n7UOgmygzQcvouHNFDq28M8b6dhJgk9Zt+R99ewDHavGOyqR Yu8khXUp6YYRbol1kJNsKAu+zPIr6CC/eteiCc7haB7MENS2p3FX1Dq3w15jqh45Lk 8AsVEzReRJNwxQg+GTFkqgqxtm7VvntT8dWYubiW/4wxyZOtjPDI3Wuh9G2l8VXKxe Zxc3TObvjpl9iTgua6GC5RSg/vrTUYjAxJbdKnqHQUo/SBRlVWzLIdFpwUhjWzps1F pVBGXzRqmML8w== From: Colin King To: Tariq Toukan , "David S . Miller" , Jakub Kicinski , netdev@vger.kernel.org, linux-rdma@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] net/mlx4: make the array states static const, makes object smaller Date: Sun, 1 Aug 2021 16:37:42 +0100 Message-Id: <20210801153742.147304-1-colin.king@canonical.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Colin Ian King Don't populate the array states on the stack but instead it static const. Makes the object code smaller by 79 bytes. Before: text data bss dec hex filename 21309 8304 192 29805 746d drivers/net/ethernet/mellanox/mlx4/qp.o After: text data bss dec hex filename 21166 8368 192 29726 741e drivers/net/ethernet/mellanox/mlx4/qp.o (gcc version 10.2.0) Signed-off-by: Colin Ian King --- drivers/net/ethernet/mellanox/mlx4/qp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx4/qp.c b/drivers/net/ethernet/mellanox/mlx4/qp.c index 427e7a31862c..2584bc038f94 100644 --- a/drivers/net/ethernet/mellanox/mlx4/qp.c +++ b/drivers/net/ethernet/mellanox/mlx4/qp.c @@ -917,7 +917,7 @@ int mlx4_qp_to_ready(struct mlx4_dev *dev, struct mlx4_mtt *mtt, { int err; int i; - enum mlx4_qp_state states[] = { + static const enum mlx4_qp_state states[] = { MLX4_QP_STATE_RST, MLX4_QP_STATE_INIT, MLX4_QP_STATE_RTR, -- 2.31.1