staging: wlags49_h2: remove useless DbgHwAddr() method
authorAndy Shevchenko <andy.shevchenko@gmail.com>
Sat, 16 Oct 2010 10:11:12 +0000 (13:11 +0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 19 Oct 2010 17:04:17 +0000 (10:04 -0700)
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>
drivers/staging/wlags49_h2/wl_main.c
drivers/staging/wlags49_h2/wl_netdev.c
drivers/staging/wlags49_h2/wl_util.c
drivers/staging/wlags49_h2/wl_util.h
drivers/staging/wlags49_h2/wl_wext.c

index 10a4709bcc78354bf2e98e5529cfe08470f43e2d..00758aadb4ee79f2b88e651add0159b4c6625669 100644 (file)
@@ -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;
index 954becee40d6c0568c4124a337a1ed8f5c3bf53a..cf917e613f22a087888168195749d4abf14ac9ad 100644 (file)
@@ -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 */
 
index 4521c9fd5bb22dcc73114631ca3b6a91bde2eeb9..3b6f5a59b2bb9038604bab2057a08ce516bed877 100644 (file)
@@ -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);
 
     }
 
index ba537a60059bd129fa425ca9a19db589abc079fd..2661bcd6b0ec6821d414b38fee7bff841e1e346f 100644 (file)
@@ -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 );
index 06467f1bf901624db723fb0b7804e02f11f3c429..9e5da0815371655d6c6a6a201692ceb43d1c2a86 100644 (file)
@@ -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 );