From patchwork Mon Mar 12 09:39:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: hariprasath.elango@gmail.com X-Patchwork-Id: 10275765 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0E3E6602C2 for ; Mon, 12 Mar 2018 09:39:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0A2F828A26 for ; Mon, 12 Mar 2018 09:39:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F2DC928B24; Mon, 12 Mar 2018 09:39:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A9DEB28A26 for ; Mon, 12 Mar 2018 09:39:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752065AbeCLJjg (ORCPT ); Mon, 12 Mar 2018 05:39:36 -0400 Received: from mail-pl0-f66.google.com ([209.85.160.66]:39654 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751229AbeCLJjf (ORCPT ); Mon, 12 Mar 2018 05:39:35 -0400 Received: by mail-pl0-f66.google.com with SMTP id s13-v6so9010505plq.6; Mon, 12 Mar 2018 02:39:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=P1Z05eDoY+jy2ksoUgnVS/DXauWdtzuappUrOSXSWJI=; b=mU8fY7XPFGB11ERe/5DSGs2+t/t6UymeAwp4HkAyRvY2ftPmnMvPBO+83XLkS8paAW UN5XJK7ZmDVOltNXokpW4Z4VDO0S+dbpePPUdcudwpoTYc3J2gWlzA/IkaX1cPKgIovf 6XxC2TIdQYRLa8Ioz7t5rmhTgkl4nfSc4g4PqARZCj8MpN3+9GT3nyatN8WPFkLV0ANu 7odb2JET4FzqTrsQ/3CUXrUrZi+F0JueZ5Md7HW1HBRvyVWoJRlb1WG0S3Aoi/jkJmTV Ak1RQ2G2FVp7Wd9tdJPhj6zC1HMTuyOEDrp4EHDxo4ZPxYlsf+vdixXEsFRb/CnN/PLB WICA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=P1Z05eDoY+jy2ksoUgnVS/DXauWdtzuappUrOSXSWJI=; b=D747ZKWBqCGjdvq5pL+fthC74lHF1q7JRjx/tTuKYpjofd00LsqoRTqzPl7mAIZLPB jJKcSWCyAgpYpy2G08Uogeicw15o8+9zB5oD2oh7kKdNtOkBrv3BJk0mzw860/0CMl4a T5n4IfkTjkluxo7n3Q4MOrWUeKTXdjcohTC0qRWXE+drUnZbk4Fi3hrcZrU80MKAy94c s0Gd5zM+kS4e8tHBmZkSo97XGMAEc7G7rm4EPFARcnQe1gldWDYkp9JRETP8g1CI2fXk e+96qtBJ7dYz2QYhYtW4PdY8Ae2Up/uatWSQwGye71jD4lZd+FLLobWyk2sgt+asGXHH h1cw== X-Gm-Message-State: AElRT7HBXDXn/mgFIZvbG+qLq3Qh7KvA/g/sIIB7V8jwUpysgGiSzvrF OPNrNt/Hcr9DZx/JVKaKlok= X-Google-Smtp-Source: AG47ELt3x0UFRkqAH3GN+mPwW84byv6PDrlo7QxdugTPn339RDOnQaC7INI6d4/N8kKYQ06Xu/F2pw== X-Received: by 2002:a17:902:bb06:: with SMTP id l6-v6mr7741793pls.394.1520847575037; Mon, 12 Mar 2018 02:39:35 -0700 (PDT) Received: from localhost.localdomain ([2405:204:714d:efc4:a583:666e:901d:538]) by smtp.gmail.com with ESMTPSA id c11sm17551407pfe.109.2018.03.12.02.39.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Mar 2018 02:39:34 -0700 (PDT) From: hariprasath.elango@gmail.com To: aditya.shankar@microchip.com Cc: hariprasath.elango@gmail.com, vbabu3@visteon.com, Ganesh Krishna , Greg Kroah-Hartman , linux-wireless@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCHv2] staging: wilc1000: use pre-defined macro is_broadcast_ether_addr Date: Mon, 12 Mar 2018 15:09:03 +0530 Message-Id: <20180312093903.9147-1-hariprasath.elango@gmail.com> X-Mailer: git-send-email 2.10.0.GIT Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: HariPrasath Elango Use the kernel pre-defined macro is_broadcast_ether_addr() instead of doing a memcmp here. Signed-off-by: HariPrasath Elango Reviewed-by: Ajay Singh --- drivers/staging/wilc1000/linux_mon.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/wilc1000/linux_mon.c b/drivers/staging/wilc1000/linux_mon.c index bbdfc7a..f93f411 100644 --- a/drivers/staging/wilc1000/linux_mon.c +++ b/drivers/staging/wilc1000/linux_mon.c @@ -27,7 +27,6 @@ static struct net_device *wilc_wfi_mon; /* global monitor netdev */ static u8 srcadd[6]; static u8 bssid[6]; -static u8 broadcast[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; /** * @brief WILC_WFI_monitor_rx * @details @@ -193,7 +192,7 @@ static netdev_tx_t WILC_WFI_mon_xmit(struct sk_buff *skb, skb_pull(skb, rtap_len); - if (skb->data[0] == 0xc0 && (!(memcmp(broadcast, &skb->data[4], 6)))) { + if (skb->data[0] == 0xc0 && is_broadcast_ether_addr(&skb->data[4])) { skb2 = dev_alloc_skb(skb->len + sizeof(struct wilc_wfi_radiotap_cb_hdr)); if (!skb2) return -ENOMEM;