Using static const generally increases object text and decreases data size.
It also generally decreases overall object size.
Signed-off-by: Joe Perches <joe@perches.com>
 struct net_device * __init el1_probe(int unit)
 {
        struct net_device *dev = alloc_etherdev(sizeof(struct net_local));
-       static unsigned ports[] = { 0x280, 0x300, 0};
-       unsigned *port;
+       static const unsigned ports[] = { 0x280, 0x300, 0};
+       const unsigned *port;
        int err = 0;
 
        if (!dev)
 
     int retval;
 
     if (dev->irq < 2) {
-       int irqlist[] = {5, 9, 3, 4, 0};
-       int *irqp = irqlist;
+       static const int irqlist[] = {5, 9, 3, 4, 0};
+       const int *irqp = irqlist;
 
        outb(EGACFR_NORM, E33G_GACFR);  /* Enable RAM and interrupts. */
        do {
 
 struct net_device * __init el16_probe(int unit)
 {
        struct net_device *dev = alloc_etherdev(sizeof(struct net_local));
-       static unsigned ports[] = { 0x300, 0x320, 0x340, 0x280, 0};
-       unsigned *port;
+       static const unsigned ports[] = { 0x300, 0x320, 0x340, 0x280, 0};
+       const unsigned *port;
        int err = -ENODEV;
 
        if (!dev)
 
        u8 POS;
        u32 base;
        struct mc32_local *lp = netdev_priv(dev);
-       static u16 mca_io_bases[]={
+       static const u16 mca_io_bases[] = {
                0x7280,0x7290,
                0x7680,0x7690,
                0x7A80,0x7A90,
                0x7E80,0x7E90
        };
-       static u32 mca_mem_bases[]={
+       static const u32 mca_mem_bases[] = {
                0x00C0000,
                0x00C4000,
                0x00C8000,
                0x00D8000,
                0x00DC000
        };
-       static char *failures[]={
+       static const char * const failures[] = {
                "Processor instruction",
                "Processor data bus",
                "Processor data bus",
 
 
 static int __init at1700_probe1(struct net_device *dev, int ioaddr)
 {
-       char fmv_irqmap[4] = {3, 7, 10, 15};
-       char fmv_irqmap_pnp[8] = {3, 4, 5, 7, 9, 10, 11, 15};
-       char at1700_irqmap[8] = {3, 4, 5, 9, 10, 11, 14, 15};
+       static const char fmv_irqmap[4] = {3, 7, 10, 15};
+       static const char fmv_irqmap_pnp[8] = {3, 4, 5, 7, 9, 10, 11, 15};
+       static const char at1700_irqmap[8] = {3, 4, 5, 9, 10, 11, 14, 15};
        unsigned int i, irq, is_fmv18x = 0, is_at1700 = 0;
        int slot, ret = -ENODEV;
        struct net_local *lp = netdev_priv(dev);
 
        u32 *p = _p, i, offset;
        u8 *orig_p = _p;
        struct bnx2 *bp = netdev_priv(dev);
-       u32 reg_boundaries[] = { 0x0000, 0x0098, 0x0400, 0x045c,
-                                0x0800, 0x0880, 0x0c00, 0x0c10,
-                                0x0c30, 0x0d08, 0x1000, 0x101c,
-                                0x1040, 0x1048, 0x1080, 0x10a4,
-                                0x1400, 0x1490, 0x1498, 0x14f0,
-                                0x1500, 0x155c, 0x1580, 0x15dc,
-                                0x1600, 0x1658, 0x1680, 0x16d8,
-                                0x1800, 0x1820, 0x1840, 0x1854,
-                                0x1880, 0x1894, 0x1900, 0x1984,
-                                0x1c00, 0x1c0c, 0x1c40, 0x1c54,
-                                0x1c80, 0x1c94, 0x1d00, 0x1d84,
-                                0x2000, 0x2030, 0x23c0, 0x2400,
-                                0x2800, 0x2820, 0x2830, 0x2850,
-                                0x2b40, 0x2c10, 0x2fc0, 0x3058,
-                                0x3c00, 0x3c94, 0x4000, 0x4010,
-                                0x4080, 0x4090, 0x43c0, 0x4458,
-                                0x4c00, 0x4c18, 0x4c40, 0x4c54,
-                                0x4fc0, 0x5010, 0x53c0, 0x5444,
-                                0x5c00, 0x5c18, 0x5c80, 0x5c90,
-                                0x5fc0, 0x6000, 0x6400, 0x6428,
-                                0x6800, 0x6848, 0x684c, 0x6860,
-                                0x6888, 0x6910, 0x8000 };
+       static const u32 reg_boundaries[] = {
+               0x0000, 0x0098, 0x0400, 0x045c,
+               0x0800, 0x0880, 0x0c00, 0x0c10,
+               0x0c30, 0x0d08, 0x1000, 0x101c,
+               0x1040, 0x1048, 0x1080, 0x10a4,
+               0x1400, 0x1490, 0x1498, 0x14f0,
+               0x1500, 0x155c, 0x1580, 0x15dc,
+               0x1600, 0x1658, 0x1680, 0x16d8,
+               0x1800, 0x1820, 0x1840, 0x1854,
+               0x1880, 0x1894, 0x1900, 0x1984,
+               0x1c00, 0x1c0c, 0x1c40, 0x1c54,
+               0x1c80, 0x1c94, 0x1d00, 0x1d84,
+               0x2000, 0x2030, 0x23c0, 0x2400,
+               0x2800, 0x2820, 0x2830, 0x2850,
+               0x2b40, 0x2c10, 0x2fc0, 0x3058,
+               0x3c00, 0x3c94, 0x4000, 0x4010,
+               0x4080, 0x4090, 0x43c0, 0x4458,
+               0x4c00, 0x4c18, 0x4c40, 0x4c54,
+               0x4fc0, 0x5010, 0x53c0, 0x5444,
+               0x5c00, 0x5c18, 0x5c80, 0x5c90,
+               0x5fc0, 0x6000, 0x6400, 0x6428,
+               0x6800, 0x6848, 0x684c, 0x6860,
+               0x6888, 0x6910, 0x8000
+       };
 
        regs->version = 0;
 
 
                printk(" %02X", station_addr[i]);
 
        if (dev->irq < 2) {
-               int irqlist[] = {15, 11, 10, 12, 5, 9, 3, 4};
+               static const int irqlist[] = {15, 11, 10, 12, 5, 9, 3, 4};
                for (i = 0; i < ARRAY_SIZE(irqlist); i++)
                        if (request_irq (irqlist[i], NULL, 0, "bogus", NULL) != -EBUSY) {
                                dev->irq = irqlist[i];
 
    there is non-reboot way to recover if something goes wrong.
    */
 
-static char irqrmap[] = {-1,-1,0,1,-1,2,-1,-1,-1,0,3,4,-1,-1,-1,-1};
-static char irqrmap2[] = {-1,-1,4,0,1,2,-1,3,-1,4,5,6,7,-1,-1,-1};
+static const char irqrmap[] = {-1,-1,0,1,-1,2,-1,-1,-1,0,3,4,-1,-1,-1,-1};
+static const char irqrmap2[] = {-1,-1,4,0,1,2,-1,3,-1,4,5,6,7,-1,-1,-1};
 static int     eepro_grab_irq(struct net_device *dev)
 {
-       int irqlist[] = { 3, 4, 5, 7, 9, 10, 11, 12, 0 };
-       int *irqp = irqlist, temp_reg, ioaddr = dev->base_addr;
+       static const int irqlist[] = { 3, 4, 5, 7, 9, 10, 11, 12, 0 };
+       const int *irqp = irqlist;
+       int temp_reg, ioaddr = dev->base_addr;
 
        eepro_sw2bank1(ioaddr); /* be CAREFUL, BANK 1 now */
 
 
                dev->dev_addr[i] = ((unsigned char *)hw_addr)[5-i];
 
        {
-               static char irqmap[]={0, 9, 3, 4, 5, 10, 11, 0};
+               static const char irqmap[] = { 0, 9, 3, 4, 5, 10, 11, 0 };
                unsigned short setupval = eexp_hw_readeeprom(ioaddr,0);
 
                /* Use the IRQ from EEPROM if none was given */
 
 static void gfar_halt_nodisable(struct net_device *dev);
 void gfar_start(struct net_device *dev);
 static void gfar_clear_exact_match(struct net_device *dev);
-static void gfar_set_mac_for_addr(struct net_device *dev, int num, u8 *addr);
+static void gfar_set_mac_for_addr(struct net_device *dev, int num,
+                                 const u8 *addr);
 static int gfar_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
 
 MODULE_AUTHOR("Freescale Semiconductor, Inc");
 static void gfar_clear_exact_match(struct net_device *dev)
 {
        int idx;
-       u8 zero_arr[MAC_ADDR_LEN] = {0,0,0,0,0,0};
+       static const u8 zero_arr[MAC_ADDR_LEN] = {0, 0, 0, 0, 0, 0};
 
        for(idx = 1;idx < GFAR_EM_NUM + 1;idx++)
-               gfar_set_mac_for_addr(dev, idx, (u8 *)zero_arr);
+               gfar_set_mac_for_addr(dev, idx, zero_arr);
 }
 
 /* Set the appropriate hash bit for the given addr */
 /* There are multiple MAC Address register pairs on some controllers
  * This function sets the numth pair to a given address
  */
-static void gfar_set_mac_for_addr(struct net_device *dev, int num, u8 *addr)
+static void gfar_set_mac_for_addr(struct net_device *dev, int num,
+                                 const u8 *addr)
 {
        struct gfar_private *priv = netdev_priv(dev);
        struct gfar __iomem *regs = priv->gfargrp[0].regs;
 
 
        /* Snarf the interrupt now.  Someday this could be moved to open(). */
        if (dev->irq < 2) {
-               int irq_16list[] = { 11, 10, 5, 3, 4, 7, 9, 0};
-               int irq_8list[] = { 7, 5, 3, 4, 9, 0};
-               int *irqp = wordmode ? irq_16list : irq_8list;
+               static const int irq_16list[] = { 11, 10, 5, 3, 4, 7, 9, 0};
+               static const int irq_8list[] = { 7, 5, 3, 4, 9, 0};
+               const int *irqp = wordmode ? irq_16list : irq_8list;
                do {
                        int irq = *irqp;
                        if (request_irq (irq, NULL, 0, "bogus", NULL) != -EBUSY) {
 
 
 static void
 jme_setup_wakeup_frame(struct jme_adapter *jme,
-               u32 *mask, u32 crc, int fnr)
+                      const u32 *mask, u32 crc, int fnr)
 {
        int i;
 
 static inline void
 jme_reset_mac_processor(struct jme_adapter *jme)
 {
-       u32 mask[WAKEUP_FRAME_MASK_DWNR] = {0, 0, 0, 0};
+       static const u32 mask[WAKEUP_FRAME_MASK_DWNR] = {0, 0, 0, 0};
        u32 crc = 0xCDCDCDCD;
        u32 gpreg0;
        int i;
 
  * This routine is used to program Wake-on-LAN pattern.
  */
 static void hw_set_wol_frame(struct ksz_hw *hw, int i, uint mask_size,
-       u8 *mask, uint frame_size, u8 *pattern)
+       const u8 *mask, uint frame_size, const u8 *pattern)
 {
        int bits;
        int from;
  *
  * This routine is used to add ARP pattern for waking up the host.
  */
-static void hw_add_wol_arp(struct ksz_hw *hw, u8 *ip_addr)
+static void hw_add_wol_arp(struct ksz_hw *hw, const u8 *ip_addr)
 {
-       u8 mask[6] = { 0x3F, 0xF0, 0x3F, 0x00, 0xC0, 0x03 };
+       static const u8 mask[6] = { 0x3F, 0xF0, 0x3F, 0x00, 0xC0, 0x03 };
        u8 pattern[42] = {
                0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  */
 static void hw_add_wol_bcast(struct ksz_hw *hw)
 {
-       u8 mask[] = { 0x3F };
-       u8 pattern[] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
+       static const u8 mask[] = { 0x3F };
+       static const u8 pattern[] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
 
        hw_set_wol_frame(hw, 2, 1, mask, MAC_ADDR_LEN, pattern);
 }
  */
 static void hw_add_wol_mcast(struct ksz_hw *hw)
 {
-       u8 mask[] = { 0x3F };
+       static const u8 mask[] = { 0x3F };
        u8 pattern[] = { 0x33, 0x33, 0xFF, 0x00, 0x00, 0x00 };
 
        memcpy(&pattern[3], &hw->override_addr[3], 3);
  */
 static void hw_add_wol_ucast(struct ksz_hw *hw)
 {
-       u8 mask[] = { 0x3F };
+       static const u8 mask[] = { 0x3F };
 
        hw_set_wol_frame(hw, 0, 1, mask, MAC_ADDR_LEN, hw->override_addr);
 }
  *
  * This routine is used to enable Wake-on-LAN depending on driver settings.
  */
-static void hw_enable_wol(struct ksz_hw *hw, u32 wol_enable, u8 *net_addr)
+static void hw_enable_wol(struct ksz_hw *hw, u32 wol_enable, const u8 *net_addr)
 {
        hw_cfg_wol(hw, KS8841_WOL_MAGIC_ENABLE, (wol_enable & WAKE_MAGIC));
        hw_cfg_wol(hw, KS8841_WOL_FRAME0_ENABLE, (wol_enable & WAKE_UCAST));
        struct dev_info *hw_priv = priv->adapter;
 
        /* Need to find a way to retrieve the device IP address. */
-       u8 net_addr[] = { 192, 168, 1, 1 };
+       static const u8 net_addr[] = { 192, 168, 1, 1 };
 
        if (wol->wolopts & ~hw_priv->wol_support)
                return -EINVAL;
        struct ksz_hw *hw = &hw_priv->hw;
 
        /* Need to find a way to retrieve the device IP address. */
-       u8 net_addr[] = { 192, 168, 1, 1 };
+       static const u8 net_addr[] = { 192, 168, 1, 1 };
 
        for (i = 0; i < hw->dev_count; i++) {
                if (info->netdev[i]) {
 
 struct net_device * __init ni52_probe(int unit)
 {
        struct net_device *dev = alloc_etherdev(sizeof(struct priv));
-       static int ports[] = {0x300, 0x280, 0x360 , 0x320 , 0x340, 0};
+       static const int ports[] = {0x300, 0x280, 0x360, 0x320, 0x340, 0};
+       const int *port;
        struct priv *p;
-       int *port;
        int err = 0;
 
        if (!dev)
 
 struct net_device * __init ni65_probe(int unit)
 {
        struct net_device *dev = alloc_etherdev(0);
-       static int ports[] = {0x360,0x300,0x320,0x340, 0};
-       int *port;
+       static const int ports[] = { 0x360, 0x300, 0x320, 0x340, 0 };
+       const int *port;
        int err = 0;
 
        if (!dev)
 
 
                val = mdio_read(ioaddr, 0x0d);
                if ((val & 0x00ff) != 0x006c) {
-                       u32 set[] = {
+                       static const u32 set[] = {
                                0x0065, 0x0066, 0x0067, 0x0068,
                                0x0069, 0x006a, 0x006b, 0x006c
                        };
 
 
 static void genesis_reset(struct skge_hw *hw, int port)
 {
-       const u8 zero[8]  = { 0 };
+       static const u8 zero[8]  = { 0 };
        u32 reg;
 
        skge_write8(hw, SK_REG(port, GMAC_IRQ_MSK), 0);
        int jumbo = hw->dev[port]->mtu > ETH_DATA_LEN;
        int i;
        u32 r;
-       const u8 zero[6]  = { 0 };
+       static const u8 zero[6]  = { 0 };
 
        for (i = 0; i < 10; i++) {
                skge_write16(hw, SK_REG(port, TX_MFF_CTRL1),
 
        dev->base_addr = ioaddr+ULTRA_NIC_OFFSET;
 
        {
-               int addr_tbl[4] = {0x0C0000, 0x0E0000, 0xFC0000, 0xFE0000};
-               short num_pages_tbl[4] = {0x20, 0x40, 0x80, 0xff};
+               static const int addr_tbl[4] = {
+                       0x0C0000, 0x0E0000, 0xFC0000, 0xFE0000
+               };
+               static const short num_pages_tbl[4] = {
+                       0x20, 0x40, 0x80, 0xff
+               };
 
                dev->mem_start = ((addr & 0x0f) << 13) + addr_tbl[(addr >> 6) & 3] ;
                num_pages = num_pages_tbl[(addr >> 4) & 3];
 
        dev->base_addr = ioaddr+WD_NIC_OFFSET;
 
        if (dev->irq < 2) {
-               int irqmap[] = {9,3,5,7,10,11,15,4};
+               static const int irqmap[] = {9, 3, 5, 7, 10, 11, 15, 4};
                int reg1 = inb(ioaddr+1);
                int reg4 = inb(ioaddr+4);
                if (ancient || reg1 == 0xff) {  /* Ack!! No way to read the IRQ! */