* [PATCH net-next] net: dsa: mv88e6xxx: unconditionally set ATU trunk
@ 2017-03-28 19:09 Vivien Didelot
2017-03-28 19:26 ` Andrew Lunn
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Vivien Didelot @ 2017-03-28 19:09 UTC (permalink / raw)
To: netdev
Cc: linux-kernel, kernel, David S. Miller, Florian Fainelli,
Andrew Lunn, Vivien Didelot
Set the trunk member of the mv88e6xxx_atu_entry structure regardless its
value, so that uninitialized structures gets the correct boolean value.
Note that no mainline code is affected by the current behavior.
Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
---
drivers/net/dsa/mv88e6xxx/global1_atu.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/net/dsa/mv88e6xxx/global1_atu.c b/drivers/net/dsa/mv88e6xxx/global1_atu.c
index 831434bc5c13..fa7e7db5171b 100644
--- a/drivers/net/dsa/mv88e6xxx/global1_atu.c
+++ b/drivers/net/dsa/mv88e6xxx/global1_atu.c
@@ -128,9 +128,7 @@ static int mv88e6xxx_g1_atu_data_read(struct mv88e6xxx_chip *chip,
entry->state = val & 0xf;
if (entry->state != GLOBAL_ATU_DATA_STATE_UNUSED) {
- if (val & GLOBAL_ATU_DATA_TRUNK)
- entry->trunk = true;
-
+ entry->trunk = !!(val & GLOBAL_ATU_DATA_TRUNK);
entry->portvec = (val >> 4) & mv88e6xxx_port_mask(chip);
}
--
2.12.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] net: dsa: mv88e6xxx: unconditionally set ATU trunk
2017-03-28 19:09 [PATCH net-next] net: dsa: mv88e6xxx: unconditionally set ATU trunk Vivien Didelot
@ 2017-03-28 19:26 ` Andrew Lunn
2017-03-28 19:29 ` Florian Fainelli
2017-03-29 5:05 ` David Miller
2 siblings, 0 replies; 4+ messages in thread
From: Andrew Lunn @ 2017-03-28 19:26 UTC (permalink / raw)
To: Vivien Didelot
Cc: netdev, linux-kernel, kernel, David S. Miller, Florian Fainelli
On Tue, Mar 28, 2017 at 03:09:43PM -0400, Vivien Didelot wrote:
> Set the trunk member of the mv88e6xxx_atu_entry structure regardless its
> value, so that uninitialized structures gets the correct boolean value.
>
> Note that no mainline code is affected by the current behavior.
>
> Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] net: dsa: mv88e6xxx: unconditionally set ATU trunk
2017-03-28 19:09 [PATCH net-next] net: dsa: mv88e6xxx: unconditionally set ATU trunk Vivien Didelot
2017-03-28 19:26 ` Andrew Lunn
@ 2017-03-28 19:29 ` Florian Fainelli
2017-03-29 5:05 ` David Miller
2 siblings, 0 replies; 4+ messages in thread
From: Florian Fainelli @ 2017-03-28 19:29 UTC (permalink / raw)
To: Vivien Didelot, netdev; +Cc: linux-kernel, kernel, David S. Miller, Andrew Lunn
On 03/28/2017 12:09 PM, Vivien Didelot wrote:
> Set the trunk member of the mv88e6xxx_atu_entry structure regardless its
> value, so that uninitialized structures gets the correct boolean value.
Ouch, yes indeed!
>
> Note that no mainline code is affected by the current behavior.
>
> Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
> drivers/net/dsa/mv88e6xxx/global1_atu.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/net/dsa/mv88e6xxx/global1_atu.c b/drivers/net/dsa/mv88e6xxx/global1_atu.c
> index 831434bc5c13..fa7e7db5171b 100644
> --- a/drivers/net/dsa/mv88e6xxx/global1_atu.c
> +++ b/drivers/net/dsa/mv88e6xxx/global1_atu.c
> @@ -128,9 +128,7 @@ static int mv88e6xxx_g1_atu_data_read(struct mv88e6xxx_chip *chip,
>
> entry->state = val & 0xf;
> if (entry->state != GLOBAL_ATU_DATA_STATE_UNUSED) {
> - if (val & GLOBAL_ATU_DATA_TRUNK)
> - entry->trunk = true;
> -
> + entry->trunk = !!(val & GLOBAL_ATU_DATA_TRUNK);
> entry->portvec = (val >> 4) & mv88e6xxx_port_mask(chip);
> }
>
>
--
Florian
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] net: dsa: mv88e6xxx: unconditionally set ATU trunk
2017-03-28 19:09 [PATCH net-next] net: dsa: mv88e6xxx: unconditionally set ATU trunk Vivien Didelot
2017-03-28 19:26 ` Andrew Lunn
2017-03-28 19:29 ` Florian Fainelli
@ 2017-03-29 5:05 ` David Miller
2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2017-03-29 5:05 UTC (permalink / raw)
To: vivien.didelot; +Cc: netdev, linux-kernel, kernel, f.fainelli, andrew
From: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Date: Tue, 28 Mar 2017 15:09:43 -0400
> Set the trunk member of the mv88e6xxx_atu_entry structure regardless its
> value, so that uninitialized structures gets the correct boolean value.
>
> Note that no mainline code is affected by the current behavior.
>
> Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Applied.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-03-29 5:05 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-28 19:09 [PATCH net-next] net: dsa: mv88e6xxx: unconditionally set ATU trunk Vivien Didelot
2017-03-28 19:26 ` Andrew Lunn
2017-03-28 19:29 ` Florian Fainelli
2017-03-29 5:05 ` 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).