diff options
author | Andy Shevchenko <andy.shevchenko@gmail.com> | 2010-10-16 13:11:12 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-10-19 10:04:17 -0700 |
commit | 2b6d83d6623dfc4ea036b62b405ce206edfcaa52 (patch) | |
tree | 1ed15bad13fdff86cfcef858873c739971cc2fa3 /drivers/staging/wlags49_h2 | |
parent | a113af9a35191901a2be532a7d70ee2dff8ad82d (diff) |
staging: wlags49_h2: remove useless DbgHwAddr() method
There is no needs to prepare string for MAC addresses beforehand, due to
kernel's *printf() have '%pM' format option.
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/wlags49_h2')
-rw-r--r-- | drivers/staging/wlags49_h2/wl_main.c | 73 | ||||
-rw-r--r-- | drivers/staging/wlags49_h2/wl_netdev.c | 3 | ||||
-rw-r--r-- | drivers/staging/wlags49_h2/wl_util.c | 70 | ||||
-rw-r--r-- | drivers/staging/wlags49_h2/wl_util.h | 5 | ||||
-rw-r--r-- | drivers/staging/wlags49_h2/wl_wext.c | 9 |
5 files changed, 66 insertions, 94 deletions
diff --git a/drivers/staging/wlags49_h2/wl_main.c b/drivers/staging/wlags49_h2/wl_main.c index 10a4709bcc78..00758aadb4ee 100644 --- a/drivers/staging/wlags49_h2/wl_main.c +++ b/drivers/staging/wlags49_h2/wl_main.c @@ -485,7 +485,10 @@ int wl_insert( struct net_device *dev ) //;? DBG_PARAM( DbgInfo, PARM_NAME_CREATE_IBSS, "\"%s\"", PARM_CREATE_IBSS ); //;? DBG_PARAM( DbgInfo, PARM_NAME_MULTICAST_RX, "\"%s\"", PARM_MULTICAST_RX ); //;? DBG_PARAM( DbgInfo, PARM_NAME_MAX_SLEEP, "%d", PARM_MAX_SLEEP ); -//;? DBG_PARAM( DbgInfo, PARM_NAME_NETWORK_ADDR, "\"%s\"", DbgHwAddr( PARM_NETWORK_ADDR )); +/* + DBG_PARAM(DbgInfo, PARM_NAME_NETWORK_ADDR, "\"%pM\"", + PARM_NETWORK_ADDR); + */ //;? DBG_PARAM( DbgInfo, PARM_NAME_AUTHENTICATION, "%d", PARM_AUTHENTICATION ); //;? DBG_PARAM( DbgInfo, PARM_NAME_OWN_ATIM_WINDOW, "%d", PARM_OWN_ATIM_WINDOW ); //;? DBG_PARAM( DbgInfo, PARM_NAME_PM_HOLDOVER_DURATION, "%d", PARM_PM_HOLDOVER_DURATION ); @@ -512,12 +515,18 @@ int wl_insert( struct net_device *dev ) DBG_PARAM( DbgInfo, PARM_NAME_TX_RATE4, "%d", PARM_TX_RATE4 ); DBG_PARAM( DbgInfo, PARM_NAME_TX_RATE5, "%d", PARM_TX_RATE5 ); DBG_PARAM( DbgInfo, PARM_NAME_TX_RATE6, "%d", PARM_TX_RATE6 ); - DBG_PARAM( DbgInfo, PARM_NAME_WDS_ADDRESS1, "\"%s\"", DbgHwAddr( PARM_WDS_ADDRESS1 )); - DBG_PARAM( DbgInfo, PARM_NAME_WDS_ADDRESS2, "\"%s\"", DbgHwAddr( PARM_WDS_ADDRESS2 )); - DBG_PARAM( DbgInfo, PARM_NAME_WDS_ADDRESS3, "\"%s\"", DbgHwAddr( PARM_WDS_ADDRESS3 )); - DBG_PARAM( DbgInfo, PARM_NAME_WDS_ADDRESS4, "\"%s\"", DbgHwAddr( PARM_WDS_ADDRESS4 )); - DBG_PARAM( DbgInfo, PARM_NAME_WDS_ADDRESS5, "\"%s\"", DbgHwAddr( PARM_WDS_ADDRESS5 )); - DBG_PARAM( DbgInfo, PARM_NAME_WDS_ADDRESS6, "\"%s\"", DbgHwAddr( PARM_WDS_ADDRESS6 )); + DBG_PARAM(DbgInfo, PARM_NAME_WDS_ADDRESS1, "\"%pM\"", + PARM_WDS_ADDRESS1); + DBG_PARAM(DbgInfo, PARM_NAME_WDS_ADDRESS2, "\"%pM\"", + PARM_WDS_ADDRESS2); + DBG_PARAM(DbgInfo, PARM_NAME_WDS_ADDRESS3, "\"%pM\"", + PARM_WDS_ADDRESS3); + DBG_PARAM(DbgInfo, PARM_NAME_WDS_ADDRESS4, "\"%pM\"", + PARM_WDS_ADDRESS4); + DBG_PARAM(DbgInfo, PARM_NAME_WDS_ADDRESS5, "\"%pM\"", + PARM_WDS_ADDRESS5); + DBG_PARAM(DbgInfo, PARM_NAME_WDS_ADDRESS6, "\"%pM\"", + PARM_WDS_ADDRESS6); #endif /* USE_WDS */ #endif /* HCF_AP */ @@ -1189,7 +1198,7 @@ int rc; return hcf_status; } memcpy( lp->MACAddress, &lp->ltvRecord.u.u8[0], ETH_ALEN ); - DBG_TRACE( DbgInfo, "Card MAC Address: %s\n", DbgHwAddr( lp->MACAddress )); + DBG_TRACE(DbgInfo, "Card MAC Address: %pM\n", lp->MACAddress); /* Write out configuration to the device, enable, and reconnect. However, only reconnect if in AP mode. For STA mode, need to wait for passive scan @@ -1940,8 +1949,10 @@ int wl_put_ltv( struct wl_private *lp ) } /* Own MAC Address */ - //DBG_TRACE( DbgInfo, "MAC Address : %s\n", - // DbgHwAddr( lp->MACAddress )); +/* + DBG_TRACE(DbgInfo, "MAC Address : %pM\n", + lp->MACAddress); + */ if ( WVLAN_VALID_MAC_ADDRESS( lp->MACAddress )) { /* Make the MAC address valid by: @@ -3052,8 +3063,8 @@ void wl_process_mailbox( struct wl_private *lp ) aps[num_aps].capability ); DBG_TRACE( DbgInfo, "SSID Length : 0x%04x\n", aps[num_aps].ssid_len ); - DBG_TRACE( DbgInfo, "BSSID : %s\n", - DbgHwAddr( aps[num_aps].bssid )); + DBG_TRACE(DbgInfo, "BSSID : %pM\n", + aps[num_aps].bssid); if ( aps[num_aps].ssid_len != 0 ) { DBG_TRACE( DbgInfo, "SSID : %s.\n", @@ -3112,29 +3123,29 @@ void wl_process_mailbox( struct wl_private *lp ) DBG_TRACE( DbgInfo, "(%s) durID : 0x%04x.\n", lp->dev->name, probe_rsp->durID ); - DBG_TRACE( DbgInfo, "(%s) address1 : %s\n", - lp->dev->name, DbgHwAddr( probe_rsp->address1 )); + DBG_TRACE(DbgInfo, "(%s) address1 : %pM\n", + lp->dev->name, probe_rsp->address1); - DBG_TRACE( DbgInfo, "(%s) address2 : %s\n", - lp->dev->name, DbgHwAddr( probe_rsp->address2 )); + DBG_TRACE(DbgInfo, "(%s) address2 : %pM\n", + lp->dev->name, probe_rsp->address2); - DBG_TRACE( DbgInfo, "(%s) BSSID : %s\n", - lp->dev->name, DbgHwAddr( probe_rsp->BSSID )); + DBG_TRACE(DbgInfo, "(%s) BSSID : %pM\n", + lp->dev->name, probe_rsp->BSSID); DBG_TRACE( DbgInfo, "(%s) sequence : 0x%04x.\n", lp->dev->name, probe_rsp->sequence ); - DBG_TRACE( DbgInfo, "(%s) address4 : %s\n", - lp->dev->name, DbgHwAddr( probe_rsp->address4 )); + DBG_TRACE(DbgInfo, "(%s) address4 : %pM\n", + lp->dev->name, probe_rsp->address4); DBG_TRACE( DbgInfo, "(%s) datalength : 0x%04x.\n", lp->dev->name, probe_rsp->dataLength ); - DBG_TRACE( DbgInfo, "(%s) DA : %s\n", - lp->dev->name, DbgHwAddr( probe_rsp->DA )); + DBG_TRACE(DbgInfo, "(%s) DA : %pM\n", + lp->dev->name, probe_rsp->DA); - DBG_TRACE( DbgInfo, "(%s) SA : %s\n", - lp->dev->name, DbgHwAddr( probe_rsp->SA )); + DBG_TRACE(DbgInfo, "(%s) SA : %pM\n", + lp->dev->name, probe_rsp->SA); //DBG_TRACE( DbgInfo, "(%s) lenType : 0x%04x.\n", // lp->dev->name, probe_rsp->lenType ); @@ -3302,12 +3313,12 @@ void wl_process_mailbox( struct wl_private *lp ) break; } - DBG_TRACE( DbgInfo, "STA Address : %s\n", - DbgHwAddr( as->staAddr )); + DBG_TRACE(DbgInfo, "STA Address : %pM\n", + as->staAddr); if (( as->assocStatus == 2 ) && ( as->len == 8 )) { - DBG_TRACE( DbgInfo, "Old AP Address : %s\n", - DbgHwAddr( as->oldApAddr )); + DBG_TRACE(DbgInfo, "Old AP Address : %pM\n", + as->oldApAddr); } } @@ -3346,9 +3357,11 @@ void wl_process_mailbox( struct wl_private *lp ) break; } - DBG_TRACE( DbgInfo, "STA Address : %s\n", DbgHwAddr( ss->staAddr )); + DBG_TRACE(DbgInfo, "STA Address : %pM\n", + ss->staAddr); - DBG_TRACE( DbgInfo, "Reason : 0x%04x \n", ss->reason ); + DBG_TRACE(DbgInfo, "Reason : 0x%04x\n", + ss->reason); } break; diff --git a/drivers/staging/wlags49_h2/wl_netdev.c b/drivers/staging/wlags49_h2/wl_netdev.c index 954becee40d6..cf917e613f22 100644 --- a/drivers/staging/wlags49_h2/wl_netdev.c +++ b/drivers/staging/wlags49_h2/wl_netdev.c @@ -1071,8 +1071,7 @@ void wl_multicast( struct net_device *dev ) DBG_PRINT( " mc_count: %d\n", netdev_mc_count(dev)); netdev_for_each_mc_addr(ha, dev) - DBG_PRINT(" %s (%d)\n", DbgHwAddr(ha->addr), - dev->addr_len); + DBG_PRINT(" %pM (%d)\n", ha->addr, dev->addr_len); } #endif /* DBG */ diff --git a/drivers/staging/wlags49_h2/wl_util.c b/drivers/staging/wlags49_h2/wl_util.c index 4521c9fd5bb2..3b6f5a59b2bb 100644 --- a/drivers/staging/wlags49_h2/wl_util.c +++ b/drivers/staging/wlags49_h2/wl_util.c @@ -315,40 +315,6 @@ void key_string2key( char *ks, KEY_STRCT *key ) -#if DBG -/******************************************************************************* - * DbgHwAddr() - ******************************************************************************* - * - * DESCRIPTION: - * - * Convert a hardware ethernet address to a character string - * - * PARAMETERS: - * - * hwAddr - an ethernet address - * - * RETURNS: - * - * a pointer to a string representing the ethernet address - * - ******************************************************************************/ -const char *DbgHwAddr(unsigned char *hwAddr) -{ - static char buffer[18]; - /*------------------------------------------------------------------------*/ - - sprintf(buffer, "%pM", hwAddr); - - return buffer; -} // DbgHwAddr -/*============================================================================*/ - -#endif /* DBG */ - - - - /******************************************************************************* * wl_has_wep() ******************************************************************************* @@ -1132,29 +1098,29 @@ void wl_process_probe_response( struct wl_private *lp ) DBG_TRACE( DbgInfo, "(%s) durID : 0x%04x.\n", lp->dev->name, probe_rsp->durID ); - DBG_TRACE( DbgInfo, "(%s) address1 : %s\n", lp->dev->name, - DbgHwAddr( probe_rsp->address1 )); + DBG_TRACE(DbgInfo, "(%s) address1 : %pM\n", lp->dev->name, + probe_rsp->address1); - DBG_TRACE( DbgInfo, "(%s) address2 : %s\n", lp->dev->name, - DbgHwAddr( probe_rsp->address2 )); + DBG_TRACE(DbgInfo, "(%s) address2 : %pM\n", lp->dev->name, + probe_rsp->address2); - DBG_TRACE( DbgInfo, "(%s) BSSID : %s\n", lp->dev->name, - DbgHwAddr( probe_rsp->BSSID )); + DBG_TRACE(DbgInfo, "(%s) BSSID : %pM\n", lp->dev->name, + probe_rsp->BSSID); DBG_TRACE( DbgInfo, "(%s) sequence : 0x%04x.\n", lp->dev->name, probe_rsp->sequence ); - DBG_TRACE( DbgInfo, "(%s) address4 : %s\n", lp->dev->name, - DbgHwAddr( probe_rsp->address4 )); + DBG_TRACE(DbgInfo, "(%s) address4 : %pM\n", lp->dev->name, + probe_rsp->address4); DBG_TRACE( DbgInfo, "(%s) datalength : 0x%04x.\n", lp->dev->name, probe_rsp->dataLength ); - DBG_TRACE( DbgInfo, "(%s) DA : %s\n", lp->dev->name, - DbgHwAddr( probe_rsp->DA )); + DBG_TRACE(DbgInfo, "(%s) DA : %pM\n", lp->dev->name, + probe_rsp->DA); - DBG_TRACE( DbgInfo, "(%s) SA : %s\n", lp->dev->name, - DbgHwAddr( probe_rsp->SA )); + DBG_TRACE(DbgInfo, "(%s) SA : %pM\n", lp->dev->name, + probe_rsp->SA); #ifdef WARP @@ -1382,12 +1348,11 @@ void wl_process_assoc_status( struct wl_private *lp ) break; } - DBG_TRACE( DbgInfo, "STA Address : %s\n", - DbgHwAddr( assoc_stat->staAddr )); + DBG_TRACE(DbgInfo, "STA Address : %pM\n", assoc_stat->staAddr); if(( assoc_stat->assocStatus == 2 ) && ( assoc_stat->len == 8 )) { - DBG_TRACE( DbgInfo, "Old AP Address : %s\n", - DbgHwAddr( assoc_stat->oldApAddr )); + DBG_TRACE(DbgInfo, "Old AP Address : %pM\n", + assoc_stat->oldApAddr); } } @@ -1458,9 +1423,8 @@ void wl_process_security_status( struct wl_private *lp ) break; } - DBG_TRACE( DbgInfo, "STA Address : %s\n", - DbgHwAddr( sec_stat->staAddr )); - DBG_TRACE( DbgInfo, "Reason : 0x%04x \n", sec_stat->reason ); + DBG_TRACE(DbgInfo, "STA Address : %pM\n", sec_stat->staAddr); + DBG_TRACE(DbgInfo, "Reason : 0x%04x\n", sec_stat->reason); } diff --git a/drivers/staging/wlags49_h2/wl_util.h b/drivers/staging/wlags49_h2/wl_util.h index ba537a60059b..2661bcd6b0ec 100644 --- a/drivers/staging/wlags49_h2/wl_util.h +++ b/drivers/staging/wlags49_h2/wl_util.h @@ -77,11 +77,6 @@ void wl_endian_translate_event( ltv_t *pLtv ); int wl_has_wep( IFBP ifbp ); - -#if DBG -const char *DbgHwAddr( unsigned char *hwAddr ); -#endif // DBG - hcf_8 wl_parse_ds_ie( PROBE_RESP *probe_rsp ); hcf_8 * wl_parse_wpa_ie( PROBE_RESP *probe_rsp, hcf_16 *length ); hcf_8 * wl_print_wpa_ie( hcf_8 *buffer, int length ); diff --git a/drivers/staging/wlags49_h2/wl_wext.c b/drivers/staging/wlags49_h2/wl_wext.c index 06467f1bf901..9e5da0815371 100644 --- a/drivers/staging/wlags49_h2/wl_wext.c +++ b/drivers/staging/wlags49_h2/wl_wext.c @@ -789,7 +789,8 @@ static int wireless_get_ap_list (struct net_device *dev, struct iw_request_info memcpy( hwa[count].sa_data, (*p)/*lp->scan_results*/.APTable[count].bssid, ETH_ALEN ); #else //;?why use BSSID and bssid as names in seemingly very comparable situations - DBG_PRINT( "BSSID: %s\n", DbgHwAddr( (*p)/*lp->probe_results*/.ProbeTable[count].BSSID )); + DBG_PRINT("BSSID: %pM\n", + (*p).ProbeTable[count].BSSID); memcpy( hwa[count].sa_data, (*p)/*lp->probe_results*/.ProbeTable[count].BSSID, ETH_ALEN ); #endif // WARP @@ -3937,9 +3938,9 @@ void wl_wext_event_mic_failed( struct net_device *dev ) a problem in future versions of the supplicant, if they ever actually parse these parameters */ #if DBG - sprintf( msg, "MLME-MICHAELMICFAILURE.indication(keyid=%d %scast addr=" - "%s)", key_idx, addr1[0] & 0x01 ? "broad" : "uni", - DbgHwAddr( addr2 )); + sprintf(msg, "MLME-MICHAELMICFAILURE.indication(keyid=%d %scast " + "addr=%pM)", key_idx, addr1[0] & 0x01 ? "broad" : "uni", + addr2); #endif wrqu.data.length = strlen( msg ); wireless_send_event( dev, IWEVCUSTOM, &wrqu, msg ); |