Patchwork bridge: make port attributes const

login
register
mail settings
Submitter stephen hemminger
Date July 30, 2012, 6:55 p.m.
Message ID <20120730115549.0d53d8cb@nehalam.linuxnetplumber.net>
Download mbox | patch
Permalink /patch/174075/
State Accepted
Delegated to: David Miller
Headers show

Comments

stephen hemminger - July 30, 2012, 6:55 p.m.
Simple table that can be marked const.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

---
 net/bridge/br_sysfs_br.c |  136 +++++++++++++++++++++++------------------------
 net/bridge/br_sysfs_if.c |    6 +-
 3 files changed, 73 insertions(+), 71 deletions(-)


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller - July 30, 2012, 9:56 p.m.
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Mon, 30 Jul 2012 11:55:49 -0700

> Simple table that can be marked const.
> 
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

--- a/net/bridge/br_sysfs_if.c	2012-07-19 15:35:29.062250368 -0700
+++ b/net/bridge/br_sysfs_if.c	2012-07-19 15:36:10.843427691 -0700
@@ -27,7 +27,7 @@  struct brport_attribute {
 };
 
 #define BRPORT_ATTR(_name,_mode,_show,_store)		        \
-struct brport_attribute brport_attr_##_name = { 	        \
+const struct brport_attribute brport_attr_##_name = { 	        \
 	.attr = {.name = __stringify(_name), 			\
 		 .mode = _mode },				\
 	.show	= _show,					\
@@ -164,7 +164,7 @@  static BRPORT_ATTR(multicast_router, S_I
 		   store_multicast_router);
 #endif
 
-static struct brport_attribute *brport_attrs[] = {
+static const struct brport_attribute *brport_attrs[] = {
 	&brport_attr_path_cost,
 	&brport_attr_priority,
 	&brport_attr_port_id,
@@ -241,7 +241,7 @@  const struct sysfs_ops brport_sysfs_ops
 int br_sysfs_addif(struct net_bridge_port *p)
 {
 	struct net_bridge *br = p->br;
-	struct brport_attribute **a;
+	const struct brport_attribute **a;
 	int err;
 
 	err = sysfs_create_link(&p->kobj, &br->dev->dev.kobj,