summaryrefslogtreecommitdiff
path: root/src/mainboard
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainboard')
-rw-r--r--src/mainboard/amd/persimmon/mainboard.c2
-rw-r--r--src/mainboard/asus/am1i-a/mainboard.c2
-rw-r--r--src/mainboard/bap/ode_e20XX/mainboard.c2
-rw-r--r--src/mainboard/biostar/am1ml/mainboard.c2
-rw-r--r--src/mainboard/elmex/pcm205400/mainboard.c2
-rw-r--r--src/mainboard/gizmosphere/gizmo2/mainboard.c2
-rw-r--r--src/mainboard/google/foster/sdram_configs.c3
-rw-r--r--src/mainboard/google/nyan/sdram_configs.c2
-rw-r--r--src/mainboard/google/nyan_big/sdram_configs.c2
-rw-r--r--src/mainboard/google/nyan_blaze/sdram_configs.c2
-rw-r--r--src/mainboard/google/smaug/sdram_configs.c2
-rw-r--r--src/mainboard/hp/abm/mainboard.c2
-rw-r--r--src/mainboard/jetway/nf81-t56n-lf/mainboard.c2
-rw-r--r--src/mainboard/pcengines/apu1/mainboard.c2
-rw-r--r--src/mainboard/pcengines/apu2/mainboard.c2
15 files changed, 16 insertions, 15 deletions
diff --git a/src/mainboard/amd/persimmon/mainboard.c b/src/mainboard/amd/persimmon/mainboard.c
index 69b0c9db14..9e5e81fc21 100644
--- a/src/mainboard/amd/persimmon/mainboard.c
+++ b/src/mainboard/amd/persimmon/mainboard.c
@@ -98,7 +98,7 @@ static const struct pirq_struct mainboard_pirq_data[] = {
static void pirq_setup(void)
{
pirq_data_ptr = mainboard_pirq_data;
- pirq_data_size = sizeof(mainboard_pirq_data) / sizeof(struct pirq_struct);
+ pirq_data_size = ARRAY_SIZE(mainboard_pirq_data);
intr_data_ptr = mainboard_intr_data;
picr_data_ptr = mainboard_picr_data;
}
diff --git a/src/mainboard/asus/am1i-a/mainboard.c b/src/mainboard/asus/am1i-a/mainboard.c
index b17030a98a..c028c01e7e 100644
--- a/src/mainboard/asus/am1i-a/mainboard.c
+++ b/src/mainboard/asus/am1i-a/mainboard.c
@@ -71,7 +71,7 @@ const u8 *intr_data = mainboard_intr_data;
static void pirq_setup(void)
{
pirq_data_ptr = mainboard_pirq_data;
- pirq_data_size = sizeof(mainboard_pirq_data) / sizeof(struct pirq_struct);
+ pirq_data_size = ARRAY_SIZE(mainboard_pirq_data);
intr_data_ptr = mainboard_intr_data;
picr_data_ptr = mainboard_picr_data;
}
diff --git a/src/mainboard/bap/ode_e20XX/mainboard.c b/src/mainboard/bap/ode_e20XX/mainboard.c
index 6db8bb6870..38c8a1e71d 100644
--- a/src/mainboard/bap/ode_e20XX/mainboard.c
+++ b/src/mainboard/bap/ode_e20XX/mainboard.c
@@ -86,7 +86,7 @@ const u8 *intr_data = mainboard_intr_data;
static void pirq_setup(void)
{
pirq_data_ptr = mainboard_pirq_data;
- pirq_data_size = sizeof(mainboard_pirq_data) / sizeof(struct pirq_struct);
+ pirq_data_size = ARRAY_SIZE(mainboard_pirq_data);
intr_data_ptr = mainboard_intr_data;
picr_data_ptr = mainboard_picr_data;
}
diff --git a/src/mainboard/biostar/am1ml/mainboard.c b/src/mainboard/biostar/am1ml/mainboard.c
index 37a13bbfcf..f371a44318 100644
--- a/src/mainboard/biostar/am1ml/mainboard.c
+++ b/src/mainboard/biostar/am1ml/mainboard.c
@@ -75,7 +75,7 @@ const u8 *intr_data = mainboard_intr_data;
static void pirq_setup(void)
{
pirq_data_ptr = mainboard_pirq_data;
- pirq_data_size = sizeof(mainboard_pirq_data) / sizeof(struct pirq_struct);
+ pirq_data_size = ARRAY_SIZE(mainboard_pirq_data);
intr_data_ptr = mainboard_intr_data;
picr_data_ptr = mainboard_picr_data;
}
diff --git a/src/mainboard/elmex/pcm205400/mainboard.c b/src/mainboard/elmex/pcm205400/mainboard.c
index 69b0c9db14..9e5e81fc21 100644
--- a/src/mainboard/elmex/pcm205400/mainboard.c
+++ b/src/mainboard/elmex/pcm205400/mainboard.c
@@ -98,7 +98,7 @@ static const struct pirq_struct mainboard_pirq_data[] = {
static void pirq_setup(void)
{
pirq_data_ptr = mainboard_pirq_data;
- pirq_data_size = sizeof(mainboard_pirq_data) / sizeof(struct pirq_struct);
+ pirq_data_size = ARRAY_SIZE(mainboard_pirq_data);
intr_data_ptr = mainboard_intr_data;
picr_data_ptr = mainboard_picr_data;
}
diff --git a/src/mainboard/gizmosphere/gizmo2/mainboard.c b/src/mainboard/gizmosphere/gizmo2/mainboard.c
index 32a67f8502..c08528a20f 100644
--- a/src/mainboard/gizmosphere/gizmo2/mainboard.c
+++ b/src/mainboard/gizmosphere/gizmo2/mainboard.c
@@ -85,7 +85,7 @@ const u8 *intr_data = mainboard_intr_data;
static void pirq_setup(void)
{
pirq_data_ptr = mainboard_pirq_data;
- pirq_data_size = sizeof(mainboard_pirq_data) / sizeof(struct pirq_struct);
+ pirq_data_size = ARRAY_SIZE(mainboard_pirq_data);
intr_data_ptr = mainboard_intr_data;
picr_data_ptr = mainboard_picr_data;
}
diff --git a/src/mainboard/google/foster/sdram_configs.c b/src/mainboard/google/foster/sdram_configs.c
index 17874b4aeb..25d64036fa 100644
--- a/src/mainboard/google/foster/sdram_configs.c
+++ b/src/mainboard/google/foster/sdram_configs.c
@@ -1,5 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0-only */
+#include <commonlib/bsd/helpers.h>
#include <console/console.h>
#include <soc/sdram_configs.h>
@@ -19,7 +20,7 @@ const struct sdram_params *get_sdram_config()
*/
printk(BIOS_SPEW, "%s: RAMCODE=%d\n", __func__, ramcode);
- if (ramcode >= sizeof(sdram_configs) / sizeof(sdram_configs[0]) ||
+ if (ramcode >= ARRAY_SIZE(sdram_configs) ||
sdram_configs[ramcode].MemoryType == NvBootMemoryType_Unused) {
die("Invalid RAMCODE.");
}
diff --git a/src/mainboard/google/nyan/sdram_configs.c b/src/mainboard/google/nyan/sdram_configs.c
index 74d5660320..241fbce5b3 100644
--- a/src/mainboard/google/nyan/sdram_configs.c
+++ b/src/mainboard/google/nyan/sdram_configs.c
@@ -33,7 +33,7 @@ const struct sdram_params *get_sdram_config()
*/
printk(BIOS_SPEW, "%s: RAMCODE=%d\n", __func__, ramcode);
- if (ramcode >= sizeof(sdram_configs) / sizeof(sdram_configs[0]) ||
+ if (ramcode >= ARRAY_SIZE(sdram_configs) ||
sdram_configs[ramcode].MemoryType == NvBootMemoryType_Unused) {
die("Invalid RAMCODE.");
}
diff --git a/src/mainboard/google/nyan_big/sdram_configs.c b/src/mainboard/google/nyan_big/sdram_configs.c
index 7193d7b4c4..15ed489070 100644
--- a/src/mainboard/google/nyan_big/sdram_configs.c
+++ b/src/mainboard/google/nyan_big/sdram_configs.c
@@ -33,7 +33,7 @@ const struct sdram_params *get_sdram_config()
*/
printk(BIOS_SPEW, "%s: RAMCODE=%d\n", __func__, ramcode);
- if (ramcode >= sizeof(sdram_configs) / sizeof(sdram_configs[0]) ||
+ if (ramcode >= ARRAY_SIZE(sdram_configs) ||
sdram_configs[ramcode].MemoryType == NvBootMemoryType_Unused) {
die("Invalid RAMCODE.");
}
diff --git a/src/mainboard/google/nyan_blaze/sdram_configs.c b/src/mainboard/google/nyan_blaze/sdram_configs.c
index 89f6ca8968..7972255173 100644
--- a/src/mainboard/google/nyan_blaze/sdram_configs.c
+++ b/src/mainboard/google/nyan_blaze/sdram_configs.c
@@ -33,7 +33,7 @@ const struct sdram_params *get_sdram_config()
*/
printk(BIOS_SPEW, "%s: RAMCODE=%d\n", __func__, ramcode);
- if (ramcode >= sizeof(sdram_configs) / sizeof(sdram_configs[0]) ||
+ if (ramcode >= ARRAY_SIZE(sdram_configs) ||
sdram_configs[ramcode].MemoryType == NvBootMemoryType_Unused) {
die("Invalid RAMCODE.");
}
diff --git a/src/mainboard/google/smaug/sdram_configs.c b/src/mainboard/google/smaug/sdram_configs.c
index c45b679a27..8d4521168f 100644
--- a/src/mainboard/google/smaug/sdram_configs.c
+++ b/src/mainboard/google/smaug/sdram_configs.c
@@ -31,7 +31,7 @@ const struct sdram_params *get_sdram_config()
*/
printk(BIOS_SPEW, "%s: RAMCODE=%d\n", __func__, ramcode);
- if (ramcode >= sizeof(sdram_configs) / sizeof(sdram_configs[0]) ||
+ if (ramcode >= ARRAY_SIZE(sdram_configs) ||
sdram_configs[ramcode].MemoryType == NvBootMemoryType_Unused) {
die("Invalid RAMCODE.");
}
diff --git a/src/mainboard/hp/abm/mainboard.c b/src/mainboard/hp/abm/mainboard.c
index f375da6097..88de23a77d 100644
--- a/src/mainboard/hp/abm/mainboard.c
+++ b/src/mainboard/hp/abm/mainboard.c
@@ -70,7 +70,7 @@ static const struct pirq_struct mainboard_pirq_data[] = {
static void pirq_setup(void)
{
pirq_data_ptr = mainboard_pirq_data;
- pirq_data_size = sizeof(mainboard_pirq_data) / sizeof(struct pirq_struct);
+ pirq_data_size = ARRAY_SIZE(mainboard_pirq_data);
intr_data_ptr = mainboard_intr_data;
picr_data_ptr = mainboard_picr_data;
}
diff --git a/src/mainboard/jetway/nf81-t56n-lf/mainboard.c b/src/mainboard/jetway/nf81-t56n-lf/mainboard.c
index c0eb97a2fe..a8ed85dad7 100644
--- a/src/mainboard/jetway/nf81-t56n-lf/mainboard.c
+++ b/src/mainboard/jetway/nf81-t56n-lf/mainboard.c
@@ -99,7 +99,7 @@ static const struct pirq_struct mainboard_pirq_data[] = {
static void pirq_setup(void)
{
pirq_data_ptr = mainboard_pirq_data;
- pirq_data_size = sizeof(mainboard_pirq_data) / sizeof(struct pirq_struct);
+ pirq_data_size = ARRAY_SIZE(mainboard_pirq_data);
intr_data_ptr = mainboard_intr_data;
picr_data_ptr = mainboard_picr_data;
}
diff --git a/src/mainboard/pcengines/apu1/mainboard.c b/src/mainboard/pcengines/apu1/mainboard.c
index 7e3ef08b48..fa9b093920 100644
--- a/src/mainboard/pcengines/apu1/mainboard.c
+++ b/src/mainboard/pcengines/apu1/mainboard.c
@@ -111,7 +111,7 @@ static const struct pirq_struct mainboard_pirq_data[] = {
static void pirq_setup(void)
{
pirq_data_ptr = mainboard_pirq_data;
- pirq_data_size = sizeof(mainboard_pirq_data) / sizeof(struct pirq_struct);
+ pirq_data_size = ARRAY_SIZE(mainboard_pirq_data);
intr_data_ptr = mainboard_intr_data;
picr_data_ptr = mainboard_picr_data;
}
diff --git a/src/mainboard/pcengines/apu2/mainboard.c b/src/mainboard/pcengines/apu2/mainboard.c
index bad1a57fd5..062d223860 100644
--- a/src/mainboard/pcengines/apu2/mainboard.c
+++ b/src/mainboard/pcengines/apu2/mainboard.c
@@ -114,7 +114,7 @@ static const struct pirq_struct mainboard_pirq_data[] = {
static void pirq_setup(void)
{
pirq_data_ptr = mainboard_pirq_data;
- pirq_data_size = sizeof(mainboard_pirq_data) / sizeof(struct pirq_struct);
+ pirq_data_size = ARRAY_SIZE(mainboard_pirq_data);
intr_data_ptr = mainboard_intr_data;
picr_data_ptr = mainboard_picr_data;
}