Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp372406ybh; Wed, 11 Mar 2020 02:46:11 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtXK8h1TW3IndN8qaGA2ot2J1NfX2wzi2oNxaDESxz+bc9fnRHe4OI1Fq+b/hXi5OR2CS5W X-Received: by 2002:aca:f12:: with SMTP id 18mr1276886oip.126.1583919971387; Wed, 11 Mar 2020 02:46:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583919971; cv=none; d=google.com; s=arc-20160816; b=OYp47UDAGC0pjt5hlYejA8/neLxqHQenNfKWI3WBeA/yeuxzMDt85/LRS6mctrYty8 EuZV5Hp02VEFrKKUb18UGbfL/VSI1w4Xic4Hb9GcKEZhJk7HsjzAAZ22HCDwwXQzRlNI 6FoOLTAnBLhU2Apc7+PWtcri+grc/IHh3zqGk4j2h2fL92hEXc4tXHGFPQ1nafLA6GNx r0eq9wAauTBpf0NMWtKCOsKJEQedVKVQyAa9LMX+cEabXv3gaZcVPK6GRwfQdakHtL2+ 1BbgcNO8sYiWye1F1BX492SkYvPI9Ts6A4xlcOZXWp76oWdyo6/D2AM62visk0cddX4f RiNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:to:from :dkim-signature; bh=z7RER8i2U2RCh3Aq3cexxxfX49K1q51Jj5phMyI5sJk=; b=T1LF9gX9+9QEcNcj/zv5CFUbwZO6NKL45tP6zOUFJYj8OzFIxDyzhpdJKpL/Nsrf23 aK8l62a4TiRvUw+tPOIfYEtkP8TSviOZUE4esvAYuGjeQ7YRjA+LDOvxCm+bpKDHcfGA 7jWTpq0Zwx70lmj6KTc/u+bi0jY9Fej7oUL1o16qthkRmJgq2x1n7UWeplbIoQLaf2UX xyLM5nCCKC4c6GyfWjCsR/19mRGa4DHMIj1RGJE+2/HvZQVnFo+LpKLsKakGr0kayHFB YtpzVBjjsJQkYwI3mhLk224OeQ7WYgTM7J1VZ7KZ9rwUF0ElxvmSwvOEqome44KCy2no wqzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Fa2oReUn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q11si838190otc.153.2020.03.11.02.45.51; Wed, 11 Mar 2020 02:46:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Fa2oReUn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728879AbgCKJns (ORCPT + 99 others); Wed, 11 Mar 2020 05:43:48 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:39242 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728349AbgCKJnr (ORCPT ); Wed, 11 Mar 2020 05:43:47 -0400 Received: by mail-pl1-f194.google.com with SMTP id j20so832790pll.6 for ; Wed, 11 Mar 2020 02:43:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=z7RER8i2U2RCh3Aq3cexxxfX49K1q51Jj5phMyI5sJk=; b=Fa2oReUnSSDXnbOrnu5Et7u3/OgXw0QmT2hj+W+Q2SqD8m8ClsPM8n0bH0W2dSQlYR nIfO9Y+wjoxUJ/bZEMCRIuYOuqJzZlYktLm28ku4tQ8bb9RO31BVSMrnKALyKfIYrMjd psBlpTwKO0qCmMP0jJZtT9QUREt0DJhSEy4tLGCSvBDjNEdMbrk6qUTuuGJgK2Ju17je WfgXkZwv2bpvq3MH8KGku1XwzoP8DdhWoyra39reyi18nAQIBCqik9+tzw4jTTMBK8fE yucajKm+ZElD4zSQ0vVzpA/MlDEriWU8VK4l16OpiP37oaMkCQM1e1MGAWBWJZ4P+X/q 8TAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=z7RER8i2U2RCh3Aq3cexxxfX49K1q51Jj5phMyI5sJk=; b=Ol4A4iNII1esxmrdy6qVsvBud8x8gFA0CJS95K5JrwH6Pik35fcqpQ8HeEPYyElGr5 9lMu733rGOnFkL4vBoZgqM1hAF8LN2QLKwvDbBtbs6FZfhTwuNs4POxz1WqUlAYBR27o 61mY0LbCW45kc9l6sARnX0wDHTMq4T9SC7OSq0lf/KQ4q3nXy1EHXDifOlc2LY04A6/K 88A33uUvxhAQsDLJUvmhfQEiiUxJ+eOAVWI8uFm+G/dKCrW7P02GHvVu0DtDzHj2hLgK yivKJLbAcvq+aDA1q07LzPJFITMCWRM8f3YiCjW9oteaSBaYbse4X4/KF707V6kpXRUP pz/g== X-Gm-Message-State: ANhLgQ1S7SPQqCic3kEeJ3YSPie8P8naAv+N91z6aOr0CSwjNqn70JCl 2o7UkfNmvjT99SwWNOjQxto= X-Received: by 2002:a17:90a:e658:: with SMTP id ep24mr2143492pjb.70.1583919826284; Wed, 11 Mar 2020 02:43:46 -0700 (PDT) Received: from localhost.localdomain ([2405:204:287:fb4d:18bc:a849:c699:3914]) by smtp.gmail.com with ESMTPSA id z63sm49669848pgd.12.2020.03.11.02.43.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Mar 2020 02:43:45 -0700 (PDT) From: Shreeya Patel To: gregkh@linuxfoundation.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, outreachy-kernel@googlegroups.com, sbrivio@redhat.com, daniel.baluta@gmail.com, nramas@linux.microsoft.com, hverkuil@xs4all.nl, shreeya.patel23498@gmail.com, Larry.Finger@lwfinger.net Subject: [Outreachy kernel] [PATCH v3] Staging: rtl8188eu: rtw_mlme: Add space around operators Date: Wed, 11 Mar 2020 15:13:32 +0530 Message-Id: <20200311094332.29714-1-shreeya.patel23498@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add space around operators for improving the code readability. Reported by checkpatch.pl Signed-off-by: Shreeya Patel --- shreeya@Shreeya-Patel:~git/kernels/staging$ git diff -w drivers/staging/rtl8188eu/core/ shreeya@Shreeya-Patel:~git/kernels/staging$ git diff -w shows no difference. shreeya@Shreeya-Patel:~git/kernels/staging/drivers/staging/rtl8188eu/core$ diff rtw_mlme_old.o rtw_mlme.o shreeya@Shreeya-Patel:~git/kernels/staging/drivers/staging/rtl8188eu/core$ diff of the .o files before and after the changes shows no difference Changes in v3 - Make the diff output explanation more readable. Changes in v2 - Include the file name in Subject to make it more specific. - Add the output of diff of the .o files before and after the changes to show no difference. - Add the output of git diff -w to show no difference. drivers/staging/rtl8188eu/core/rtw_mlme.c | 40 +++++++++++------------ 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme.c b/drivers/staging/rtl8188eu/core/rtw_mlme.c index 8da955e8343b..9de2d421f6b1 100644 --- a/drivers/staging/rtl8188eu/core/rtw_mlme.c +++ b/drivers/staging/rtl8188eu/core/rtw_mlme.c @@ -149,7 +149,7 @@ static void _rtw_free_network(struct mlme_priv *pmlmepriv, struct wlan_network * (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE))) lifetime = 1; if (!isfreeall) { - delta_time = (curr_time - pnetwork->last_scanned)/HZ; + delta_time = (curr_time - pnetwork->last_scanned) / HZ; if (delta_time < lifetime)/* unit:sec */ return; } @@ -249,8 +249,8 @@ void rtw_generate_random_ibss(u8 *pibss) pibss[1] = 0x11; pibss[2] = 0x87; pibss[3] = (u8)(curtime & 0xff);/* p[0]; */ - pibss[4] = (u8)((curtime>>8) & 0xff);/* p[1]; */ - pibss[5] = (u8)((curtime>>16) & 0xff);/* p[2]; */ + pibss[4] = (u8)((curtime >> 8) & 0xff);/* p[1]; */ + pibss[5] = (u8)((curtime >> 16) & 0xff);/* p[2]; */ } u8 *rtw_get_capability_from_ie(u8 *ie) @@ -357,9 +357,9 @@ void update_network(struct wlan_bssid_ex *dst, struct wlan_bssid_ex *src, rssi_final = rssi_ori; } else { if (sq_smp != 101) { /* from the right channel */ - ss_final = ((u32)(src->PhyInfo.SignalStrength)+(u32)(dst->PhyInfo.SignalStrength)*4)/5; - sq_final = ((u32)(src->PhyInfo.SignalQuality)+(u32)(dst->PhyInfo.SignalQuality)*4)/5; - rssi_final = (src->Rssi+dst->Rssi*4)/5; + ss_final = ((u32)(src->PhyInfo.SignalStrength) + (u32)(dst->PhyInfo.SignalStrength) * 4) / 5; + sq_final = ((u32)(src->PhyInfo.SignalQuality) + (u32)(dst->PhyInfo.SignalQuality) * 4) / 5; + rssi_final = (src->Rssi + dst->Rssi * 4) / 5; } else { /* bss info not receiving from the right channel, use the original RX signal infos */ ss_final = dst->PhyInfo.SignalStrength; @@ -510,7 +510,7 @@ static int rtw_is_desired_network(struct adapter *adapter, struct wlan_network * privacy = pnetwork->network.Privacy; if (check_fwstate(pmlmepriv, WIFI_UNDER_WPS)) { - if (rtw_get_wps_ie(pnetwork->network.ies+_FIXED_IE_LENGTH_, pnetwork->network.ie_length-_FIXED_IE_LENGTH_, NULL, &wps_ielen)) + if (rtw_get_wps_ie(pnetwork->network.ies + _FIXED_IE_LENGTH_, pnetwork->network.ie_length - _FIXED_IE_LENGTH_, NULL, &wps_ielen)) return true; else return false; @@ -925,7 +925,7 @@ static void rtw_joinbss_update_network(struct adapter *padapter, struct wlan_net switch (pnetwork->network.InfrastructureMode) { case Ndis802_11Infrastructure: if (pmlmepriv->fw_state & WIFI_UNDER_WPS) - pmlmepriv->fw_state = WIFI_STATION_STATE|WIFI_UNDER_WPS; + pmlmepriv->fw_state = WIFI_STATION_STATE | WIFI_UNDER_WPS; else pmlmepriv->fw_state = WIFI_STATION_STATE; break; @@ -1097,14 +1097,14 @@ static u8 search_max_mac_id(struct adapter *padapter) #if defined(CONFIG_88EU_AP_MODE) if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) { for (aid = pstapriv->max_num_sta; aid > 0; aid--) { - if (pstapriv->sta_aid[aid-1]) + if (pstapriv->sta_aid[aid - 1]) break; } mac_id = aid + 1; } else #endif {/* adhoc id = 31~2 */ - for (mac_id = NUM_STA-1; mac_id >= IBSS_START_MAC_ID; mac_id--) { + for (mac_id = NUM_STA - 1; mac_id >= IBSS_START_MAC_ID; mac_id--) { if (pmlmeinfo->FW_sta_info[mac_id].status == 1) break; } @@ -1123,7 +1123,7 @@ void rtw_stassoc_hw_rpt(struct adapter *adapter, struct sta_info *psta) macid = search_max_mac_id(adapter); rtw_hal_set_hwreg(adapter, HW_VAR_TX_RPT_MAX_MACID, (u8 *)&macid); - media_status = (psta->mac_id<<8)|1; /* MACID|OPMODE:1 connect */ + media_status = (psta->mac_id << 8) | 1; /* MACID|OPMODE:1 connect */ rtw_hal_set_hwreg(adapter, HW_VAR_H2C_MEDIA_STATUS_RPT, (u8 *)&media_status); } @@ -1213,7 +1213,7 @@ void rtw_stadel_event_callback(struct adapter *adapter, u8 *pbuf) if (mac_id >= 0) { u16 media_status; - media_status = (mac_id<<8)|0; /* MACID|OPMODE:0 means disconnect */ + media_status = (mac_id << 8) | 0; /* MACID|OPMODE:0 means disconnect */ /* for STA, AP, ADHOC mode, report disconnect stauts to FW */ rtw_hal_set_hwreg(adapter, HW_VAR_H2C_MEDIA_STATUS_RPT, (u8 *)&media_status); } @@ -1640,7 +1640,7 @@ int rtw_restruct_wmm_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, uint in_ for (i = 12; i < in_len; i += (in_ie[i + 1] + 2) /* to the next IE element */) { ielength = initial_out_len; - if (in_ie[i] == 0xDD && in_ie[i+2] == 0x00 && in_ie[i+3] == 0x50 && in_ie[i+4] == 0xF2 && in_ie[i+5] == 0x02 && i+5 < in_len) { + if (in_ie[i] == 0xDD && in_ie[i + 2] == 0x00 && in_ie[i + 3] == 0x50 && in_ie[i + 4] == 0xF2 && in_ie[i + 5] == 0x02 && i + 5 < in_len) { /* WMM element ID and OUI */ /* Append WMM IE to the last index of out_ie */ @@ -1734,13 +1734,13 @@ int rtw_restruct_sec_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, uint in_ authmode = _WPA2_IE_ID_; if (check_fwstate(pmlmepriv, WIFI_UNDER_WPS)) { - memcpy(out_ie+ielength, psecuritypriv->wps_ie, psecuritypriv->wps_ie_len); + memcpy(out_ie + ielength, psecuritypriv->wps_ie, psecuritypriv->wps_ie_len); ielength += psecuritypriv->wps_ie_len; } else if ((authmode == _WPA_IE_ID_) || (authmode == _WPA2_IE_ID_)) { /* copy RSN or SSN */ - memcpy(&out_ie[ielength], &psecuritypriv->supplicant_ie[0], psecuritypriv->supplicant_ie[1]+2); - ielength += psecuritypriv->supplicant_ie[1]+2; + memcpy(&out_ie[ielength], &psecuritypriv->supplicant_ie[0], psecuritypriv->supplicant_ie[1] + 2); + ielength += psecuritypriv->supplicant_ie[1] + 2; rtw_report_sec_ie(adapter, authmode, psecuritypriv->supplicant_ie); } @@ -1865,7 +1865,7 @@ unsigned int rtw_restructure_ht_ie(struct adapter *padapter, u8 *in_ie, u8 *out_ phtpriv->ht_option = false; - p = rtw_get_ie(in_ie+12, _HT_CAPABILITY_IE_, &ielen, in_len-12); + p = rtw_get_ie(in_ie + 12, _HT_CAPABILITY_IE_, &ielen, in_len - 12); if (p && ielen > 0) { struct ieee80211_ht_cap ht_cap; @@ -1904,16 +1904,16 @@ unsigned int rtw_restructure_ht_ie(struct adapter *padapter, u8 *in_ie, u8 *out_ else ht_cap.ampdu_params_info |= IEEE80211_HT_CAP_AMPDU_DENSITY & 0x00; - rtw_set_ie(out_ie+out_len, _HT_CAPABILITY_IE_, + rtw_set_ie(out_ie + out_len, _HT_CAPABILITY_IE_, sizeof(struct ieee80211_ht_cap), (unsigned char *)&ht_cap, pout_len); phtpriv->ht_option = true; - p = rtw_get_ie(in_ie+12, _HT_ADD_INFO_IE_, &ielen, in_len-12); + p = rtw_get_ie(in_ie + 12, _HT_ADD_INFO_IE_, &ielen, in_len - 12); if (p && (ielen == sizeof(struct ieee80211_ht_addt_info))) { out_len = *pout_len; - rtw_set_ie(out_ie+out_len, _HT_ADD_INFO_IE_, ielen, p+2, pout_len); + rtw_set_ie(out_ie + out_len, _HT_ADD_INFO_IE_, ielen, p + 2, pout_len); } } return phtpriv->ht_option; -- 2.17.1