* [PATCH] igc: Make the const read-only array supported_sizes static
@ 2025-06-18 13:54 Colin Ian King
2025-06-18 16:29 ` [Intel-wired-lan] " Alexander Lobakin
2025-06-19 22:50 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 4+ messages in thread
From: Colin Ian King @ 2025-06-18 13:54 UTC (permalink / raw)
To: Tony Nguyen, Przemek Kitszel, Andrew Lunn, David S . Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, intel-wired-lan,
netdev
Cc: kernel-janitors, linux-kernel
Don't populate the const read-only array supported_sizes on the
stack at run time, instead make it static.
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
drivers/net/ethernet/intel/igc/igc_tsn.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/igc/igc_tsn.c b/drivers/net/ethernet/intel/igc/igc_tsn.c
index b23b9ca451a7..8a110145bfee 100644
--- a/drivers/net/ethernet/intel/igc/igc_tsn.c
+++ b/drivers/net/ethernet/intel/igc/igc_tsn.c
@@ -431,7 +431,7 @@ static u8 igc_fpe_get_frag_size_mult(const struct igc_fpe_t *fpe)
u32 igc_fpe_get_supported_frag_size(u32 frag_size)
{
- const u32 supported_sizes[] = {64, 128, 192, 256};
+ static const u32 supported_sizes[] = { 64, 128, 192, 256 };
/* Find the smallest supported size that is >= frag_size */
for (int i = 0; i < ARRAY_SIZE(supported_sizes); i++) {
--
2.49.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Intel-wired-lan] [PATCH] igc: Make the const read-only array supported_sizes static
2025-06-18 13:54 [PATCH] igc: Make the const read-only array supported_sizes static Colin Ian King
@ 2025-06-18 16:29 ` Alexander Lobakin
2025-06-19 13:01 ` Lifshits, Vitaly
2025-06-19 22:50 ` patchwork-bot+netdevbpf
1 sibling, 1 reply; 4+ messages in thread
From: Alexander Lobakin @ 2025-06-18 16:29 UTC (permalink / raw)
To: Colin Ian King
Cc: Tony Nguyen, Przemek Kitszel, Andrew Lunn, David S . Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, intel-wired-lan,
netdev, kernel-janitors, linux-kernel
From: Colin Ian King <colin.i.king@gmail.com>
Date: Wed, 18 Jun 2025 14:54:08 +0100
> Don't populate the const read-only array supported_sizes on the
> stack at run time, instead make it static.
>
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com>
> ---
> drivers/net/ethernet/intel/igc/igc_tsn.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/intel/igc/igc_tsn.c b/drivers/net/ethernet/intel/igc/igc_tsn.c
> index b23b9ca451a7..8a110145bfee 100644
> --- a/drivers/net/ethernet/intel/igc/igc_tsn.c
> +++ b/drivers/net/ethernet/intel/igc/igc_tsn.c
> @@ -431,7 +431,7 @@ static u8 igc_fpe_get_frag_size_mult(const struct igc_fpe_t *fpe)
>
> u32 igc_fpe_get_supported_frag_size(u32 frag_size)
> {
> - const u32 supported_sizes[] = {64, 128, 192, 256};
> + static const u32 supported_sizes[] = { 64, 128, 192, 256 };
>
> /* Find the smallest supported size that is >= frag_size */
> for (int i = 0; i < ARRAY_SIZE(supported_sizes); i++) {
Thanks,
Olek
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Intel-wired-lan] [PATCH] igc: Make the const read-only array supported_sizes static
2025-06-18 16:29 ` [Intel-wired-lan] " Alexander Lobakin
@ 2025-06-19 13:01 ` Lifshits, Vitaly
0 siblings, 0 replies; 4+ messages in thread
From: Lifshits, Vitaly @ 2025-06-19 13:01 UTC (permalink / raw)
To: Alexander Lobakin, Colin Ian King
Cc: Tony Nguyen, Przemek Kitszel, Andrew Lunn, David S . Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, intel-wired-lan,
netdev, kernel-janitors, linux-kernel
On 6/18/2025 7:29 PM, Alexander Lobakin wrote:
> From: Colin Ian King <colin.i.king@gmail.com>
> Date: Wed, 18 Jun 2025 14:54:08 +0100
>
>> Don't populate the const read-only array supported_sizes on the
>> stack at run time, instead make it static.
>>
>> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
>
> Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Reviewed-by: Vitaly Lifshits <vitaly.lifshits@intel.com>>
>> ---
>> drivers/net/ethernet/intel/igc/igc_tsn.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/ethernet/intel/igc/igc_tsn.c b/drivers/net/ethernet/intel/igc/igc_tsn.c
>> index b23b9ca451a7..8a110145bfee 100644
>> --- a/drivers/net/ethernet/intel/igc/igc_tsn.c
>> +++ b/drivers/net/ethernet/intel/igc/igc_tsn.c
>> @@ -431,7 +431,7 @@ static u8 igc_fpe_get_frag_size_mult(const struct igc_fpe_t *fpe)
>>
>> u32 igc_fpe_get_supported_frag_size(u32 frag_size)
>> {
>> - const u32 supported_sizes[] = {64, 128, 192, 256};
>> + static const u32 supported_sizes[] = { 64, 128, 192, 256 };
>>
>> /* Find the smallest supported size that is >= frag_size */
>> for (int i = 0; i < ARRAY_SIZE(supported_sizes); i++) {
>
> Thanks,
> Olek
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] igc: Make the const read-only array supported_sizes static
2025-06-18 13:54 [PATCH] igc: Make the const read-only array supported_sizes static Colin Ian King
2025-06-18 16:29 ` [Intel-wired-lan] " Alexander Lobakin
@ 2025-06-19 22:50 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-06-19 22:50 UTC (permalink / raw)
To: Colin Ian King
Cc: anthony.l.nguyen, przemyslaw.kitszel, andrew+netdev, davem,
edumazet, kuba, pabeni, intel-wired-lan, netdev, kernel-janitors,
linux-kernel
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Wed, 18 Jun 2025 14:54:08 +0100 you wrote:
> Don't populate the const read-only array supported_sizes on the
> stack at run time, instead make it static.
>
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> ---
> drivers/net/ethernet/intel/igc/igc_tsn.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Here is the summary with links:
- igc: Make the const read-only array supported_sizes static
https://git.kernel.org/netdev/net-next/c/deb21a6e5b4a
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-06-19 22:49 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-18 13:54 [PATCH] igc: Make the const read-only array supported_sizes static Colin Ian King
2025-06-18 16:29 ` [Intel-wired-lan] " Alexander Lobakin
2025-06-19 13:01 ` Lifshits, Vitaly
2025-06-19 22:50 ` patchwork-bot+netdevbpf
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).