* [PATCH] powerpc: mpc5xxx: declare taskTable as array
@ 2025-09-03 12:42 Sascha Hauer
2025-09-04 9:27 ` Ahmad Fatoum
0 siblings, 1 reply; 2+ messages in thread
From: Sascha Hauer @ 2025-09-03 12:42 UTC (permalink / raw)
To: Barebox List
gcc15 rightfully complains about access outside array bounds in usage of
taskTable:
arch/powerpc/mach-mpc5xxx/loadtask.c:37:43: error: array subscript 1 is outside array bounds of 'int[1]' [-Werror=array-bounds=]
Declare that variable as an array as that's what it actually is.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/powerpc/mach-mpc5xxx/loadtask.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/mach-mpc5xxx/loadtask.c b/arch/powerpc/mach-mpc5xxx/loadtask.c
index e2489983ee..9302cbdcdc 100644
--- a/arch/powerpc/mach-mpc5xxx/loadtask.c
+++ b/arch/powerpc/mach-mpc5xxx/loadtask.c
@@ -13,12 +13,12 @@
#include <types.h>
/* BestComm/SmartComm microcode */
-extern int taskTable;
+extern int taskTable[];
void loadtask(int basetask, int tasks)
{
int *sram = (int *)MPC5XXX_SRAM;
- int *task_org = &taskTable;
+ int *task_org = taskTable;
unsigned int start, offset, end;
int i;
--
2.47.2
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] powerpc: mpc5xxx: declare taskTable as array
2025-09-03 12:42 [PATCH] powerpc: mpc5xxx: declare taskTable as array Sascha Hauer
@ 2025-09-04 9:27 ` Ahmad Fatoum
0 siblings, 0 replies; 2+ messages in thread
From: Ahmad Fatoum @ 2025-09-04 9:27 UTC (permalink / raw)
To: Sascha Hauer, Barebox List
On 9/3/25 2:42 PM, Sascha Hauer wrote:
> gcc15 rightfully complains about access outside array bounds in usage of
> taskTable:
>
> arch/powerpc/mach-mpc5xxx/loadtask.c:37:43: error: array subscript 1 is outside array bounds of 'int[1]' [-Werror=array-bounds=]
>
> Declare that variable as an array as that's what it actually is.
>
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
> arch/powerpc/mach-mpc5xxx/loadtask.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/powerpc/mach-mpc5xxx/loadtask.c b/arch/powerpc/mach-mpc5xxx/loadtask.c
> index e2489983ee..9302cbdcdc 100644
> --- a/arch/powerpc/mach-mpc5xxx/loadtask.c
> +++ b/arch/powerpc/mach-mpc5xxx/loadtask.c
> @@ -13,12 +13,12 @@
> #include <types.h>
>
> /* BestComm/SmartComm microcode */
> -extern int taskTable;
> +extern int taskTable[];
>
> void loadtask(int basetask, int tasks)
> {
> int *sram = (int *)MPC5XXX_SRAM;
> - int *task_org = &taskTable;
> + int *task_org = taskTable;
> unsigned int start, offset, end;
> int i;
>
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-09-04 10:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-03 12:42 [PATCH] powerpc: mpc5xxx: declare taskTable as array Sascha Hauer
2025-09-04 9:27 ` Ahmad Fatoum
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox