* [PATCH] scsi: ufs: make array setup_attrs static const, makes object smaller
@ 2019-09-06 17:01 Colin King
2019-10-01 2:47 ` Martin K. Petersen
0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2019-09-06 17:01 UTC (permalink / raw)
To: Pedro Sousa, Alim Akhtar, Avri Altman, James E . J . Bottomley,
Martin K . Petersen, linux-scsi
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
Don't populate the array setup_attrs on the stack but instead make it
static const. Makes the object code smaller by 180 bytes.
Before:
text data bss dec hex filename
2140 224 0 2364 93c drivers/scsi/ufs/ufshcd-dwc.o
After:
text data bss dec hex filename
1863 320 0 2183 887 drivers/scsi/ufs/ufshcd-dwc.o
(gcc version 9.2.1, amd64)
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/scsi/ufs/ufshcd-dwc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/ufs/ufshcd-dwc.c b/drivers/scsi/ufs/ufshcd-dwc.c
index fb9e2ff4f8d2..6a901da2d15a 100644
--- a/drivers/scsi/ufs/ufshcd-dwc.c
+++ b/drivers/scsi/ufs/ufshcd-dwc.c
@@ -80,7 +80,7 @@ static int ufshcd_dwc_link_is_up(struct ufs_hba *hba)
*/
static int ufshcd_dwc_connection_setup(struct ufs_hba *hba)
{
- const struct ufshcd_dme_attr_val setup_attrs[] = {
+ static const struct ufshcd_dme_attr_val setup_attrs[] = {
{ UIC_ARG_MIB(T_CONNECTIONSTATE), 0, DME_LOCAL },
{ UIC_ARG_MIB(N_DEVICEID), 0, DME_LOCAL },
{ UIC_ARG_MIB(N_DEVICEID_VALID), 0, DME_LOCAL },
--
2.20.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] scsi: ufs: make array setup_attrs static const, makes object smaller
2019-09-06 17:01 [PATCH] scsi: ufs: make array setup_attrs static const, makes object smaller Colin King
@ 2019-10-01 2:47 ` Martin K. Petersen
0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2019-10-01 2:47 UTC (permalink / raw)
To: Colin King
Cc: Pedro Sousa, Alim Akhtar, Avri Altman, James E . J . Bottomley,
Martin K . Petersen, linux-scsi, kernel-janitors, linux-kernel
Colin,
> Don't populate the array setup_attrs on the stack but instead make it
> static const. Makes the object code smaller by 180 bytes.
Applied to 5.5/scsi-queue. Thanks!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-10-01 2:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-06 17:01 [PATCH] scsi: ufs: make array setup_attrs static const, makes object smaller Colin King
2019-10-01 2:47 ` Martin K. Petersen
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).