* [PATCH 0/3] constify dsa_switch_ops
@ 2017-08-23 10:16 Arvind Yadav
2017-08-23 10:16 ` [PATCH 1/3] net: dsa: loop: " Arvind Yadav
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Arvind Yadav @ 2017-08-23 10:16 UTC (permalink / raw)
To: andrew, vivien.didelot, f.fainelli; +Cc: linux-kernel, netdev
dsa_switch_ops are not supposed to change at runtime. All functions
working with dsa_switch_ops provided by <net/dsa.h> work with
const dsa_switch_ops. So mark the non-const structs as const.
Arvind Yadav (3):
[PATCH 1/3] net: dsa: loop: constify dsa_switch_ops
[PATCH 2/3] net: dsa: lan9303: constify dsa_switch_ops
[PATCH 3/3] net: dsa: mt7530: constify dsa_switch_ops
drivers/net/dsa/dsa_loop.c | 2 +-
drivers/net/dsa/lan9303-core.c | 2 +-
drivers/net/dsa/mt7530.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
--
1.9.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/3] net: dsa: loop: constify dsa_switch_ops
2017-08-23 10:16 [PATCH 0/3] constify dsa_switch_ops Arvind Yadav
@ 2017-08-23 10:16 ` Arvind Yadav
2017-08-23 10:16 ` [PATCH 2/3] net: dsa: lan9303: " Arvind Yadav
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Arvind Yadav @ 2017-08-23 10:16 UTC (permalink / raw)
To: andrew, vivien.didelot, f.fainelli; +Cc: linux-kernel, netdev
dsa_switch_ops are not supposed to change at runtime. All functions
working with dsa_switch_ops provided by <net/dsa.h> work with
const dsa_switch_ops. So mark the non-const structs as const.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
drivers/net/dsa/dsa_loop.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/dsa/dsa_loop.c b/drivers/net/dsa/dsa_loop.c
index fdd8f38..2418172 100644
--- a/drivers/net/dsa/dsa_loop.c
+++ b/drivers/net/dsa/dsa_loop.c
@@ -294,7 +294,7 @@ static int dsa_loop_port_vlan_dump(struct dsa_switch *ds, int port,
return err;
}
-static struct dsa_switch_ops dsa_loop_driver = {
+static const struct dsa_switch_ops dsa_loop_driver = {
.get_tag_protocol = dsa_loop_get_protocol,
.setup = dsa_loop_setup,
.get_strings = dsa_loop_get_strings,
--
1.9.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/3] net: dsa: lan9303: constify dsa_switch_ops
2017-08-23 10:16 [PATCH 0/3] constify dsa_switch_ops Arvind Yadav
2017-08-23 10:16 ` [PATCH 1/3] net: dsa: loop: " Arvind Yadav
@ 2017-08-23 10:16 ` Arvind Yadav
2017-08-23 10:16 ` [PATCH 3/3] net: dsa: mt7530: " Arvind Yadav
2017-08-23 12:45 ` [PATCH 0/3] " Andrew Lunn
3 siblings, 0 replies; 6+ messages in thread
From: Arvind Yadav @ 2017-08-23 10:16 UTC (permalink / raw)
To: andrew, vivien.didelot, f.fainelli; +Cc: linux-kernel, netdev
dsa_switch_ops are not supposed to change at runtime. All functions
working with dsa_switch_ops provided by <net/dsa.h> work with
const dsa_switch_ops. So mark the non-const structs as const.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
drivers/net/dsa/lan9303-core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/dsa/lan9303-core.c b/drivers/net/dsa/lan9303-core.c
index cd76e61..d4820d2 100644
--- a/drivers/net/dsa/lan9303-core.c
+++ b/drivers/net/dsa/lan9303-core.c
@@ -780,7 +780,7 @@ static void lan9303_port_disable(struct dsa_switch *ds, int port,
}
}
-static struct dsa_switch_ops lan9303_switch_ops = {
+static const struct dsa_switch_ops lan9303_switch_ops = {
.get_tag_protocol = lan9303_get_tag_protocol,
.setup = lan9303_setup,
.get_strings = lan9303_get_strings,
--
1.9.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/3] net: dsa: mt7530: constify dsa_switch_ops
2017-08-23 10:16 [PATCH 0/3] constify dsa_switch_ops Arvind Yadav
2017-08-23 10:16 ` [PATCH 1/3] net: dsa: loop: " Arvind Yadav
2017-08-23 10:16 ` [PATCH 2/3] net: dsa: lan9303: " Arvind Yadav
@ 2017-08-23 10:16 ` Arvind Yadav
2017-08-23 12:45 ` [PATCH 0/3] " Andrew Lunn
3 siblings, 0 replies; 6+ messages in thread
From: Arvind Yadav @ 2017-08-23 10:16 UTC (permalink / raw)
To: andrew, vivien.didelot, f.fainelli; +Cc: linux-kernel, netdev
dsa_switch_ops are not supposed to change at runtime. All functions
working with dsa_switch_ops provided by <net/dsa.h> work with
const dsa_switch_ops. So mark the non-const structs as const.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
drivers/net/dsa/mt7530.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c
index 264b281..77ae576 100644
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -1039,7 +1039,7 @@ static void mt7530_adjust_link(struct dsa_switch *ds, int port,
return 0;
}
-static struct dsa_switch_ops mt7530_switch_ops = {
+static const struct dsa_switch_ops mt7530_switch_ops = {
.get_tag_protocol = mtk_get_tag_protocol,
.setup = mt7530_setup,
.get_strings = mt7530_get_strings,
--
1.9.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 0/3] constify dsa_switch_ops
2017-08-23 10:16 [PATCH 0/3] constify dsa_switch_ops Arvind Yadav
` (2 preceding siblings ...)
2017-08-23 10:16 ` [PATCH 3/3] net: dsa: mt7530: " Arvind Yadav
@ 2017-08-23 12:45 ` Andrew Lunn
2017-08-24 5:30 ` David Miller
3 siblings, 1 reply; 6+ messages in thread
From: Andrew Lunn @ 2017-08-23 12:45 UTC (permalink / raw)
To: Arvind Yadav; +Cc: vivien.didelot, f.fainelli, linux-kernel, netdev
On Wed, Aug 23, 2017 at 03:46:56PM +0530, Arvind Yadav wrote:
> dsa_switch_ops are not supposed to change at runtime. All functions
> working with dsa_switch_ops provided by <net/dsa.h> work with
> const dsa_switch_ops. So mark the non-const structs as const.
>
> Arvind Yadav (3):
> [PATCH 1/3] net: dsa: loop: constify dsa_switch_ops
> [PATCH 2/3] net: dsa: lan9303: constify dsa_switch_ops
> [PATCH 3/3] net: dsa: mt7530: constify dsa_switch_ops
For the whole series:
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 0/3] constify dsa_switch_ops
2017-08-23 12:45 ` [PATCH 0/3] " Andrew Lunn
@ 2017-08-24 5:30 ` David Miller
0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2017-08-24 5:30 UTC (permalink / raw)
To: andrew; +Cc: arvind.yadav.cs, vivien.didelot, f.fainelli, linux-kernel, netdev
From: Andrew Lunn <andrew@lunn.ch>
Date: Wed, 23 Aug 2017 14:45:56 +0200
> On Wed, Aug 23, 2017 at 03:46:56PM +0530, Arvind Yadav wrote:
>> dsa_switch_ops are not supposed to change at runtime. All functions
>> working with dsa_switch_ops provided by <net/dsa.h> work with
>> const dsa_switch_ops. So mark the non-const structs as const.
>>
>> Arvind Yadav (3):
>> [PATCH 1/3] net: dsa: loop: constify dsa_switch_ops
>> [PATCH 2/3] net: dsa: lan9303: constify dsa_switch_ops
>> [PATCH 3/3] net: dsa: mt7530: constify dsa_switch_ops
>
> For the whole series:
>
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
None of these patches apply to net-next, things are const there
already.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2017-08-24 5:30 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-23 10:16 [PATCH 0/3] constify dsa_switch_ops Arvind Yadav
2017-08-23 10:16 ` [PATCH 1/3] net: dsa: loop: " Arvind Yadav
2017-08-23 10:16 ` [PATCH 2/3] net: dsa: lan9303: " Arvind Yadav
2017-08-23 10:16 ` [PATCH 3/3] net: dsa: mt7530: " Arvind Yadav
2017-08-23 12:45 ` [PATCH 0/3] " Andrew Lunn
2017-08-24 5:30 ` 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).