From d50f82815d473e6d78cca458d4a8648ae65dd5e4 Mon Sep 17 00:00:00 2001 From: Nishanth Menon Date: Thu, 13 Jul 2023 14:36:34 -0500 Subject: [PATCH] arm: mach-k3: *: dev-data: Update to use ARRAY_SIZE Instead of hard-coding the count of entries manually, use ARRAY_SIZE to keep the count updates appropriately. Cc: Bryan Brattlof Suggested-by: Ravi Gunasekaran Signed-off-by: Nishanth Menon Reviewed-by: Bryan Brattlof Reviewed-by: Siddharth Vadapalli --- arch/arm/mach-k3/am62ax/dev-data.c | 8 ++++---- arch/arm/mach-k3/am62x/dev-data.c | 8 ++++---- arch/arm/mach-k3/j7200/dev-data.c | 8 ++++---- arch/arm/mach-k3/j721e/dev-data.c | 8 ++++---- arch/arm/mach-k3/j721s2/dev-data.c | 8 ++++---- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/arch/arm/mach-k3/am62ax/dev-data.c b/arch/arm/mach-k3/am62ax/dev-data.c index 74739c6385..abf5d8e91a 100644 --- a/arch/arm/mach-k3/am62ax/dev-data.c +++ b/arch/arm/mach-k3/am62ax/dev-data.c @@ -66,8 +66,8 @@ const struct ti_k3_pd_platdata am62ax_pd_platdata = { .pd = soc_pd_list, .lpsc = soc_lpsc_list, .devs = soc_dev_list, - .num_psc = 2, - .num_pd = 4, - .num_lpsc = 14, - .num_devs = 19, + .num_psc = ARRAY_SIZE(soc_psc_list), + .num_pd = ARRAY_SIZE(soc_pd_list), + .num_lpsc = ARRAY_SIZE(soc_lpsc_list), + .num_devs = ARRAY_SIZE(soc_dev_list), }; diff --git a/arch/arm/mach-k3/am62x/dev-data.c b/arch/arm/mach-k3/am62x/dev-data.c index 616d0650b9..1a6f9e2ca0 100644 --- a/arch/arm/mach-k3/am62x/dev-data.c +++ b/arch/arm/mach-k3/am62x/dev-data.c @@ -71,8 +71,8 @@ const struct ti_k3_pd_platdata am62x_pd_platdata = { .pd = soc_pd_list, .lpsc = soc_lpsc_list, .devs = soc_dev_list, - .num_psc = 2, - .num_pd = 5, - .num_lpsc = 16, - .num_devs = 21, + .num_psc = ARRAY_SIZE(soc_psc_list), + .num_pd = ARRAY_SIZE(soc_pd_list), + .num_lpsc = ARRAY_SIZE(soc_lpsc_list), + .num_devs = ARRAY_SIZE(soc_dev_list), }; diff --git a/arch/arm/mach-k3/j7200/dev-data.c b/arch/arm/mach-k3/j7200/dev-data.c index c1a4dab694..4ddc34210e 100644 --- a/arch/arm/mach-k3/j7200/dev-data.c +++ b/arch/arm/mach-k3/j7200/dev-data.c @@ -75,8 +75,8 @@ const struct ti_k3_pd_platdata j7200_pd_platdata = { .pd = soc_pd_list, .lpsc = soc_lpsc_list, .devs = soc_dev_list, - .num_psc = 2, - .num_pd = 6, - .num_lpsc = 17, - .num_devs = 23, + .num_psc = ARRAY_SIZE(soc_psc_list), + .num_pd = ARRAY_SIZE(soc_pd_list), + .num_lpsc = ARRAY_SIZE(soc_lpsc_list), + .num_devs = ARRAY_SIZE(soc_dev_list), }; diff --git a/arch/arm/mach-k3/j721e/dev-data.c b/arch/arm/mach-k3/j721e/dev-data.c index f0afa3552b..97f017f8af 100644 --- a/arch/arm/mach-k3/j721e/dev-data.c +++ b/arch/arm/mach-k3/j721e/dev-data.c @@ -73,8 +73,8 @@ const struct ti_k3_pd_platdata j721e_pd_platdata = { .pd = soc_pd_list, .lpsc = soc_lpsc_list, .devs = soc_dev_list, - .num_psc = 2, - .num_pd = 5, - .num_lpsc = 16, - .num_devs = 23, + .num_psc = ARRAY_SIZE(soc_psc_list), + .num_pd = ARRAY_SIZE(soc_pd_list), + .num_lpsc = ARRAY_SIZE(soc_lpsc_list), + .num_devs = ARRAY_SIZE(soc_dev_list), }; diff --git a/arch/arm/mach-k3/j721s2/dev-data.c b/arch/arm/mach-k3/j721s2/dev-data.c index 35e8b17eb1..8c999a3c5a 100644 --- a/arch/arm/mach-k3/j721s2/dev-data.c +++ b/arch/arm/mach-k3/j721s2/dev-data.c @@ -79,8 +79,8 @@ const struct ti_k3_pd_platdata j721s2_pd_platdata = { .pd = soc_pd_list, .lpsc = soc_lpsc_list, .devs = soc_dev_list, - .num_psc = 2, - .num_pd = 6, - .num_lpsc = 19, - .num_devs = 25, + .num_psc = ARRAY_SIZE(soc_psc_list), + .num_pd = ARRAY_SIZE(soc_pd_list), + .num_lpsc = ARRAY_SIZE(soc_lpsc_list), + .num_devs = ARRAY_SIZE(soc_dev_list), }; -- 2.39.5