Skip to content

Commit 46f85a9

Browse files
JuliaLawalldavem330
authored andcommitted
chelsio: constify cphy_ops structures
The cphy_ops structures are never modified, so declare them as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 4667861 commit 46f85a9

File tree

8 files changed

+14
-14
lines changed

8 files changed

+14
-14
lines changed

drivers/net/ethernet/chelsio/cxgb/cphy.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ static inline int simple_mdio_write(struct cphy *cphy, int reg,
137137

138138
/* Convenience initializer */
139139
static inline void cphy_init(struct cphy *phy, struct net_device *dev,
140-
int phy_addr, struct cphy_ops *phy_ops,
140+
int phy_addr, const struct cphy_ops *phy_ops,
141141
const struct mdio_ops *mdio_ops)
142142
{
143143
struct adapter *adapter = netdev_priv(dev);

drivers/net/ethernet/chelsio/cxgb/mv88e1xxx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ static void mv88e1xxx_destroy(struct cphy *cphy)
337337
kfree(cphy);
338338
}
339339

340-
static struct cphy_ops mv88e1xxx_ops = {
340+
static const struct cphy_ops mv88e1xxx_ops = {
341341
.destroy = mv88e1xxx_destroy,
342342
.reset = mv88e1xxx_reset,
343343
.interrupt_enable = mv88e1xxx_interrupt_enable,

drivers/net/ethernet/chelsio/cxgb/mv88x201x.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ static void mv88x201x_destroy(struct cphy *cphy)
195195
kfree(cphy);
196196
}
197197

198-
static struct cphy_ops mv88x201x_ops = {
198+
static const struct cphy_ops mv88x201x_ops = {
199199
.destroy = mv88x201x_destroy,
200200
.reset = mv88x201x_reset,
201201
.interrupt_enable = mv88x201x_interrupt_enable,

drivers/net/ethernet/chelsio/cxgb/my3126.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ static void my3126_destroy(struct cphy *cphy)
154154
kfree(cphy);
155155
}
156156

157-
static struct cphy_ops my3126_ops = {
157+
static const struct cphy_ops my3126_ops = {
158158
.destroy = my3126_destroy,
159159
.reset = my3126_reset,
160160
.interrupt_enable = my3126_interrupt_enable,

drivers/net/ethernet/chelsio/cxgb3/ael1002.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ static int get_link_status_r(struct cphy *phy, int *link_ok, int *speed,
198198
return 0;
199199
}
200200

201-
static struct cphy_ops ael1002_ops = {
201+
static const struct cphy_ops ael1002_ops = {
202202
.reset = ael1002_reset,
203203
.intr_enable = ael1002_intr_noop,
204204
.intr_disable = ael1002_intr_noop,
@@ -224,7 +224,7 @@ static int ael1006_reset(struct cphy *phy, int wait)
224224
return t3_phy_reset(phy, MDIO_MMD_PMAPMD, wait);
225225
}
226226

227-
static struct cphy_ops ael1006_ops = {
227+
static const struct cphy_ops ael1006_ops = {
228228
.reset = ael1006_reset,
229229
.intr_enable = t3_phy_lasi_intr_enable,
230230
.intr_disable = t3_phy_lasi_intr_disable,
@@ -495,7 +495,7 @@ static int ael2005_intr_handler(struct cphy *phy)
495495
return ret ? ret : cphy_cause_link_change;
496496
}
497497

498-
static struct cphy_ops ael2005_ops = {
498+
static const struct cphy_ops ael2005_ops = {
499499
.reset = ael2005_reset,
500500
.intr_enable = ael2005_intr_enable,
501501
.intr_disable = ael2005_intr_disable,
@@ -801,7 +801,7 @@ static int ael2020_intr_handler(struct cphy *phy)
801801
return ret ? ret : cphy_cause_link_change;
802802
}
803803

804-
static struct cphy_ops ael2020_ops = {
804+
static const struct cphy_ops ael2020_ops = {
805805
.reset = ael2020_reset,
806806
.intr_enable = ael2020_intr_enable,
807807
.intr_disable = ael2020_intr_disable,
@@ -856,7 +856,7 @@ static int get_link_status_x(struct cphy *phy, int *link_ok, int *speed,
856856
return 0;
857857
}
858858

859-
static struct cphy_ops qt2045_ops = {
859+
static const struct cphy_ops qt2045_ops = {
860860
.reset = ael1006_reset,
861861
.intr_enable = t3_phy_lasi_intr_enable,
862862
.intr_disable = t3_phy_lasi_intr_disable,
@@ -921,7 +921,7 @@ static int xaui_direct_power_down(struct cphy *phy, int enable)
921921
return 0;
922922
}
923923

924-
static struct cphy_ops xaui_direct_ops = {
924+
static const struct cphy_ops xaui_direct_ops = {
925925
.reset = xaui_direct_reset,
926926
.intr_enable = ael1002_intr_noop,
927927
.intr_disable = ael1002_intr_noop,

drivers/net/ethernet/chelsio/cxgb3/aq100x.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ static int aq100x_get_link_status(struct cphy *phy, int *link_ok,
247247
return 0;
248248
}
249249

250-
static struct cphy_ops aq100x_ops = {
250+
static const struct cphy_ops aq100x_ops = {
251251
.reset = aq100x_reset,
252252
.intr_enable = aq100x_intr_enable,
253253
.intr_disable = aq100x_intr_disable,

drivers/net/ethernet/chelsio/cxgb3/common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ static inline int t3_mdio_write(struct cphy *phy, int mmd, int reg,
575575

576576
/* Convenience initializer */
577577
static inline void cphy_init(struct cphy *phy, struct adapter *adapter,
578-
int phy_addr, struct cphy_ops *phy_ops,
578+
int phy_addr, const struct cphy_ops *phy_ops,
579579
const struct mdio_ops *mdio_ops,
580580
unsigned int caps, const char *desc)
581581
{

drivers/net/ethernet/chelsio/cxgb3/vsc8211.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ static int vsc8211_intr_handler(struct cphy *cphy)
336336
return cphy_cause;
337337
}
338338

339-
static struct cphy_ops vsc8211_ops = {
339+
static const struct cphy_ops vsc8211_ops = {
340340
.reset = vsc8211_reset,
341341
.intr_enable = vsc8211_intr_enable,
342342
.intr_disable = vsc8211_intr_disable,
@@ -350,7 +350,7 @@ static struct cphy_ops vsc8211_ops = {
350350
.power_down = vsc8211_power_down,
351351
};
352352

353-
static struct cphy_ops vsc8211_fiber_ops = {
353+
static const struct cphy_ops vsc8211_fiber_ops = {
354354
.reset = vsc8211_reset,
355355
.intr_enable = vsc8211_intr_enable,
356356
.intr_disable = vsc8211_intr_disable,

0 commit comments

Comments
 (0)