]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
igc: Make the const read-only array supported_sizes static
authorColin Ian King <colin.i.king@gmail.com>
Wed, 18 Jun 2025 13:54:08 +0000 (14:54 +0100)
committerJakub Kicinski <kuba@kernel.org>
Thu, 19 Jun 2025 22:39:21 +0000 (15:39 -0700)
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>>
Link: https://patch.msgid.link/20250618135408.1784120-1-colin.i.king@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/intel/igc/igc_tsn.c

index b23b9ca451a79780a2e8cd577691a000d7684796..8a110145bfee73a9aa10e5b5de05dd28919c4687 100644 (file)
@@ -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++) {