diff options
author | Andy Shevchenko <andy.shevchenko@gmail.com> | 2010-10-11 16:58:33 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-10-12 09:03:29 -0700 |
commit | ba07d0cbc919613ce48acc0a43d6e8ab35cd7748 (patch) | |
tree | d9f5e52e0409928d462f69e7a1ad4293d85d8c53 /drivers/staging/brcm80211/brcmfmac | |
parent | 88b3eaa499ddbe5a36c34840117563bd54ec4ec2 (diff) | |
download | op-kernel-dev-ba07d0cbc919613ce48acc0a43d6e8ab35cd7748.zip op-kernel-dev-ba07d0cbc919613ce48acc0a43d6e8ab35cd7748.tar.gz |
staging: brcm80211: remove useless bcm_ether_ntoa()
Since we have '%pM' modifier in the kernel's *printf() we don't need to
convert address to the string beforehand.
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Nohee Ko <noheek@broadcom.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: linux-wireless@vger.kernel.org
Cc: devel@driverdev.osuosl.org
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/brcm80211/brcmfmac')
-rw-r--r-- | drivers/staging/brcm80211/brcmfmac/dhd_common.c | 15 | ||||
-rw-r--r-- | drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c | 27 | ||||
-rw-r--r-- | drivers/staging/brcm80211/brcmfmac/wl_iw.c | 21 | ||||
-rw-r--r-- | drivers/staging/brcm80211/brcmfmac/wl_iw.h | 3 |
4 files changed, 18 insertions, 48 deletions
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_common.c b/drivers/staging/brcm80211/brcmfmac/dhd_common.c index 481c35d..79ded63 100644 --- a/drivers/staging/brcm80211/brcmfmac/dhd_common.c +++ b/drivers/staging/brcm80211/brcmfmac/dhd_common.c @@ -143,8 +143,6 @@ void dhd_common_init(void) static int dhd_dump(dhd_pub_t *dhdp, char *buf, int buflen) { - char eabuf[ETHER_ADDR_STR_LEN]; - struct bcmstrbuf b; struct bcmstrbuf *strbuf = &b; @@ -157,9 +155,8 @@ static int dhd_dump(dhd_pub_t *dhdp, char *buf, int buflen) dhdp->up, dhdp->txoff, dhdp->busstate); bcm_bprintf(strbuf, "pub.hdrlen %d pub.maxctl %d pub.rxsz %d\n", dhdp->hdrlen, dhdp->maxctl, dhdp->rxsz); - bcm_bprintf(strbuf, "pub.iswl %d pub.drv_version %ld pub.mac %s\n", - dhdp->iswl, dhdp->drv_version, bcm_ether_ntoa(&dhdp->mac, - eabuf)); + bcm_bprintf(strbuf, "pub.iswl %d pub.drv_version %ld pub.mac %pM\n", + dhdp->iswl, dhdp->drv_version, &dhdp->mac); bcm_bprintf(strbuf, "pub.bcmerror %d tickcnt %d\n", dhdp->bcmerror, dhdp->tickcnt); @@ -600,13 +597,7 @@ static void wl_show_host_event(wl_event_msg_t *event, void *event_data) auth_type = ntoh32(event->auth_type); datalen = ntoh32(event->datalen); /* debug dump of event messages */ - sprintf(eabuf, "%02x:%02x:%02x:%02x:%02x:%02x", - (unsigned char) event->addr.octet[0] & 0xff, - (unsigned char) event->addr.octet[1] & 0xff, - (unsigned char) event->addr.octet[2] & 0xff, - (unsigned char) event->addr.octet[3] & 0xff, - (unsigned char) event->addr.octet[4] & 0xff, - (unsigned char) event->addr.octet[5] & 0xff); + sprintf(eabuf, "%pM", event->addr.octet); event_name = "UNKNOWN"; for (i = 0; i < ARRAY_SIZE(event_names); i++) { diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c index 32021a9..988330e 100644 --- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c @@ -2006,16 +2006,12 @@ static __used s32 wl_update_pmklist(struct net_device *dev, struct wl_pmk_list *pmk_list, s32 err) { - s8 eabuf[ETHER_ADDR_STR_LEN]; int i, j; - memset(eabuf, 0, ETHER_ADDR_STR_LEN); - WL_DBG(("No of elements %d\n", pmk_list->pmkids.npmkid)); for (i = 0; i < pmk_list->pmkids.npmkid; i++) { - WL_DBG(("PMKID[%d]: %s =\n", i, - bcm_ether_ntoa(&pmk_list->pmkids.pmkid[i].BSSID, - eabuf))); + WL_DBG(("PMKID[%d]: %pM =\n", i, + &pmk_list->pmkids.pmkid[i].BSSID)); for (j = 0; j < WPA2_PMKID_LEN; j++) { WL_DBG(("%02x\n", pmk_list->pmkids.pmkid[i].PMKID[j])); } @@ -2033,12 +2029,10 @@ wl_cfg80211_set_pmksa(struct wiphy *wiphy, struct net_device *dev, struct cfg80211_pmksa *pmksa) { struct wl_priv *wl = wiphy_to_wl(wiphy); - s8 eabuf[ETHER_ADDR_STR_LEN]; s32 err = 0; int i; CHECK_SYS_UP(); - memset(eabuf, 0, ETHER_ADDR_STR_LEN); for (i = 0; i < wl->pmk_list->pmkids.npmkid; i++) if (!memcmp(pmksa->bssid, &wl->pmk_list->pmkids.pmkid[i].BSSID, ETHER_ADDR_LEN)) @@ -2053,10 +2047,8 @@ wl_cfg80211_set_pmksa(struct wiphy *wiphy, struct net_device *dev, } else { err = -EINVAL; } - WL_DBG(("set_pmksa,IW_PMKSA_ADD - PMKID: %s =\n", - bcm_ether_ntoa(&wl->pmk_list->pmkids. - pmkid[wl->pmk_list->pmkids.npmkid].BSSID, - eabuf))); + WL_DBG(("set_pmksa,IW_PMKSA_ADD - PMKID: %pM =\n", + &wl->pmk_list->pmkids.pmkid[wl->pmk_list->pmkids.npmkid].BSSID)); for (i = 0; i < WPA2_PMKID_LEN; i++) { WL_DBG(("%02x\n", wl->pmk_list->pmkids.pmkid[wl->pmk_list->pmkids.npmkid]. @@ -2073,18 +2065,16 @@ wl_cfg80211_del_pmksa(struct wiphy *wiphy, struct net_device *dev, struct cfg80211_pmksa *pmksa) { struct wl_priv *wl = wiphy_to_wl(wiphy); - s8 eabuf[ETHER_ADDR_STR_LEN]; struct _pmkid_list pmkid; s32 err = 0; int i; CHECK_SYS_UP(); - memset(eabuf, 0, ETHER_ADDR_STR_LEN); memcpy(&pmkid.pmkid[0].BSSID, pmksa->bssid, ETHER_ADDR_LEN); memcpy(&pmkid.pmkid[0].PMKID, pmksa->pmkid, WPA2_PMKID_LEN); - WL_DBG(("del_pmksa,IW_PMKSA_REMOVE - PMKID: %s =\n", - bcm_ether_ntoa(&pmkid.pmkid[0].BSSID, eabuf))); + WL_DBG(("del_pmksa,IW_PMKSA_REMOVE - PMKID: %pM =\n", + &pmkid.pmkid[0].BSSID)); for (i = 0; i < WPA2_PMKID_LEN; i++) { WL_DBG(("%02x\n", pmkid.pmkid[0].PMKID[i])); } @@ -2585,10 +2575,7 @@ static s32 wl_update_bss_info(struct wl_priv *wl) if (unlikely(err)) goto update_bss_info_out; } else { - WL_DBG(("Found the AP in the list - " - "BSSID %02x:%02x:%02x:%02x:%02x:%02x\n", - bss->bssid[0], bss->bssid[1], bss->bssid[2], - bss->bssid[3], bss->bssid[4], bss->bssid[5])); + WL_DBG(("Found the AP in the list - BSSID %pM\n", bss->bssid)); cfg80211_put_bss(bss); } diff --git a/drivers/staging/brcm80211/brcmfmac/wl_iw.c b/drivers/staging/brcm80211/brcmfmac/wl_iw.c index 996bdd1..0934409 100644 --- a/drivers/staging/brcm80211/brcmfmac/wl_iw.c +++ b/drivers/staging/brcm80211/brcmfmac/wl_iw.c @@ -800,9 +800,8 @@ wl_iw_set_wap(struct net_device *dev, } if (g_ssid.SSID_len) { - WL_TRACE(("%s: join SSID=%s BSSID=" MACSTR " ch=%d\n", - __func__, g_ssid.SSID, - MAC2STR((u8 *) awrq->sa_data), + WL_TRACE(("%s: join SSID=%s BSSID=%pM ch=%d\n", + __func__, g_ssid.SSID, awrq->sa_data, g_wl_iw_params.target_channel)); } @@ -2638,14 +2637,12 @@ wl_iw_set_pmksa(struct net_device *dev, struct iw_pmksa *iwpmksa; uint i; int ret = 0; - char eabuf[ETHER_ADDR_STR_LEN]; WL_WSEC(("%s: SIOCSIWPMKSA\n", dev->name)); CHECK_EXTRA_FOR_NULL(extra); iwpmksa = (struct iw_pmksa *)extra; - bzero((char *)eabuf, ETHER_ADDR_STR_LEN); if (iwpmksa->cmd == IW_PMKSA_FLUSH) { WL_WSEC(("wl_iw_set_pmksa - IW_PMKSA_FLUSH\n")); @@ -2663,8 +2660,8 @@ wl_iw_set_pmksa(struct net_device *dev, bcopy(&iwpmksa->pmkid[0], &pmkidptr->pmkid[0].PMKID, WPA2_PMKID_LEN); - WL_WSEC(("wl_iw_set_pmksa:IW_PMKSA_REMOVE:PMKID: %s = ", - bcm_ether_ntoa(&pmkidptr->pmkid[0].BSSID, eabuf))); + WL_WSEC(("wl_iw_set_pmksa:IW_PMKSA_REMOVE:PMKID: " + "%pM = ", &pmkidptr->pmkid[0].BSSID)); for (j = 0; j < WPA2_PMKID_LEN; j++) WL_WSEC(("%02x ", pmkidptr->pmkid[0].PMKID[j])); WL_WSEC(("\n")); @@ -2713,9 +2710,8 @@ wl_iw_set_pmksa(struct net_device *dev, uint j; uint k; k = pmkid_list.pmkids.npmkid; - WL_WSEC(("wl_iw_set_pmksa,IW_PMKSA_ADD - PMKID: %s = ", - bcm_ether_ntoa(&pmkid_list.pmkids.pmkid[k]. - BSSID, eabuf))); + WL_WSEC(("wl_iw_set_pmksa,IW_PMKSA_ADD - PMKID: %pM = ", + &pmkid_list.pmkids.pmkid[k].BSSID)); for (j = 0; j < WPA2_PMKID_LEN; j++) WL_WSEC(("%02x ", pmkid_list.pmkids.pmkid[k].PMKID[j])); @@ -2726,9 +2722,8 @@ wl_iw_set_pmksa(struct net_device *dev, pmkid_list.pmkids.npmkid)); for (i = 0; i < pmkid_list.pmkids.npmkid; i++) { uint j; - WL_WSEC(("PMKID[%d]: %s = ", i, - bcm_ether_ntoa(&pmkid_list.pmkids.pmkid[i].BSSID, - eabuf))); + WL_WSEC(("PMKID[%d]: %pM = ", i, + &pmkid_list.pmkids.pmkid[i].BSSID)); for (j = 0; j < WPA2_PMKID_LEN; j++) WL_WSEC(("%02x ", pmkid_list.pmkids.pmkid[i].PMKID[j])); WL_WSEC(("\n")); diff --git a/drivers/staging/brcm80211/brcmfmac/wl_iw.h b/drivers/staging/brcm80211/brcmfmac/wl_iw.h index d15abc0..e8e9144 100644 --- a/drivers/staging/brcm80211/brcmfmac/wl_iw.h +++ b/drivers/staging/brcm80211/brcmfmac/wl_iw.h @@ -42,9 +42,6 @@ #define PNOENABLE_SET_CMD "PNOFORCE" #define PNODEBUG_SET_CMD "PNODEBUG" -#define MAC2STR(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5] -#define MACSTR "%02x:%02x:%02x:%02x:%02x:%02x" - typedef struct wl_iw_extra_params { int target_channel; } wl_iw_extra_params_t; |