Skip to content

Commit 136899f

Browse files
ColinIanKingbp3tk0v
authored andcommitted
EDAC/pnd2: Make read-only const array intlv static
Don't populate the const read-only array intlv on the stack at run time, instead make it static. This also shrinks the object size: $ size pnd2_edac.o.* text data bss dec hex filename 15632 264 1384 17280 4380 pnd2_edac.o.new 15644 264 1384 17292 438c pnd2_edac.o.old Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Reviewed-by: Qiuxu Zhuo <qiuxu.zhuo@intel.com> Link: https://lore.kernel.org/r/20240919170427.497429-1-colin.i.king@gmail.com
1 parent ac2fbe0 commit 136899f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/edac/pnd2_edac.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ static int gen_asym_mask(struct b_cr_slice_channel_hash *p,
372372
struct b_cr_asym_mem_region1_mchbar *as1,
373373
struct b_cr_asym_2way_mem_region_mchbar *as2way)
374374
{
375-
const int intlv[] = { 0x5, 0xA, 0x3, 0xC };
375+
static const int intlv[] = { 0x5, 0xA, 0x3, 0xC };
376376
int mask = 0;
377377

378378
if (as2way->asym_2way_interleave_enable)
@@ -489,7 +489,7 @@ static int dnv_get_registers(void)
489489
*/
490490
static int get_registers(void)
491491
{
492-
const int intlv[] = { 10, 11, 12, 12 };
492+
static const int intlv[] = { 10, 11, 12, 12 };
493493

494494
if (RD_REG(&tolud, b_cr_tolud_pci) ||
495495
RD_REG(&touud_lo, b_cr_touud_lo_pci) ||

0 commit comments

Comments
 (0)