From: Tariq Toukan <ttoukan.linux@gmail.com>
To: Colin King <colin.king@canonical.com>,
Tariq Toukan <tariqt@nvidia.com>,
"David S . Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
netdev@vger.kernel.org, linux-rdma@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net/mlx4: make the array states static const, makes object smaller
Date: Mon, 2 Aug 2021 13:39:42 +0300 [thread overview]
Message-ID: <6a85a949-22ab-2934-da15-ff5f6c84bb52@gmail.com> (raw)
In-Reply-To: <20210801153742.147304-1-colin.king@canonical.com>
On 8/1/2021 6:37 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> 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 <colin.king@canonical.com>
> ---
> 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,
>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Thanks for your patch.
Regards,
Tariq
next prev parent reply other threads:[~2021-08-02 10:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-01 15:37 [PATCH] net/mlx4: make the array states static const, makes object smaller Colin King
2021-08-02 8:44 ` Leon Romanovsky
2021-08-02 10:39 ` Tariq Toukan [this message]
2021-08-02 22:10 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6a85a949-22ab-2934-da15-ff5f6c84bb52@gmail.com \
--to=ttoukan.linux@gmail.com \
--cc=colin.king@canonical.com \
--cc=davem@davemloft.net \
--cc=kernel-janitors@vger.kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=tariqt@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).