On Tue, Sep 23, 2014 at 7:02 AM, Thomas Graf <tg...@noironetworks.com> wrote: > Help produce better optimized code. >
I found few more variable to Constify, so I updated patch and pushed to master. Thanks. > Signed-off-by: Thomas Graf <tg...@noironetworks.com> > --- > datapath/actions.c | 2 +- > datapath/datapath.c | 4 ++-- > datapath/datapath.h | 2 +- > datapath/flow_table.c | 2 +- > datapath/flow_table.h | 2 +- > datapath/vport-netdev.c | 2 +- > datapath/vport.c | 4 ++-- > datapath/vport.h | 2 +- > 8 files changed, 10 insertions(+), 10 deletions(-) > > diff --git a/datapath/actions.c b/datapath/actions.c > index c3f9427..8eb7931 100644 > --- a/datapath/actions.c > +++ b/datapath/actions.c > @@ -71,7 +71,7 @@ static void action_fifo_init(struct action_fifo *fifo) > fifo->tail = 0; > } > > -static bool action_fifo_is_empty(struct action_fifo *fifo) > +static bool action_fifo_is_empty(const struct action_fifo *fifo) > { > return (fifo->head == fifo->tail); > } > diff --git a/datapath/datapath.c b/datapath/datapath.c > index 170e8ea..456162c 100644 > --- a/datapath/datapath.c > +++ b/datapath/datapath.c > @@ -175,7 +175,7 @@ const char *ovs_dp_name(const struct datapath *dp) > return vport->ops->get_name(vport); > } > > -static int get_dpifindex(struct datapath *dp) > +static int get_dpifindex(const struct datapath *dp) > { > struct vport *local; > int ifindex; > @@ -631,7 +631,7 @@ static struct genl_family dp_packet_genl_family = { > .n_ops = ARRAY_SIZE(dp_packet_genl_ops), > }; > > -static void get_dp_stats(struct datapath *dp, struct ovs_dp_stats *stats, > +static void get_dp_stats(const struct datapath *dp, struct ovs_dp_stats > *stats, > struct ovs_dp_megaflow_stats *mega_stats) > { > int i; > diff --git a/datapath/datapath.h b/datapath/datapath.h > index b30a9a4..fd17552 100644 > --- a/datapath/datapath.h > +++ b/datapath/datapath.h > @@ -152,7 +152,7 @@ int lockdep_ovsl_is_held(void); > #define rcu_dereference_ovsl(p) \ > rcu_dereference_check(p, lockdep_ovsl_is_held()) > > -static inline struct net *ovs_dp_get_net(struct datapath *dp) > +static inline struct net *ovs_dp_get_net(const struct datapath *dp) > { > return read_pnet(&dp->net); > } > diff --git a/datapath/flow_table.c b/datapath/flow_table.c > index 10bf830..9c68205 100644 > --- a/datapath/flow_table.c > +++ b/datapath/flow_table.c > @@ -114,7 +114,7 @@ err: > return ERR_PTR(-ENOMEM); > } > > -int ovs_flow_tbl_count(struct flow_table *table) > +int ovs_flow_tbl_count(const struct flow_table *table) > { > return table->count; > } > diff --git a/datapath/flow_table.h b/datapath/flow_table.h > index a05d36a..3ca13b7 100644 > --- a/datapath/flow_table.h > +++ b/datapath/flow_table.h > @@ -73,7 +73,7 @@ struct sw_flow *ovs_flow_alloc(void); > void ovs_flow_free(struct sw_flow *, bool deferred); > > int ovs_flow_tbl_init(struct flow_table *); > -int ovs_flow_tbl_count(struct flow_table *table); > +int ovs_flow_tbl_count(const struct flow_table *table); > void ovs_flow_tbl_destroy(struct flow_table *table); > int ovs_flow_tbl_flush(struct flow_table *flow_table); > > diff --git a/datapath/vport-netdev.c b/datapath/vport-netdev.c > index a00276b..c763491 100644 > --- a/datapath/vport-netdev.c > +++ b/datapath/vport-netdev.c > @@ -85,7 +85,7 @@ static struct sk_buff *netdev_frame_hook(struct > net_bridge_port *p, > #error > #endif > > -static struct net_device *get_dpdev(struct datapath *dp) > +static struct net_device *get_dpdev(const struct datapath *dp) > { > struct vport *local; > > diff --git a/datapath/vport.c b/datapath/vport.c > index de9bc23..ac082be 100644 > --- a/datapath/vport.c > +++ b/datapath/vport.c > @@ -82,7 +82,7 @@ void ovs_vport_exit(void) > kfree(dev_table); > } > > -static struct hlist_head *hash_bucket(struct net *net, const char *name) > +static struct hlist_head *hash_bucket(const struct net *net, const char > *name) > { > unsigned int hash = jhash(name, strlen(name), (unsigned long) net); > return &dev_table[hash & (VPORT_HASH_BUCKETS - 1)]; > @@ -95,7 +95,7 @@ static struct hlist_head *hash_bucket(struct net *net, > const char *name) > * > * Must be called with ovs or RCU read lock. > */ > -struct vport *ovs_vport_locate(struct net *net, const char *name) > +struct vport *ovs_vport_locate(const struct net *net, const char *name) > { > struct hlist_head *bucket = hash_bucket(net, name); > struct vport *vport; > diff --git a/datapath/vport.h b/datapath/vport.h > index a0cf3dd..a88055f 100644 > --- a/datapath/vport.h > +++ b/datapath/vport.h > @@ -43,7 +43,7 @@ void ovs_vport_exit(void); > struct vport *ovs_vport_add(const struct vport_parms *); > void ovs_vport_del(struct vport *); > > -struct vport *ovs_vport_locate(struct net *net, const char *name); > +struct vport *ovs_vport_locate(const struct net *net, const char *name); > > void ovs_vport_get_stats(struct vport *, struct ovs_vport_stats *); > > -- > 1.9.3 > > _______________________________________________ > dev mailing list > dev@openvswitch.org > http://openvswitch.org/mailman/listinfo/dev _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev