lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 3 Aug 2021 16:15:54 +0100
From:   Colin Ian King <colin.king@...onical.com>
To:     Joe Perches <joe@...ches.com>, Ping-Ke Shih <pkshih@...ltek.com>,
        Kalle Valo <kvalo@...eaurora.org>,
        "David S . Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        linux-wireless@...r.kernel.org, netdev@...r.kernel.org
Cc:     kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/3][V2] rtlwifi: rtl8192de: make arrays static const,
 makes object smaller

On 03/08/2021 16:09, Joe Perches wrote:
> On Tue, 2021-08-03 at 15:49 +0100, Colin King wrote:
>> Don't populate arrays the stack but instead make them static const. Replace
>> array channel_info with channel_all since it contains the same data as
>> channel_all. Makes object code smaller by 961 bytes.
> []
>> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c
> []
>> @@ -160,6 +160,15 @@ static u32 targetchnl_2g[TARGET_CHNL_NUM_2G] = {
>>  	25711, 25658, 25606, 25554, 25502, 25451, 25328
>>  };
>>
>> +static const u8 channel_all[59] = {
> 
> I don't believe there is a significant value in sizing the array
> as 59 instead of letting the compiler count the elements.

I was reluctant to remove this as I supposed the original had it in for
a purpose, e.g. to ensure that the array was not populated with more
data than intended. Does it make much of a difference?

> 
>> +	1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
>> +	36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58,
>> +	60, 62, 64, 100, 102, 104, 106, 108, 110, 112,
>> +	114, 116, 118, 120, 122, 124, 126, 128,	130,
>> +	132, 134, 136, 138, 140, 149, 151, 153, 155,
>> +	157, 159, 161, 163, 165
>> +};
> 
> 

Powered by blists - more mailing lists