* [PATCH] net: dsa: mv88e6xxx: remove duplicate assignment of struct members
@ 2020-04-29 14:10 Jason Yan
2020-04-29 14:17 ` Russell King - ARM Linux admin
2020-04-29 19:15 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Jason Yan @ 2020-04-29 14:10 UTC (permalink / raw)
To: andrew, vivien.didelot, f.fainelli, davem, linux, netdev, linux-kernel
Cc: Jason Yan
These struct members named 'phylink_validate' was assigned twice:
static const struct mv88e6xxx_ops mv88e6190_ops = {
......
.phylink_validate = mv88e6390_phylink_validate,
......
.phylink_validate = mv88e6390_phylink_validate,
};
static const struct mv88e6xxx_ops mv88e6190x_ops = {
......
.phylink_validate = mv88e6390_phylink_validate,
......
.phylink_validate = mv88e6390x_phylink_validate,
};
static const struct mv88e6xxx_ops mv88e6191_ops = {
......
.phylink_validate = mv88e6390_phylink_validate,
......
.phylink_validate = mv88e6390_phylink_validate,
};
static const struct mv88e6xxx_ops mv88e6290_ops = {
......
.phylink_validate = mv88e6390_phylink_validate,
......
.phylink_validate = mv88e6390_phylink_validate,
};
Remove all the first one and leave the second one which are been used in
fact. Be aware that for 'mv88e6190x_ops' the assignment functions is
different while the others are all the same. This fixes the following
coccicheck warning:
drivers/net/dsa/mv88e6xxx/chip.c:3911:48-49: phylink_validate: first
occurrence line 3965, second occurrence line 3967
drivers/net/dsa/mv88e6xxx/chip.c:3970:49-50: phylink_validate: first
occurrence line 4024, second occurrence line 4026
drivers/net/dsa/mv88e6xxx/chip.c:4029:48-49: phylink_validate: first
occurrence line 4082, second occurrence line 4085
drivers/net/dsa/mv88e6xxx/chip.c:4184:48-49: phylink_validate: first
occurrence line 4238, second occurrence line 4242
Signed-off-by: Jason Yan <yanaijie@huawei.com>
---
drivers/net/dsa/mv88e6xxx/chip.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index dd8a5666a584..2b4a723c8306 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -3962,7 +3962,6 @@ static const struct mv88e6xxx_ops mv88e6190_ops = {
.serdes_get_stats = mv88e6390_serdes_get_stats,
.serdes_get_regs_len = mv88e6390_serdes_get_regs_len,
.serdes_get_regs = mv88e6390_serdes_get_regs,
- .phylink_validate = mv88e6390_phylink_validate,
.gpio_ops = &mv88e6352_gpio_ops,
.phylink_validate = mv88e6390_phylink_validate,
};
@@ -4021,7 +4020,6 @@ static const struct mv88e6xxx_ops mv88e6190x_ops = {
.serdes_get_stats = mv88e6390_serdes_get_stats,
.serdes_get_regs_len = mv88e6390_serdes_get_regs_len,
.serdes_get_regs = mv88e6390_serdes_get_regs,
- .phylink_validate = mv88e6390_phylink_validate,
.gpio_ops = &mv88e6352_gpio_ops,
.phylink_validate = mv88e6390x_phylink_validate,
};
@@ -4079,7 +4077,6 @@ static const struct mv88e6xxx_ops mv88e6191_ops = {
.serdes_get_stats = mv88e6390_serdes_get_stats,
.serdes_get_regs_len = mv88e6390_serdes_get_regs_len,
.serdes_get_regs = mv88e6390_serdes_get_regs,
- .phylink_validate = mv88e6390_phylink_validate,
.avb_ops = &mv88e6390_avb_ops,
.ptp_ops = &mv88e6352_ptp_ops,
.phylink_validate = mv88e6390_phylink_validate,
@@ -4235,7 +4232,6 @@ static const struct mv88e6xxx_ops mv88e6290_ops = {
.serdes_get_stats = mv88e6390_serdes_get_stats,
.serdes_get_regs_len = mv88e6390_serdes_get_regs_len,
.serdes_get_regs = mv88e6390_serdes_get_regs,
- .phylink_validate = mv88e6390_phylink_validate,
.gpio_ops = &mv88e6352_gpio_ops,
.avb_ops = &mv88e6390_avb_ops,
.ptp_ops = &mv88e6352_ptp_ops,
--
2.21.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] net: dsa: mv88e6xxx: remove duplicate assignment of struct members
2020-04-29 14:10 [PATCH] net: dsa: mv88e6xxx: remove duplicate assignment of struct members Jason Yan
@ 2020-04-29 14:17 ` Russell King - ARM Linux admin
2020-04-29 19:15 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Russell King - ARM Linux admin @ 2020-04-29 14:17 UTC (permalink / raw)
To: Jason Yan; +Cc: andrew, vivien.didelot, f.fainelli, davem, netdev, linux-kernel
On Wed, Apr 29, 2020 at 10:10:01PM +0800, Jason Yan wrote:
> These struct members named 'phylink_validate' was assigned twice:
>
> static const struct mv88e6xxx_ops mv88e6190_ops = {
> ......
> .phylink_validate = mv88e6390_phylink_validate,
> ......
> .phylink_validate = mv88e6390_phylink_validate,
> };
>
> static const struct mv88e6xxx_ops mv88e6190x_ops = {
> ......
> .phylink_validate = mv88e6390_phylink_validate,
> ......
> .phylink_validate = mv88e6390x_phylink_validate,
> };
>
> static const struct mv88e6xxx_ops mv88e6191_ops = {
> ......
> .phylink_validate = mv88e6390_phylink_validate,
> ......
> .phylink_validate = mv88e6390_phylink_validate,
> };
>
> static const struct mv88e6xxx_ops mv88e6290_ops = {
> ......
> .phylink_validate = mv88e6390_phylink_validate,
> ......
> .phylink_validate = mv88e6390_phylink_validate,
> };
>
> Remove all the first one and leave the second one which are been used in
> fact. Be aware that for 'mv88e6190x_ops' the assignment functions is
> different while the others are all the same. This fixes the following
> coccicheck warning:
>
> drivers/net/dsa/mv88e6xxx/chip.c:3911:48-49: phylink_validate: first
> occurrence line 3965, second occurrence line 3967
> drivers/net/dsa/mv88e6xxx/chip.c:3970:49-50: phylink_validate: first
> occurrence line 4024, second occurrence line 4026
> drivers/net/dsa/mv88e6xxx/chip.c:4029:48-49: phylink_validate: first
> occurrence line 4082, second occurrence line 4085
> drivers/net/dsa/mv88e6xxx/chip.c:4184:48-49: phylink_validate: first
> occurrence line 4238, second occurrence line 4242
This looks like a mistake while rebasing / updating the code which
resulted in commit 4262c38dc42e ("net: dsa: mv88e6xxx: Add SERDES stats
counters to all 6390 family members").
In light of what the commit which introduced this did, this patch looks
correct to me.
Fixes: 4262c38dc42e ("net: dsa: mv88e6xxx: Add SERDES stats counters to all 6390 family members")
Reviewed-by: Russell King <rmk+kernel@armlinux.org.uk>
Thanks.
>
> Signed-off-by: Jason Yan <yanaijie@huawei.com>
> ---
> drivers/net/dsa/mv88e6xxx/chip.c | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
> index dd8a5666a584..2b4a723c8306 100644
> --- a/drivers/net/dsa/mv88e6xxx/chip.c
> +++ b/drivers/net/dsa/mv88e6xxx/chip.c
> @@ -3962,7 +3962,6 @@ static const struct mv88e6xxx_ops mv88e6190_ops = {
> .serdes_get_stats = mv88e6390_serdes_get_stats,
> .serdes_get_regs_len = mv88e6390_serdes_get_regs_len,
> .serdes_get_regs = mv88e6390_serdes_get_regs,
> - .phylink_validate = mv88e6390_phylink_validate,
> .gpio_ops = &mv88e6352_gpio_ops,
> .phylink_validate = mv88e6390_phylink_validate,
> };
> @@ -4021,7 +4020,6 @@ static const struct mv88e6xxx_ops mv88e6190x_ops = {
> .serdes_get_stats = mv88e6390_serdes_get_stats,
> .serdes_get_regs_len = mv88e6390_serdes_get_regs_len,
> .serdes_get_regs = mv88e6390_serdes_get_regs,
> - .phylink_validate = mv88e6390_phylink_validate,
> .gpio_ops = &mv88e6352_gpio_ops,
> .phylink_validate = mv88e6390x_phylink_validate,
> };
> @@ -4079,7 +4077,6 @@ static const struct mv88e6xxx_ops mv88e6191_ops = {
> .serdes_get_stats = mv88e6390_serdes_get_stats,
> .serdes_get_regs_len = mv88e6390_serdes_get_regs_len,
> .serdes_get_regs = mv88e6390_serdes_get_regs,
> - .phylink_validate = mv88e6390_phylink_validate,
> .avb_ops = &mv88e6390_avb_ops,
> .ptp_ops = &mv88e6352_ptp_ops,
> .phylink_validate = mv88e6390_phylink_validate,
> @@ -4235,7 +4232,6 @@ static const struct mv88e6xxx_ops mv88e6290_ops = {
> .serdes_get_stats = mv88e6390_serdes_get_stats,
> .serdes_get_regs_len = mv88e6390_serdes_get_regs_len,
> .serdes_get_regs = mv88e6390_serdes_get_regs,
> - .phylink_validate = mv88e6390_phylink_validate,
> .gpio_ops = &mv88e6352_gpio_ops,
> .avb_ops = &mv88e6390_avb_ops,
> .ptp_ops = &mv88e6352_ptp_ops,
> --
> 2.21.1
>
>
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 10.2Mbps down 587kbps up
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] net: dsa: mv88e6xxx: remove duplicate assignment of struct members
2020-04-29 14:10 [PATCH] net: dsa: mv88e6xxx: remove duplicate assignment of struct members Jason Yan
2020-04-29 14:17 ` Russell King - ARM Linux admin
@ 2020-04-29 19:15 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2020-04-29 19:15 UTC (permalink / raw)
To: yanaijie; +Cc: andrew, vivien.didelot, f.fainelli, linux, netdev, linux-kernel
From: Jason Yan <yanaijie@huawei.com>
Date: Wed, 29 Apr 2020 22:10:01 +0800
> These struct members named 'phylink_validate' was assigned twice:
>
> static const struct mv88e6xxx_ops mv88e6190_ops = {
> ......
> .phylink_validate = mv88e6390_phylink_validate,
> ......
> .phylink_validate = mv88e6390_phylink_validate,
> };
>
> static const struct mv88e6xxx_ops mv88e6190x_ops = {
> ......
> .phylink_validate = mv88e6390_phylink_validate,
> ......
> .phylink_validate = mv88e6390x_phylink_validate,
> };
>
> static const struct mv88e6xxx_ops mv88e6191_ops = {
> ......
> .phylink_validate = mv88e6390_phylink_validate,
> ......
> .phylink_validate = mv88e6390_phylink_validate,
> };
>
> static const struct mv88e6xxx_ops mv88e6290_ops = {
> ......
> .phylink_validate = mv88e6390_phylink_validate,
> ......
> .phylink_validate = mv88e6390_phylink_validate,
> };
>
> Remove all the first one and leave the second one which are been used in
> fact. Be aware that for 'mv88e6190x_ops' the assignment functions is
> different while the others are all the same. This fixes the following
> coccicheck warning:
>
> drivers/net/dsa/mv88e6xxx/chip.c:3911:48-49: phylink_validate: first
> occurrence line 3965, second occurrence line 3967
> drivers/net/dsa/mv88e6xxx/chip.c:3970:49-50: phylink_validate: first
> occurrence line 4024, second occurrence line 4026
> drivers/net/dsa/mv88e6xxx/chip.c:4029:48-49: phylink_validate: first
> occurrence line 4082, second occurrence line 4085
> drivers/net/dsa/mv88e6xxx/chip.c:4184:48-49: phylink_validate: first
> occurrence line 4238, second occurrence line 4242
>
> Signed-off-by: Jason Yan <yanaijie@huawei.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-04-29 19:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-29 14:10 [PATCH] net: dsa: mv88e6xxx: remove duplicate assignment of struct members Jason Yan
2020-04-29 14:17 ` Russell King - ARM Linux admin
2020-04-29 19:15 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).