From: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
To: Colin King <colin.king@canonical.com>,
Alim Akhtar <alim.akhtar@samsung.com>,
Avri Altman <avri.altman@wdc.com>,
"James E . J . Bottomley" <jejb@linux.ibm.com>,
"Martin K . Petersen" <martin.petersen@oracle.com>,
linux-scsi@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-samsung-soc@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] scsi: ufs: ufs-exynos: make a const array static, makes object smaller
Date: Wed, 5 May 2021 15:41:36 -0400 [thread overview]
Message-ID: <0e90b057-3a87-bec5-c0b2-46c49b191651@canonical.com> (raw)
In-Reply-To: <20210505190104.70112-1-colin.king@canonical.com>
On 05/05/2021 15:01, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Don't populate the const array granularity_tbl on the stack but instead it
> static. Makes the object code smaller by 190 bytes:
>
> Before:
> text data bss dec hex filename
> 25563 6908 0 32471 7ed7 ./drivers/scsi/ufs/ufs-exynos.o
>
> After:
> text data bss dec hex filename
> 25213 7068 0 32281 7e19 ./drivers/scsi/ufs/ufs-exynos.o
>
> (gcc version 10.3.0)
I am not sure what's the benefit here - you moved the code from text to
data. In total you decreased the size for this compilation settings
(e.g. compiler + optimizations) but that might not be always true, right?
This has effect on the code readability - line is longer and reader
would think "why this was made static since it is simple one-time const?".
Best regards,
Krzysztof
next prev parent reply other threads:[~2021-05-05 19:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-05 19:01 [PATCH] scsi: ufs: ufs-exynos: make a const array static, makes object smaller Colin King
2021-05-05 19:41 ` Krzysztof Kozlowski [this message]
2021-05-05 19:49 ` Colin Ian King
2021-05-22 2:50 ` Martin K. Petersen
2021-05-26 4:07 ` Martin K. Petersen
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=0e90b057-3a87-bec5-c0b2-46c49b191651@canonical.com \
--to=krzysztof.kozlowski@canonical.com \
--cc=alim.akhtar@samsung.com \
--cc=avri.altman@wdc.com \
--cc=colin.king@canonical.com \
--cc=jejb@linux.ibm.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.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).