Skip to content

Commit

Permalink
qlcnic: constify qlcnic_dcb_ops structures
Browse files Browse the repository at this point in the history
The qlcnic_dcb_ops structures are never modified, so declare them as const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Julia Lawall authored and David S. Miller committed Dec 28, 2015
1 parent ae49841 commit f456882
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ struct qlcnic_dcb_cfg {
u32 version;
};

static struct qlcnic_dcb_ops qlcnic_83xx_dcb_ops = {
static const struct qlcnic_dcb_ops qlcnic_83xx_dcb_ops = {
.init_dcbnl_ops = __qlcnic_init_dcbnl_ops,
.free = __qlcnic_dcb_free,
.attach = __qlcnic_dcb_attach,
Expand All @@ -180,7 +180,7 @@ static struct qlcnic_dcb_ops qlcnic_83xx_dcb_ops = {
.aen_handler = qlcnic_83xx_dcb_aen_handler,
};

static struct qlcnic_dcb_ops qlcnic_82xx_dcb_ops = {
static const struct qlcnic_dcb_ops qlcnic_82xx_dcb_ops = {
.init_dcbnl_ops = __qlcnic_init_dcbnl_ops,
.free = __qlcnic_dcb_free,
.attach = __qlcnic_dcb_attach,
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ struct qlcnic_dcb {
struct qlcnic_adapter *adapter;
struct delayed_work aen_work;
struct workqueue_struct *wq;
struct qlcnic_dcb_ops *ops;
const struct qlcnic_dcb_ops *ops;
struct qlcnic_dcb_cfg *cfg;
unsigned long state;
};
Expand Down

0 comments on commit f456882

Please sign in to comment.