arm: mach-k3: *: dev-data: Update to use ARRAY_SIZE
Subsystems (2)
PATCH 1/1 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.
---
Link to discussion that triggered this:
https://lore.kernel.org/all/[email protected]/
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(-)
arch/arm/mach-k3/am62ax/dev-data.c +4 -4
@@ -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), };
arch/arm/mach-k3/am62x/dev-data.c +4 -4
@@ -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), };
arch/arm/mach-k3/j7200/dev-data.c +4 -4
@@ -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), };
arch/arm/mach-k3/j721e/dev-data.c +4 -4
@@ -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), };
arch/arm/mach-k3/j721s2/dev-data.c +4 -4
@@ -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), };
Signature · 1 line
2.40.0
On July 13, 2023 thus sayeth Nishanth Menon:
Quoted 8 lines
Instead of hard-coding the count of entries manually, use
ARRAY_SIZEto keep the count updates appropriately.Cc Bryan Brattlof <[email protected]>Suggested-by Ravi Gunasekaran <[email protected]>Signed-off-by Nishanth Menon <[email protected]>---
That looks good to me :)
Thanks for the quick fix
~Bryan
Quoted 6 lines · Nishanth Menon
Instead of hard-coding the count of entries manually, use
ARRAY_SIZEto keep the count updates appropriately.Cc Bryan Brattlof <[email protected]>Suggested-by Ravi Gunasekaran <[email protected]>Signed-off-by Nishanth Menon <[email protected]>
Quoted 97 lines
---
Link to discussion that triggered this:
https://lore.kernel.org/all/[email protected]/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(-)arch/arm/mach-k3/am62ax/dev-data.c +4
-4@@ -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), };arch/arm/mach-k3/am62x/dev-data.c +4
-4@@ -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), };arch/arm/mach-k3/j7200/dev-data.c +4
-4@@ -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), };arch/arm/mach-k3/j721e/dev-data.c +4
-4@@ -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), };arch/arm/mach-k3/j721s2/dev-data.c +4
-4@@ -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), };
Signature · 2 lines
Regards, Siddharth.
Quoted 8 lines · Nishanth Menon
Instead of hard-coding the count of entries manually, use
ARRAY_SIZEto keep the count updates appropriately.Cc Bryan Brattlof <[email protected]>Suggested-by Ravi Gunasekaran <[email protected]>Signed-off-by Nishanth Menon <[email protected]>Reviewed-by Bryan Brattlof <[email protected]>Reviewed-by Siddharth Vadapalli <[email protected]>
Applied to u-boot/master, thanks!
Signature · 1 line
Tom