aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorMadhavan Srinivasan <maddy@linux.vnet.ibm.com>2017-10-11 09:10:04 +0530
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-10-15 20:08:14 -0500
commita9cf7c586871bdd8187760862c2df8bb2fbb2d6f (patch)
tree5111c5b679323e91dc88183583a6cc2b0c790d06 /hw
parenta6559413f07d4bc6c58b00858c48d2fc70165011 (diff)
downloadskiboot-a9cf7c586871bdd8187760862c2df8bb2fbb2d6f.zip
skiboot-a9cf7c586871bdd8187760862c2df8bb2fbb2d6f.tar.gz
skiboot-a9cf7c586871bdd8187760862c2df8bb2fbb2d6f.tar.bz2
hw/imc: Use ARRAY_SIZE instead of static macro
disable_unavailable_units() loops through nest_pmus array to filter out the unsupported nest units from the imc catalog dtb. Current code use a static macro ('MAX_NEST_UNITS') for array limit, instead use ARRAY_SIZE. This will avoid updates to static macro when updating the nest_pmus array. Fixes: 712837cedca06 ('skiboot/imc: Update the nest_pmus array with occ/gpe microcode uav updates') Signed-off-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/imc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/imc.c b/hw/imc.c
index 10505f6..4b2e948 100644
--- a/hw/imc.c
+++ b/hw/imc.c
@@ -321,7 +321,7 @@ static void disable_unavailable_units(struct dt_node *dev)
avl_vec = (0xffULL) << 56;
}
- for (i = 0; i < MAX_NEST_UNITS; i++) {
+ for (i = 0; i < ARRAY_SIZE(nest_pmus); i++) {
if (!(PPC_BITMASK(i, i) & avl_vec)) {
/* Check if the device node exists */
target = dt_find_by_name(dev, nest_pmus[i]);