src: use ARRAY_SIZE where possible
Generated with a variant of
https://coccinelle.gitlabpages.inria.fr/website/rules/array.cocci
Change-Id: I083704fd48faeb6c67bba3367fbcfe554a9f7c66
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/50594
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
diff --git a/src/vendorcode/amd/agesa/f15tn/Proc/GNB/Modules/GnbInitTN/GnbFuseTableTN.c b/src/vendorcode/amd/agesa/f15tn/Proc/GNB/Modules/GnbInitTN/GnbFuseTableTN.c
index 9737bd2..8c580a0 100644
--- a/src/vendorcode/amd/agesa/f15tn/Proc/GNB/Modules/GnbInitTN/GnbFuseTableTN.c
+++ b/src/vendorcode/amd/agesa/f15tn/Proc/GNB/Modules/GnbInitTN/GnbFuseTableTN.c
@@ -615,175 +615,175 @@
{
D0F0xBC_xE0104158_TYPE,
D0F0xBC_xE0104158_ADDRESS,
- sizeof (D0F0xBC_xE0104158_TABLE) / sizeof (FUSE_REGISTER_ENTRY_TN),
+ ARRAY_SIZE(D0F0xBC_xE0104158_TABLE),
D0F0xBC_xE0104158_TABLE
},
{
D0F0xBC_xE010415B_TYPE,
D0F0xBC_xE010415B_ADDRESS,
- sizeof (D0F0xBC_xE010415B_TABLE) / sizeof (FUSE_REGISTER_ENTRY_TN),
+ ARRAY_SIZE(D0F0xBC_xE010415B_TABLE),
D0F0xBC_xE010415B_TABLE
},
{
D0F0xBC_xE0104184_TYPE,
D0F0xBC_xE0104184_ADDRESS,
- sizeof (D0F0xBC_xE0104184_TABLE) / sizeof (FUSE_REGISTER_ENTRY_TN),
+ ARRAY_SIZE(D0F0xBC_xE0104184_TABLE),
D0F0xBC_xE0104184_TABLE
},
{
D0F0xBC_xE0104187_TYPE,
D0F0xBC_xE0104187_ADDRESS,
- sizeof (D0F0xBC_xE0104187_TABLE) / sizeof (FUSE_REGISTER_ENTRY_TN),
+ ARRAY_SIZE(D0F0xBC_xE0104187_TABLE),
D0F0xBC_xE0104187_TABLE
},
{
D0F0xBC_xE0104188_TYPE,
D0F0xBC_xE0104188_ADDRESS,
- sizeof (D0F0xBC_xE0104188_TABLE) / sizeof (FUSE_REGISTER_ENTRY_TN),
+ ARRAY_SIZE(D0F0xBC_xE0104188_TABLE),
D0F0xBC_xE0104188_TABLE
},
{
D0F0xBC_xE0106020_TYPE,
D0F0xBC_xE0106020_ADDRESS,
- sizeof (D0F0xBC_xE0106020_TABLE) / sizeof (FUSE_REGISTER_ENTRY_TN),
+ ARRAY_SIZE(D0F0xBC_xE0106020_TABLE),
D0F0xBC_xE0106020_TABLE
},
{
D0F0xBC_xE0106023_TYPE,
D0F0xBC_xE0106023_ADDRESS,
- sizeof (D0F0xBC_xE0106023_TABLE) / sizeof (FUSE_REGISTER_ENTRY_TN),
+ ARRAY_SIZE(D0F0xBC_xE0106023_TABLE),
D0F0xBC_xE0106023_TABLE
},
{
D0F0xBC_xE0106024_TYPE,
D0F0xBC_xE0106024_ADDRESS,
- sizeof (D0F0xBC_xE0106024_TABLE) / sizeof (FUSE_REGISTER_ENTRY_TN),
+ ARRAY_SIZE(D0F0xBC_xE0106024_TABLE),
D0F0xBC_xE0106024_TABLE
},
{
D0F0xBC_xE010705C_TYPE,
D0F0xBC_xE010705C_ADDRESS,
- sizeof (D0F0xBC_xE010705C_TABLE) / sizeof (FUSE_REGISTER_ENTRY_TN),
+ ARRAY_SIZE(D0F0xBC_xE010705C_TABLE),
D0F0xBC_xE010705C_TABLE
},
{
D0F0xBC_xE010705F_TYPE,
D0F0xBC_xE010705F_ADDRESS,
- sizeof (D0F0xBC_xE010705F_TABLE) / sizeof (FUSE_REGISTER_ENTRY_TN),
+ ARRAY_SIZE(D0F0xBC_xE010705F_TABLE),
D0F0xBC_xE010705F_TABLE
},
{
D0F0xBC_xE0107060_TYPE,
D0F0xBC_xE0107060_ADDRESS,
- sizeof (D0F0xBC_xE0107060_TABLE) / sizeof (FUSE_REGISTER_ENTRY_TN),
+ ARRAY_SIZE(D0F0xBC_xE0107060_TABLE),
D0F0xBC_xE0107060_TABLE
},
{
D0F0xBC_xE0107063_TYPE,
D0F0xBC_xE0107063_ADDRESS,
- sizeof (D0F0xBC_xE0107063_TABLE) / sizeof (FUSE_REGISTER_ENTRY_TN),
+ ARRAY_SIZE(D0F0xBC_xE0107063_TABLE),
D0F0xBC_xE0107063_TABLE
},
{
D0F0xBC_xE0107064_TYPE,
D0F0xBC_xE0107064_ADDRESS,
- sizeof (D0F0xBC_xE0107064_TABLE) / sizeof (FUSE_REGISTER_ENTRY_TN),
+ ARRAY_SIZE(D0F0xBC_xE0107064_TABLE),
D0F0xBC_xE0107064_TABLE
},
{
D0F0xBC_xE0107067_TYPE,
D0F0xBC_xE0107067_ADDRESS,
- sizeof (D0F0xBC_xE0107067_TABLE) / sizeof (FUSE_REGISTER_ENTRY_TN),
+ ARRAY_SIZE(D0F0xBC_xE0107067_TABLE),
D0F0xBC_xE0107067_TABLE
},
{
D0F0xBC_xE0107068_TYPE,
D0F0xBC_xE0107068_ADDRESS,
- sizeof (D0F0xBC_xE0107068_TABLE) / sizeof (FUSE_REGISTER_ENTRY_TN),
+ ARRAY_SIZE(D0F0xBC_xE0107068_TABLE),
D0F0xBC_xE0107068_TABLE
},
{
D0F0xBC_xE010706B_TYPE,
D0F0xBC_xE010706B_ADDRESS,
- sizeof (D0F0xBC_xE010706B_TABLE) / sizeof (FUSE_REGISTER_ENTRY_TN),
+ ARRAY_SIZE(D0F0xBC_xE010706B_TABLE),
D0F0xBC_xE010706B_TABLE
},
{
D0F0xBC_xE010706C_TYPE,
D0F0xBC_xE010706C_ADDRESS,
- sizeof (D0F0xBC_xE010706C_TABLE) / sizeof (FUSE_REGISTER_ENTRY_TN),
+ ARRAY_SIZE(D0F0xBC_xE010706C_TABLE),
D0F0xBC_xE010706C_TABLE
},
{
D0F0xBC_xE010706F_TYPE,
D0F0xBC_xE010706F_ADDRESS,
- sizeof (D0F0xBC_xE010706F_TABLE) / sizeof (FUSE_REGISTER_ENTRY_TN),
+ ARRAY_SIZE(D0F0xBC_xE010706F_TABLE),
D0F0xBC_xE010706F_TABLE
},
{
D0F0xBC_xE0107070_TYPE,
D0F0xBC_xE0107070_ADDRESS,
- sizeof (D0F0xBC_xE0107070_TABLE) / sizeof (FUSE_REGISTER_ENTRY_TN),
+ ARRAY_SIZE(D0F0xBC_xE0107070_TABLE),
D0F0xBC_xE0107070_TABLE
},
{
D0F0xBC_xE0107073_TYPE,
D0F0xBC_xE0107073_ADDRESS,
- sizeof (D0F0xBC_xE0107073_TABLE) / sizeof (FUSE_REGISTER_ENTRY_TN),
+ ARRAY_SIZE(D0F0xBC_xE0107073_TABLE),
D0F0xBC_xE0107073_TABLE
},
{
D0F0xBC_xE0107074_TYPE,
D0F0xBC_xE0107074_ADDRESS,
- sizeof (D0F0xBC_xE0107074_TABLE) / sizeof (FUSE_REGISTER_ENTRY_TN),
+ ARRAY_SIZE(D0F0xBC_xE0107074_TABLE),
D0F0xBC_xE0107074_TABLE
},
{
D0F0xBC_xE0107077_TYPE,
D0F0xBC_xE0107077_ADDRESS,
- sizeof (D0F0xBC_xE0107077_TABLE) / sizeof (FUSE_REGISTER_ENTRY_TN),
+ ARRAY_SIZE(D0F0xBC_xE0107077_TABLE),
D0F0xBC_xE0107077_TABLE
},
{
D0F0xBC_xE0107078_TYPE,
D0F0xBC_xE0107078_ADDRESS,
- sizeof (D0F0xBC_xE0107078_TABLE) / sizeof (FUSE_REGISTER_ENTRY_TN),
+ ARRAY_SIZE(D0F0xBC_xE0107078_TABLE),
D0F0xBC_xE0107078_TABLE
},
{
D0F0xBC_xE010707B_TYPE,
D0F0xBC_xE010707B_ADDRESS,
- sizeof (D0F0xBC_xE010707B_TABLE) / sizeof (FUSE_REGISTER_ENTRY_TN),
+ ARRAY_SIZE(D0F0xBC_xE010707B_TABLE),
D0F0xBC_xE010707B_TABLE
},
{
D0F0xBC_xE010707C_TYPE,
D0F0xBC_xE010707C_ADDRESS,
- sizeof (D0F0xBC_xE010707C_TABLE) / sizeof (FUSE_REGISTER_ENTRY_TN),
+ ARRAY_SIZE(D0F0xBC_xE010707C_TABLE),
D0F0xBC_xE010707C_TABLE
},
{
D0F0xBC_xE010707F_TYPE,
D0F0xBC_xE010707F_ADDRESS,
- sizeof (D0F0xBC_xE010707F_TABLE) / sizeof (FUSE_REGISTER_ENTRY_TN),
+ ARRAY_SIZE(D0F0xBC_xE010707F_TABLE),
D0F0xBC_xE010707F_TABLE
},
{
D0F0xBC_xFF000000_TYPE,
D0F0xBC_xFF000000_ADDRESS,
- sizeof (D0F0xBC_xFF000000_TABLE) / sizeof (FUSE_REGISTER_ENTRY_TN),
+ ARRAY_SIZE(D0F0xBC_xFF000000_TABLE),
D0F0xBC_xFF000000_TABLE
},
{
D0F0xBC_xE0001008_TYPE,
D0F0xBC_xE0001008_ADDRESS,
- sizeof (D0F0xBC_xE0001008_TABLE) / sizeof (FUSE_REGISTER_ENTRY_TN),
+ ARRAY_SIZE(D0F0xBC_xE0001008_TABLE),
D0F0xBC_xE0001008_TABLE
}
};
FUSE_TABLE_TN FuseTableTN = {
- sizeof (FuseRegisterTableTN) / sizeof (FUSE_TABLE_ENTRY_TN),
+ ARRAY_SIZE(FuseRegisterTableTN),
FuseRegisterTableTN
};