Skip to content

Commit f456882

Browse files
JuliaLawalldavem330
authored andcommitted
qlcnic: constify qlcnic_dcb_ops structures
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>
1 parent ae49841 commit f456882

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ struct qlcnic_dcb_cfg {
167167
u32 version;
168168
};
169169

170-
static struct qlcnic_dcb_ops qlcnic_83xx_dcb_ops = {
170+
static const struct qlcnic_dcb_ops qlcnic_83xx_dcb_ops = {
171171
.init_dcbnl_ops = __qlcnic_init_dcbnl_ops,
172172
.free = __qlcnic_dcb_free,
173173
.attach = __qlcnic_dcb_attach,
@@ -180,7 +180,7 @@ static struct qlcnic_dcb_ops qlcnic_83xx_dcb_ops = {
180180
.aen_handler = qlcnic_83xx_dcb_aen_handler,
181181
};
182182

183-
static struct qlcnic_dcb_ops qlcnic_82xx_dcb_ops = {
183+
static const struct qlcnic_dcb_ops qlcnic_82xx_dcb_ops = {
184184
.init_dcbnl_ops = __qlcnic_init_dcbnl_ops,
185185
.free = __qlcnic_dcb_free,
186186
.attach = __qlcnic_dcb_attach,

drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ struct qlcnic_dcb {
3737
struct qlcnic_adapter *adapter;
3838
struct delayed_work aen_work;
3939
struct workqueue_struct *wq;
40-
struct qlcnic_dcb_ops *ops;
40+
const struct qlcnic_dcb_ops *ops;
4141
struct qlcnic_dcb_cfg *cfg;
4242
unsigned long state;
4343
};

0 commit comments

Comments
 (0)