aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ksz884x.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2010-12-21 05:16:08 -0500
committerJoe Perches <joe@perches.com>2010-12-21 05:16:08 -0500
commitb6bc765067ece933cc3dc7f5e95665a89100b1d5 (patch)
treebbf55c2d80e839eb4c0ab23bcbdd656d14b3f5fe /drivers/net/ksz884x.c
parent895950c2a6565d9eefda4a38b00fa28537e39fcb (diff)
drivers/net/*.c: Use static const
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>
Diffstat (limited to 'drivers/net/ksz884x.c')
-rw-r--r--drivers/net/ksz884x.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/net/ksz884x.c b/drivers/net/ksz884x.c
index 37504a398906..49ea8708d6d0 100644
--- a/drivers/net/ksz884x.c
+++ b/drivers/net/ksz884x.c
@@ -3570,7 +3570,7 @@ static void hw_cfg_wol(struct ksz_hw *hw, u16 frame, int set)
3570 * This routine is used to program Wake-on-LAN pattern. 3570 * This routine is used to program Wake-on-LAN pattern.
3571 */ 3571 */
3572static void hw_set_wol_frame(struct ksz_hw *hw, int i, uint mask_size, 3572static void hw_set_wol_frame(struct ksz_hw *hw, int i, uint mask_size,
3573 u8 *mask, uint frame_size, u8 *pattern) 3573 const u8 *mask, uint frame_size, const u8 *pattern)
3574{ 3574{
3575 int bits; 3575 int bits;
3576 int from; 3576 int from;
@@ -3626,9 +3626,9 @@ static void hw_set_wol_frame(struct ksz_hw *hw, int i, uint mask_size,
3626 * 3626 *
3627 * This routine is used to add ARP pattern for waking up the host. 3627 * This routine is used to add ARP pattern for waking up the host.
3628 */ 3628 */
3629static void hw_add_wol_arp(struct ksz_hw *hw, u8 *ip_addr) 3629static void hw_add_wol_arp(struct ksz_hw *hw, const u8 *ip_addr)
3630{ 3630{
3631 u8 mask[6] = { 0x3F, 0xF0, 0x3F, 0x00, 0xC0, 0x03 }; 3631 static const u8 mask[6] = { 0x3F, 0xF0, 0x3F, 0x00, 0xC0, 0x03 };
3632 u8 pattern[42] = { 3632 u8 pattern[42] = {
3633 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 3633 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
3634 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 3634 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -3651,8 +3651,8 @@ static void hw_add_wol_arp(struct ksz_hw *hw, u8 *ip_addr)
3651 */ 3651 */
3652static void hw_add_wol_bcast(struct ksz_hw *hw) 3652static void hw_add_wol_bcast(struct ksz_hw *hw)
3653{ 3653{
3654 u8 mask[] = { 0x3F }; 3654 static const u8 mask[] = { 0x3F };
3655 u8 pattern[] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; 3655 static const u8 pattern[] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
3656 3656
3657 hw_set_wol_frame(hw, 2, 1, mask, MAC_ADDR_LEN, pattern); 3657 hw_set_wol_frame(hw, 2, 1, mask, MAC_ADDR_LEN, pattern);
3658} 3658}
@@ -3669,7 +3669,7 @@ static void hw_add_wol_bcast(struct ksz_hw *hw)
3669 */ 3669 */
3670static void hw_add_wol_mcast(struct ksz_hw *hw) 3670static void hw_add_wol_mcast(struct ksz_hw *hw)
3671{ 3671{
3672 u8 mask[] = { 0x3F }; 3672 static const u8 mask[] = { 0x3F };
3673 u8 pattern[] = { 0x33, 0x33, 0xFF, 0x00, 0x00, 0x00 }; 3673 u8 pattern[] = { 0x33, 0x33, 0xFF, 0x00, 0x00, 0x00 };
3674 3674
3675 memcpy(&pattern[3], &hw->override_addr[3], 3); 3675 memcpy(&pattern[3], &hw->override_addr[3], 3);
@@ -3687,7 +3687,7 @@ static void hw_add_wol_mcast(struct ksz_hw *hw)
3687 */ 3687 */
3688static void hw_add_wol_ucast(struct ksz_hw *hw) 3688static void hw_add_wol_ucast(struct ksz_hw *hw)
3689{ 3689{
3690 u8 mask[] = { 0x3F }; 3690 static const u8 mask[] = { 0x3F };
3691 3691
3692 hw_set_wol_frame(hw, 0, 1, mask, MAC_ADDR_LEN, hw->override_addr); 3692 hw_set_wol_frame(hw, 0, 1, mask, MAC_ADDR_LEN, hw->override_addr);
3693} 3693}
@@ -3700,7 +3700,7 @@ static void hw_add_wol_ucast(struct ksz_hw *hw)
3700 * 3700 *
3701 * This routine is used to enable Wake-on-LAN depending on driver settings. 3701 * This routine is used to enable Wake-on-LAN depending on driver settings.
3702 */ 3702 */
3703static void hw_enable_wol(struct ksz_hw *hw, u32 wol_enable, u8 *net_addr) 3703static void hw_enable_wol(struct ksz_hw *hw, u32 wol_enable, const u8 *net_addr)
3704{ 3704{
3705 hw_cfg_wol(hw, KS8841_WOL_MAGIC_ENABLE, (wol_enable & WAKE_MAGIC)); 3705 hw_cfg_wol(hw, KS8841_WOL_MAGIC_ENABLE, (wol_enable & WAKE_MAGIC));
3706 hw_cfg_wol(hw, KS8841_WOL_FRAME0_ENABLE, (wol_enable & WAKE_UCAST)); 3706 hw_cfg_wol(hw, KS8841_WOL_FRAME0_ENABLE, (wol_enable & WAKE_UCAST));
@@ -6208,7 +6208,7 @@ static int netdev_set_wol(struct net_device *dev,
6208 struct dev_info *hw_priv = priv->adapter; 6208 struct dev_info *hw_priv = priv->adapter;
6209 6209
6210 /* Need to find a way to retrieve the device IP address. */ 6210 /* Need to find a way to retrieve the device IP address. */
6211 u8 net_addr[] = { 192, 168, 1, 1 }; 6211 static const u8 net_addr[] = { 192, 168, 1, 1 };
6212 6212
6213 if (wol->wolopts & ~hw_priv->wol_support) 6213 if (wol->wolopts & ~hw_priv->wol_support)
6214 return -EINVAL; 6214 return -EINVAL;
@@ -7241,7 +7241,7 @@ static int pcidev_suspend(struct pci_dev *pdev, pm_message_t state)
7241 struct ksz_hw *hw = &hw_priv->hw; 7241 struct ksz_hw *hw = &hw_priv->hw;
7242 7242
7243 /* Need to find a way to retrieve the device IP address. */ 7243 /* Need to find a way to retrieve the device IP address. */
7244 u8 net_addr[] = { 192, 168, 1, 1 }; 7244 static const u8 net_addr[] = { 192, 168, 1, 1 };
7245 7245
7246 for (i = 0; i < hw->dev_count; i++) { 7246 for (i = 0; i < hw->dev_count; i++) {
7247 if (info->netdev[i]) { 7247 if (info->netdev[i]) {