stmmac: make function tables const
authorstephen hemminger <shemminger@vyatta.com>
Wed, 13 Oct 2010 14:51:25 +0000 (14:51 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sat, 16 Oct 2010 18:13:25 +0000 (11:13 -0700)
These tables only contain function pointers.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Acked-by: Gustavo F. Padovan <padovan@profusion.mobi>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/stmmac/common.h
drivers/net/stmmac/dwmac100.h
drivers/net/stmmac/dwmac1000.h
drivers/net/stmmac/dwmac1000_core.c
drivers/net/stmmac/dwmac1000_dma.c
drivers/net/stmmac/dwmac100_core.c
drivers/net/stmmac/dwmac100_dma.c
drivers/net/stmmac/enh_desc.c
drivers/net/stmmac/norm_desc.c
drivers/net/stmmac/stmmac.h

index dec7ce40c27a05e707cb141c9f5419b8c231db3f..375ea193e139a4a1bd23ecf68937007402682745 100644 (file)
@@ -235,9 +235,9 @@ struct mii_regs {
 };
 
 struct mac_device_info {
-       struct stmmac_ops       *mac;
-       struct stmmac_desc_ops  *desc;
-       struct stmmac_dma_ops   *dma;
+       const struct stmmac_ops         *mac;
+       const struct stmmac_desc_ops    *desc;
+       const struct stmmac_dma_ops     *dma;
        struct mii_regs mii;    /* MII register Addresses */
        struct mac_link link;
 };
index 97956cbf1cb4de2a374e0626f20df4977e680fd1..7c6d857a9cc7f0c357bb7b1d0cb9d417ecbc25a5 100644 (file)
@@ -118,4 +118,4 @@ enum ttc_control {
 #define DMA_MISSED_FRAME_OVE_M 0x00010000      /* Missed Frame Overflow */
 #define DMA_MISSED_FRAME_M_CNTR        0x0000ffff      /* Missed Frame Couinter */
 
-extern struct stmmac_dma_ops dwmac100_dma_ops;
+extern const struct stmmac_dma_ops dwmac100_dma_ops;
index 81ee4fd04386d0163585fc731461af254911fee2..cfcef0ea0fa5db049120c5a2f097d031b29330a8 100644 (file)
@@ -205,4 +205,4 @@ enum rtc_control {
 #define GMAC_MMC_TX_INTR   0x108
 #define GMAC_MMC_RX_CSUM_OFFLOAD   0x208
 
-extern struct stmmac_dma_ops dwmac1000_dma_ops;
+extern const struct stmmac_dma_ops dwmac1000_dma_ops;
index 65667b692024f26b78cc0d01819a5aa96fb8c323..6ae4c3f4c63c712031b4ca67549a8d8f631ed9fd 100644 (file)
@@ -212,7 +212,7 @@ static void dwmac1000_irq_status(void __iomem *ioaddr)
        }
 }
 
-struct stmmac_ops dwmac1000_ops = {
+static const struct stmmac_ops dwmac1000_ops = {
        .core_init = dwmac1000_core_init,
        .rx_coe = dwmac1000_rx_coe_supported,
        .dump_regs = dwmac1000_dump_regs,
index ce6163e39cd540416c1c286f5d9aae77cd397adf..2c47712d45d05cbe7ffddc792f62cf362e6c310c 100644 (file)
@@ -138,7 +138,7 @@ static void dwmac1000_dump_dma_regs(void __iomem *ioaddr)
        }
 }
 
-struct stmmac_dma_ops dwmac1000_dma_ops = {
+const struct stmmac_dma_ops dwmac1000_dma_ops = {
        .init = dwmac1000_dma_init,
        .dump_regs = dwmac1000_dump_dma_regs,
        .dma_mode = dwmac1000_dma_operation_mode,
index 94eeccf3a8a0cb0eb33f3c9b7878d9499ddba72b..c724fc36a24fd696557c32afc87f0cdc6835ba0c 100644 (file)
@@ -168,7 +168,7 @@ static void dwmac100_pmt(void __iomem *ioaddr, unsigned long mode)
        return;
 }
 
-struct stmmac_ops dwmac100_ops = {
+static const struct stmmac_ops dwmac100_ops = {
        .core_init = dwmac100_core_init,
        .rx_coe = dwmac100_rx_coe_supported,
        .dump_regs = dwmac100_dump_mac_regs,
index 96aac93b789b9bc690234cb0c259cedd7aa846d2..e3e224b7d9e23c6903a0f970ae4c7cd0c8491192 100644 (file)
@@ -126,7 +126,7 @@ static void dwmac100_dma_diagnostic_fr(void *data, struct stmmac_extra_stats *x,
        }
 }
 
-struct stmmac_dma_ops dwmac100_dma_ops = {
+const struct stmmac_dma_ops dwmac100_dma_ops = {
        .init = dwmac100_dma_init,
        .dump_regs = dwmac100_dump_dma_regs,
        .dma_mode = dwmac100_dma_operation_mode,
index 5d1471d8f8f69d6b355d926a8672f8ebc0e59000..e5dfb6a30182a114e198d4955ac08ee303dd7f41 100644 (file)
@@ -318,7 +318,7 @@ static int enh_desc_get_rx_frame_len(struct dma_desc *p)
        return p->des01.erx.frame_length;
 }
 
-struct stmmac_desc_ops enh_desc_ops = {
+const struct stmmac_desc_ops enh_desc_ops = {
        .tx_status = enh_desc_get_tx_status,
        .rx_status = enh_desc_get_rx_status,
        .get_tx_len = enh_desc_get_tx_len,
index 0dce90cb81247b68418d40a23a17a50a53fbac36..cd0cc76f7a1c8d3fbc3daf615a0c438a2880c07f 100644 (file)
@@ -202,7 +202,7 @@ static int ndesc_get_rx_frame_len(struct dma_desc *p)
        return p->des01.rx.frame_length;
 }
 
-struct stmmac_desc_ops ndesc_ops = {
+const struct stmmac_desc_ops ndesc_ops = {
        .tx_status = ndesc_get_tx_status,
        .rx_status = ndesc_get_rx_status,
        .get_tx_len = ndesc_get_tx_len,
index 92154ff7d70203cc3c6cbc7f710a46ba36831033..79bdc2e1322489d4fc226409b4f3bb50f549bf48 100644 (file)
@@ -121,5 +121,5 @@ static inline int stmmac_claim_resource(struct platform_device *pdev)
 extern int stmmac_mdio_unregister(struct net_device *ndev);
 extern int stmmac_mdio_register(struct net_device *ndev);
 extern void stmmac_set_ethtool_ops(struct net_device *netdev);
-extern struct stmmac_desc_ops enh_desc_ops;
-extern struct stmmac_desc_ops ndesc_ops;
+extern const struct stmmac_desc_ops enh_desc_ops;
+extern const struct stmmac_desc_ops ndesc_ops;