linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mfd: rtsx: make arrays depth and cd_mask static const
@ 2017-06-30  9:33 Colin King
  2017-07-17 10:46 ` Lee Jones
  0 siblings, 1 reply; 3+ messages in thread
From: Colin King @ 2017-06-30  9:33 UTC (permalink / raw)
  To: Lee Jones; +Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Don't populate the arrays depath and cd_mask on the stack but make
them static const.  Makes the object code smaller:

   text    data     bss     dec     hex filename
  25413    7216     448   33077    8135 drivers/mfd/rtsx_pcr.o

   text    data     bss     dec     hex filename
  25151    7360     448   32959    80bf drivers/mfd/rtsx_pcr.o

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/mfd/rtsx_pcr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mfd/rtsx_pcr.c b/drivers/mfd/rtsx_pcr.c
index a0ac89dfdf0f..3cf69e5c5703 100644
--- a/drivers/mfd/rtsx_pcr.c
+++ b/drivers/mfd/rtsx_pcr.c
@@ -644,7 +644,7 @@ int rtsx_pci_switch_clock(struct rtsx_pcr *pcr, unsigned int card_clock,
 {
 	int err, clk;
 	u8 n, clk_divider, mcu_cnt, div;
-	u8 depth[] = {
+	static const u8 depth[] = {
 		[RTSX_SSC_DEPTH_4M] = SSC_DEPTH_4M,
 		[RTSX_SSC_DEPTH_2M] = SSC_DEPTH_2M,
 		[RTSX_SSC_DEPTH_1M] = SSC_DEPTH_1M,
@@ -768,7 +768,7 @@ EXPORT_SYMBOL_GPL(rtsx_pci_card_power_off);
 
 int rtsx_pci_card_exclusive_check(struct rtsx_pcr *pcr, int card)
 {
-	unsigned int cd_mask[] = {
+	static const unsigned int cd_mask[] = {
 		[RTSX_SD_CARD] = SD_EXIST,
 		[RTSX_MS_CARD] = MS_EXIST
 	};
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] mfd: rtsx: make arrays depth and cd_mask static const
  2017-06-30  9:33 [PATCH] mfd: rtsx: make arrays depth and cd_mask static const Colin King
@ 2017-07-17 10:46 ` Lee Jones
  2017-07-17 10:50   ` Colin Ian King
  0 siblings, 1 reply; 3+ messages in thread
From: Lee Jones @ 2017-07-17 10:46 UTC (permalink / raw)
  To: Colin King; +Cc: kernel-janitors, linux-kernel

Please start the commit subject description with an uppercase char.

> From: Colin Ian King <colin.king@canonical.com>

This is odd.  How are you sending this patch Colin?

> Don't populate the arrays depath and cd_mask on the stack but make
> them static const.  Makes the object code smaller:
> 
>    text    data     bss     dec     hex filename
>   25413    7216     448   33077    8135 drivers/mfd/rtsx_pcr.o
> 
>    text    data     bss     dec     hex filename
>   25151    7360     448   32959    80bf drivers/mfd/rtsx_pcr.o
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  drivers/mfd/rtsx_pcr.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

I'll fix the $SUBJECT line.

Applied, thanks.

> diff --git a/drivers/mfd/rtsx_pcr.c b/drivers/mfd/rtsx_pcr.c
> index a0ac89dfdf0f..3cf69e5c5703 100644
> --- a/drivers/mfd/rtsx_pcr.c
> +++ b/drivers/mfd/rtsx_pcr.c
> @@ -644,7 +644,7 @@ int rtsx_pci_switch_clock(struct rtsx_pcr *pcr, unsigned int card_clock,
>  {
>  	int err, clk;
>  	u8 n, clk_divider, mcu_cnt, div;
> -	u8 depth[] = {
> +	static const u8 depth[] = {
>  		[RTSX_SSC_DEPTH_4M] = SSC_DEPTH_4M,
>  		[RTSX_SSC_DEPTH_2M] = SSC_DEPTH_2M,
>  		[RTSX_SSC_DEPTH_1M] = SSC_DEPTH_1M,
> @@ -768,7 +768,7 @@ EXPORT_SYMBOL_GPL(rtsx_pci_card_power_off);
>  
>  int rtsx_pci_card_exclusive_check(struct rtsx_pcr *pcr, int card)
>  {
> -	unsigned int cd_mask[] = {
> +	static const unsigned int cd_mask[] = {
>  		[RTSX_SD_CARD] = SD_EXIST,
>  		[RTSX_MS_CARD] = MS_EXIST
>  	};

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mfd: rtsx: make arrays depth and cd_mask static const
  2017-07-17 10:46 ` Lee Jones
@ 2017-07-17 10:50   ` Colin Ian King
  0 siblings, 0 replies; 3+ messages in thread
From: Colin Ian King @ 2017-07-17 10:50 UTC (permalink / raw)
  To: Lee Jones; +Cc: kernel-janitors, linux-kernel

On 17/07/17 11:46, Lee Jones wrote:
> Please start the commit subject description with an uppercase char.
> 
>> From: Colin Ian King <colin.king@canonical.com>
> 
> This is odd.  How are you sending this patch Colin?

git send-patch. Hrm. I'll check it out for next time.

Colin

> 
>> Don't populate the arrays depath and cd_mask on the stack but make
>> them static const.  Makes the object code smaller:
>>
>>    text    data     bss     dec     hex filename
>>   25413    7216     448   33077    8135 drivers/mfd/rtsx_pcr.o
>>
>>    text    data     bss     dec     hex filename
>>   25151    7360     448   32959    80bf drivers/mfd/rtsx_pcr.o
>>
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
>> ---
>>  drivers/mfd/rtsx_pcr.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> I'll fix the $SUBJECT line.
> 
> Applied, thanks.
> 
>> diff --git a/drivers/mfd/rtsx_pcr.c b/drivers/mfd/rtsx_pcr.c
>> index a0ac89dfdf0f..3cf69e5c5703 100644
>> --- a/drivers/mfd/rtsx_pcr.c
>> +++ b/drivers/mfd/rtsx_pcr.c
>> @@ -644,7 +644,7 @@ int rtsx_pci_switch_clock(struct rtsx_pcr *pcr, unsigned int card_clock,
>>  {
>>  	int err, clk;
>>  	u8 n, clk_divider, mcu_cnt, div;
>> -	u8 depth[] = {
>> +	static const u8 depth[] = {
>>  		[RTSX_SSC_DEPTH_4M] = SSC_DEPTH_4M,
>>  		[RTSX_SSC_DEPTH_2M] = SSC_DEPTH_2M,
>>  		[RTSX_SSC_DEPTH_1M] = SSC_DEPTH_1M,
>> @@ -768,7 +768,7 @@ EXPORT_SYMBOL_GPL(rtsx_pci_card_power_off);
>>  
>>  int rtsx_pci_card_exclusive_check(struct rtsx_pcr *pcr, int card)
>>  {
>> -	unsigned int cd_mask[] = {
>> +	static const unsigned int cd_mask[] = {
>>  		[RTSX_SD_CARD] = SD_EXIST,
>>  		[RTSX_MS_CARD] = MS_EXIST
>>  	};
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-07-17 10:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-30  9:33 [PATCH] mfd: rtsx: make arrays depth and cd_mask static const Colin King
2017-07-17 10:46 ` Lee Jones
2017-07-17 10:50   ` Colin Ian King

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).