2017-08-13 13:50:02

by Julia Lawall

[permalink] [raw]
Subject: [PATCH] powerpc: store the intended structure

Normally the values in the resource field and the argument to ARRAY_SIZE
in the num_resources are the same. In this case, the value in the reousrce
field is the same as the one in the previous platform_device structure, and
appears to be a copy-paste error. Replace the value in the resource field
with the argument to the local call to ARRAY_SIZE.

Signed-off-by: Julia Lawall <[email protected]>

---
arch/powerpc/platforms/chrp/pegasos_eth.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/chrp/pegasos_eth.c b/arch/powerpc/platforms/chrp/pegasos_eth.c
index 2b4dc6a..1976071 100644
--- a/arch/powerpc/platforms/chrp/pegasos_eth.c
+++ b/arch/powerpc/platforms/chrp/pegasos_eth.c
@@ -63,7 +63,7 @@
.name = "orion-mdio",
.id = -1,
.num_resources = ARRAY_SIZE(mv643xx_eth_mvmdio_resources),
- .resource = mv643xx_eth_shared_resources,
+ .resource = mv643xx_eth_mvmdio_resources,
};

static struct resource mv643xx_eth_port1_resources[] = {


2017-08-13 14:37:48

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH] powerpc: store the intended structure

On Sun, 2017-08-13 at 15:24 +0200, Julia Lawall wrote:
> Normally the values in the resource field and the argument to ARRAY_SIZE
> in the num_resources are the same. In this case, the value in the reousrce
> field is the same as the one in the previous platform_device structure, and
> appears to be a copy-paste error. Replace the value in the resource field
> with the argument to the local call to ARRAY_SIZE.

found by a script or eyeballs?

2017-08-13 14:41:54

by Julia Lawall

[permalink] [raw]
Subject: Re: [PATCH] powerpc: store the intended structure



On Sun, 13 Aug 2017, Joe Perches wrote:

> On Sun, 2017-08-13 at 15:24 +0200, Julia Lawall wrote:
> > Normally the values in the resource field and the argument to ARRAY_SIZE
> > in the num_resources are the same. In this case, the value in the reousrce
> > field is the same as the one in the previous platform_device structure, and
> > appears to be a copy-paste error. Replace the value in the resource field
> > with the argument to the local call to ARRAY_SIZE.
>
> found by a script or eyeballs?

A script that was looking for something else. But I wrote a script for
this specific issue and this was the only match. I am currently checking
in a more general way.

julia

2017-08-15 11:14:29

by Michael Ellerman

[permalink] [raw]
Subject: Re: [PATCH] powerpc: store the intended structure

Julia Lawall <[email protected]> writes:

> Normally the values in the resource field and the argument to ARRAY_SIZE
> in the num_resources are the same. In this case, the value in the reousrce
> field is the same as the one in the previous platform_device structure, and
> appears to be a copy-paste error. Replace the value in the resource field
> with the argument to the local call to ARRAY_SIZE.
>
> Signed-off-by: Julia Lawall <[email protected]>
>
> ---
> arch/powerpc/platforms/chrp/pegasos_eth.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

Thanks. This is close to EOL code I think, but I'll merge it anyway as
it seems obviously correct.

cheers

> diff --git a/arch/powerpc/platforms/chrp/pegasos_eth.c b/arch/powerpc/platforms/chrp/pegasos_eth.c
> index 2b4dc6a..1976071 100644
> --- a/arch/powerpc/platforms/chrp/pegasos_eth.c
> +++ b/arch/powerpc/platforms/chrp/pegasos_eth.c
> @@ -63,7 +63,7 @@
> .name = "orion-mdio",
> .id = -1,
> .num_resources = ARRAY_SIZE(mv643xx_eth_mvmdio_resources),
> - .resource = mv643xx_eth_shared_resources,
> + .resource = mv643xx_eth_mvmdio_resources,
> };
>
> static struct resource mv643xx_eth_port1_resources[] = {

2017-08-16 12:30:23

by Michael Ellerman

[permalink] [raw]
Subject: Re: powerpc: store the intended structure

On Sun, 2017-08-13 at 13:24:23 UTC, Julia Lawall wrote:
> Normally the values in the resource field and the argument to ARRAY_SIZE
> in the num_resources are the same. In this case, the value in the reousrce
> field is the same as the one in the previous platform_device structure, and
> appears to be a copy-paste error. Replace the value in the resource field
> with the argument to the local call to ARRAY_SIZE.
>
> Signed-off-by: Julia Lawall <[email protected]>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/36992606eee8016c36ad2576687e97

cheers