Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5148526pxj; Wed, 9 Jun 2021 10:12:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxV+9GP4AQhN9BhMV033QNkoAS7k8uzob+/gzu66CIRvqZsaEloWtoANt9/lTjh9/YicWjG X-Received: by 2002:a05:6402:1652:: with SMTP id s18mr446259edx.131.1623258759418; Wed, 09 Jun 2021 10:12:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623258759; cv=none; d=google.com; s=arc-20160816; b=cw9uMRWLwyapi500Zer7HlzCcnY/mI0E8r8VZR6ASXspL7Vm0MPE+ZBYt+8nXkz3tM 7Lf7eUTq3FUAgyFTP9pLWzRx1Fueax2ZaFjdbrEuUz2ZZUXXEgcLZ84fv8jYERdQkhET QLyZD2i1PMBG3DmfPq+QvJjv1UyLsJAhfGxtldf2UsUu7Df3xiZbcaB6Vn+sqMtRmgXj V6uZY+qtswxLJ331/zm/dODP3LfsjDs/CxmPJzQRdLA+5zgebsVQd319nFm42FCmztpi kFK2aezJfkxAIuBEGUS07QPNNaLRjFcZXJ7l5yhOSGitaUcC/Lzs7OneTlac1hrnq+h3 9IZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=RhVmc4WoaHIdgmMtobrd5RXPg0i77s7/wde0/cY5Ujo=; b=DcBn4Gb7P7rTfHQMPtL7rPLscw403aJAjNKty486vzDZ9uqZV1g7dhUSvFhDeWYU4z jvQUHuwRPFIAgyYF1bykapDhVSR9AXLAeMhF+Bptfqjb9MXZh65A31bJlCc50RH7BeT+ rCFQU/xiVkwluhGwy4Km2unzUfCW10wvNdxrk4TvQLsdCWyu3MPlrO5qyzd66Y8s1mUY ri3FNyiek7NYf/vaHh1J3wy3nx1SpuDihhDFbEsFewjcznQGS2SCFLF3bHtX3osjMmFs cXzL3gACAYd9s9LL/MVxDmPiFvvGJASXzx7D4d7XMnEzo7Et+5Lu9z+JpN4gj/q7mA5I wAhQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s7si330733ejd.662.2021.06.09.10.12.15; Wed, 09 Jun 2021 10:12:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237652AbhFII0i (ORCPT + 99 others); Wed, 9 Jun 2021 04:26:38 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:3812 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237646AbhFII0i (ORCPT ); Wed, 9 Jun 2021 04:26:38 -0400 Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4G0Klq0M1czWsfj; Wed, 9 Jun 2021 16:19:51 +0800 (CST) Received: from dggpemm500009.china.huawei.com (7.185.36.225) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 9 Jun 2021 16:24:43 +0800 Received: from huawei.com (10.175.113.32) by dggpemm500009.china.huawei.com (7.185.36.225) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 9 Jun 2021 16:24:42 +0800 From: Liu Shixin To: Greg Kroah-Hartman , Joe Perches , Fabio Aiuto CC: , , "Liu Shixin" Subject: [PATCH -next v2 2/2] staging: rtl8188eu: Use eth_broadcast_addr() to assign broadcast address Date: Wed, 9 Jun 2021 16:56:50 +0800 Message-ID: <20210609085650.1269008-2-liushixin2@huawei.com> X-Mailer: git-send-email 2.18.0.huawei.25 In-Reply-To: <20210609085650.1269008-1-liushixin2@huawei.com> References: <20210609085650.1269008-1-liushixin2@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.113.32] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemm500009.china.huawei.com (7.185.36.225) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Simplify the code by using eth_broadcast_addr() to assign broadcast address and removing the unnecessary variable bc_addr. Signed-off-by: Liu Shixin --- v1->v2: 1. Add the benefit of this patch in changelog. 2. Change the subject line according to fabio's reminder. drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c index 8c1bc04dd830..119110a150b2 100644 --- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c @@ -315,7 +315,6 @@ static void issue_beacon(struct adapter *padapter, int timeout_ms) struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; struct wlan_bssid_ex *cur_network = &pmlmeinfo->network; - u8 bc_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; pmgntframe = alloc_mgtxmitframe(pxmitpriv); if (!pmgntframe) { @@ -339,7 +338,7 @@ static void issue_beacon(struct adapter *padapter, int timeout_ms) fctrl = &pwlanhdr->frame_control; *(fctrl) = 0; - ether_addr_copy(pwlanhdr->addr1, bc_addr); + eth_broadcast_addr(pwlanhdr->addr1); ether_addr_copy(pwlanhdr->addr2, myid(&padapter->eeprompriv)); ether_addr_copy(pwlanhdr->addr3, cur_network->MacAddress); @@ -605,7 +604,6 @@ static int issue_probereq(struct adapter *padapter, struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; int bssrate_len = 0; - u8 bc_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; RT_TRACE(_module_rtl871x_mlme_c_, _drv_notice_, ("+%s\n", __func__)); @@ -633,8 +631,8 @@ static int issue_probereq(struct adapter *padapter, ether_addr_copy(pwlanhdr->addr3, da); } else { /* broadcast probe request frame */ - ether_addr_copy(pwlanhdr->addr1, bc_addr); - ether_addr_copy(pwlanhdr->addr3, bc_addr); + eth_broadcast_addr(pwlanhdr->addr1); + eth_broadcast_addr(pwlanhdr->addr3); } ether_addr_copy(pwlanhdr->addr2, mac); -- 2.18.0.huawei.25