From patchwork Fri Aug 24 05:27:10 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 1369871 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 40EE23FC33 for ; Fri, 24 Aug 2012 05:27:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756722Ab2HXF1N (ORCPT ); Fri, 24 Aug 2012 01:27:13 -0400 Received: from mail-qa0-f46.google.com ([209.85.216.46]:59923 "EHLO mail-qa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751472Ab2HXF1L (ORCPT ); Fri, 24 Aug 2012 01:27:11 -0400 Received: by qaas11 with SMTP id s11so293841qaa.19 for ; Thu, 23 Aug 2012 22:27:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=5OKu0BJCzrMpMN3qnTuN+MTxYbd5dZJHwwoOi1I5DJM=; b=VQ8LFMerH4VPs1TVElPZywT7JF8+HaCu/DPe+0bf8vdH1hc+fTYTeH50TcKKsg9Iki Mpgw1wTv4e814Zl4xsv4fHW3YTIhSAMAnrzHE6Yq7TD1AamyJlySKZyHvPQL+It/Lsbs I6Q7GjyEdcSRlbLZy1qHcYh/s3JJxF+c6eW7Kzat3opdVZF1ZHwTp8zMXk7wrck3poU6 C2zmuWvRTjTKgF1/a8xQdsC85mC9KBBtLBITVmFzuBJYbk0xRDel0DFy855Qac1jQg38 qK6Oy196Uo3elPXjMuxrpL75sRtoLGCngTz9Zf+QyqAQOqOtipu4w8jwh38kP7z3pToU yUsA== MIME-Version: 1.0 Received: by 10.229.136.14 with SMTP id p14mr1902314qct.93.1345786030468; Thu, 23 Aug 2012 22:27:10 -0700 (PDT) Received: by 10.229.146.194 with HTTP; Thu, 23 Aug 2012 22:27:10 -0700 (PDT) Date: Fri, 24 Aug 2012 13:27:10 +0800 Message-ID: Subject: [PATCH v2] mwifiex: use is_zero_ether_addr() instead of memcmp() From: Wei Yongjun To: bzhao@marvell.com, linville@tuxdriver.com Cc: yongjun_wei@trendmicro.com.cn, linux-wireless@vger.kernel.org, netdev@vger.kernel.org Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Wei Yongjun Using is_zero_ether_addr() instead of directly use memcmp() to determine if the ethernet address is all zeros. spatch with a semantic match is used to found this problem. (http://coccinelle.lip6.fr/) Signed-off-by: Wei Yongjun Acked-by: Bing Zhao --- drivers/net/wireless/mwifiex/sta_cmdresp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/wireless/mwifiex/sta_cmdresp.c b/drivers/net/wireless/mwifiex/sta_cmdresp.c index 0b09004..62223ab 100644 --- a/drivers/net/wireless/mwifiex/sta_cmdresp.c +++ b/drivers/net/wireless/mwifiex/sta_cmdresp.c @@ -736,7 +736,6 @@ static int mwifiex_ret_ibss_coalescing_status(struct mwifiex_private *priv, { struct host_cmd_ds_802_11_ibss_status *ibss_coal_resp = &(resp->params.ibss_coalescing); - u8 zero_mac[ETH_ALEN] = { 0, 0, 0, 0, 0, 0 }; if (le16_to_cpu(ibss_coal_resp->action) == HostCmd_ACT_GEN_SET) return 0; @@ -745,7 +744,7 @@ static int mwifiex_ret_ibss_coalescing_status(struct mwifiex_private *priv, "info: new BSSID %pM\n", ibss_coal_resp->bssid); /* If rsp has NULL BSSID, Just return..... No Action */ - if (!memcmp(ibss_coal_resp->bssid, zero_mac, ETH_ALEN)) { + if (is_zero_ether_addr(ibss_coal_resp->bssid)) { dev_warn(priv->adapter->dev, "new BSSID is NULL\n"); return 0; }