Received: by 2002:a05:6a10:83d0:0:0:0:0 with SMTP id o16csp36698pxh; Thu, 7 Apr 2022 13:13:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwdHfQd7BImVw3ttV4xhQHF8QKtwiXr/P8H2+Ez9Xj/Mh7tZ61TJfcfI9W5XjSmQ7M418sg X-Received: by 2002:a17:903:2343:b0:156:9ef3:6ff3 with SMTP id c3-20020a170903234300b001569ef36ff3mr15622134plh.62.1649362398870; Thu, 07 Apr 2022 13:13:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649362398; cv=none; d=google.com; s=arc-20160816; b=z5KangnpiN0dp1qtRvx31QOzpwUirGOLk081vI86NcXjtAJSXfmOot54zxgA21H8R9 7ayKz6adYlYnX1XI0+wJL9opE26Kc/xRJ0kwTwLyx7WFNF1KcaslPtPTgZE4H/EDQFPE b8Vo0vAgtB4ufw1TwS/T5VNe9z1IP2kcitu2dWpKHVr4f9v64w/L0KaqGdafBdICPQc5 /vRv3Q55McPvm8w68ULcoePV1L+DP4h4hxQxuFjeaylJzDWcv0CZbgMvC2wxXO7meoYR TisdWWzLQMPOIhG8f+tYNQgNwfGvKjCmQobdOVR3pQn/RHmxWbX2rool7s3xnu2woaYy nQfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=tUrfXqkYekxSMnuWbX3OlNEJmzCyXafj9mwWNcCj8H4=; b=qol2P+fWMoHV/r5wsZlHMD82keiQWlDeFb4wPPNMZOSyBikGhdGG4+83KQ4Cs61elt 0TVZa23BIcQhJ8cl2gODA/Fo2FNGGm0PdO1ZjIC+yRWSyCvK8A9o38ys6IiGemYob0QM MIvKunSnUqymFSxrCzvPsH1SyRHZ9RPWUx12G0bDZ9zyCq3yj6ewCzzd3hgxmfJgIgsi N6E1QKm++ASN7Aw7ZVteQz3OP/6i04QKloadOL0bp+DeByAtX6Rmh6mbiv88h7q6KgJ9 26WcPHI6o0pRbiD/3FxjrJU69KU2V1GebKdNEoqpgoVh2KEs9cJl4AUOramDP7J5pELG H1zA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Tz5Iq08K; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id w6-20020a170902a70600b00153b2d16510si542322plq.280.2022.04.07.13.13.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Apr 2022 13:13:18 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Tz5Iq08K; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BA1602D7307; Thu, 7 Apr 2022 12:34:48 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245266AbiDGMiN (ORCPT + 99 others); Thu, 7 Apr 2022 08:38:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245366AbiDGMhw (ORCPT ); Thu, 7 Apr 2022 08:37:52 -0400 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 053E71A54C7 for ; Thu, 7 Apr 2022 05:35:52 -0700 (PDT) Received: by mail-wr1-x429.google.com with SMTP id c7so7730858wrd.0 for ; Thu, 07 Apr 2022 05:35:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=tUrfXqkYekxSMnuWbX3OlNEJmzCyXafj9mwWNcCj8H4=; b=Tz5Iq08KGRUx7hloT92JNwU36GWMyEuVP2W3+SrKoB4RJsCAWhTDsAi+C9B6KAyysp 6r622AeGiq+2lM4egA++4LTaY1+FeGBJ+ntNrjZbtz8Rt/jtejzMS6OR16IXG0hJIg06 ZjzZdf7FOGPXCl/VdVzeJe8dmXWqDMK5qZbf9TClbhQTYFy4ydH8iEhhWZtzteGqUWXk BLMhTuSQE1bP6P7gA+z+MsAPZmqTtS0Js8PS6hRUAIjukhdFulhvIYRizjxdYnifBl/0 RAxGxStvFZaaWbvEig52zaf4UHcIP/apMsStN+4tSlYknMZLba8IvfIXqnSnVAhF8RDT 8g3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=tUrfXqkYekxSMnuWbX3OlNEJmzCyXafj9mwWNcCj8H4=; b=K3wL0FRl7nDOC+GT5Zyjuk/HxepNJnAX64NN1vHPs1Re+3pjUlnRtnNgjAXC02KWMC yeCZBXzq2sLdiIBmypuuWCc+3NNDNCqAoGDXrMjh3VvXA73CSzhnN6svWC22i31BaVzx gsg2IWIGwKG+02Hn6qIFH1E+/Wuet8urLp5w106PkwUrPtYfn87KXP4oaJUJlUf4NJs1 q17Ps25q7J6mHJZ2UIgOylvEunHP3GY6QaBBUOPAXwcf+Zpvys6jr6K/XwBAo/dA6EkX hWTCQ3tlgiy1iYdWEgYNed57cFRlWUMIfhsa6eHoBMjJaLGZUa2fz+6wIUoTbvmrBdaW 8prQ== X-Gm-Message-State: AOAM530Bor5+GRb2Wm1OvKETEAEi5CssTDWpj9kYIC1ri8bgnE1CzbWG mXwdPJeFCHkpa+RurhGzw08/Ipth0Xo= X-Received: by 2002:adf:fb50:0:b0:206:d26:c20a with SMTP id c16-20020adffb50000000b002060d26c20amr10788261wrs.446.1649334950370; Thu, 07 Apr 2022 05:35:50 -0700 (PDT) Received: from [192.168.1.14] ([197.57.231.245]) by smtp.gmail.com with ESMTPSA id o11-20020adf9d4b000000b001f0077ea337sm16984753wre.22.2022.04.07.05.35.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 07 Apr 2022 05:35:49 -0700 (PDT) Message-ID: <658b52bb-7384-143d-ab90-afcfdcec6eeb@gmail.com> Date: Thu, 7 Apr 2022 14:35:48 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH v3] staging: rtl8712: remove unnecessary parentheses Content-Language: en-US To: Julia Lawall Cc: outreachy@lists.linux.dev, Larry.Finger@lwfinger.net, florian.c.schilhabel@googlemail.com, gregkh@linuxfoundation.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org References: <20220406224057.5260-1-eng.alaamohamedsoliman.am@gmail.com> From: Alaa Mohamed In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On ٧‏/٤‏/٢٠٢٢ ٠٦:٠٦, Julia Lawall wrote: > > On Thu, 7 Apr 2022, Alaa Mohamed wrote: > >> Reported by checkpatch: >> >> CHECK: Unnecessary parentheses around param->u.crypt.key[16]: 85 >> CHECK: Unnecessary parentheses around param->u.crypt.key[24]: 87 >> CHECK: Unnecessary parentheses around padapter->mlmepriv: 603 >> CHECK: Unnecessary parentheses around wrqu->encoding: 1497 >> CHECK: Unnecessary parentheses around wrqu->encoding: 1592 >> CHECK: Unnecessary parentheses around padapter->mlmepriv: 1593 >> CHECK: Unnecessary parentheses around wrqu->param: 1673 >> CHECK: Unnecessary parentheses around pmlmepriv->scanned_queue.lock: 1967 >> CHECK: Unnecessary parentheses around pmlmepriv->scanned_queue.lock: 1977 >> CHECK: Unnecessary parentheses around pmlmepriv->scanned_queue.lock: 1999 > This still needs to be improved. Should be something like : CHECK: Unnecessary parentheses '(' around struct ? > >> Signed-off-by: Alaa Mohamed >> --- >> Changes in v2: >> - Edit commit subject >> - Edit commit message >> - Fix the same check in more lines >> - Remove space before '.skey' in >> "memcpy(psta->tkiptxmickey.skey," in lines 84 and 86. >> --- >> Changes in v3: >> return the space before '.skey' in >> "memcpy(psta->tkiptxmickey.skey," in lines 84 and 86 > Thanks for taking care of this part. > > julia > >> --- >> drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 20 +++++++++---------- >> 1 file changed, 10 insertions(+), 10 deletions(-) >> >> diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c >> index 3b6926613257..f1e352b7f83e 100644 >> --- a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c >> +++ b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c >> @@ -82,9 +82,9 @@ static inline void handle_pairwise_key(struct sta_info *psta, >> (param->u.crypt. key_len > 16 ? 16 : param->u.crypt.key_len)); >> if (strcmp(param->u.crypt.alg, "TKIP") == 0) { /* set mic key */ >> memcpy(psta->tkiptxmickey. skey, >> - &(param->u.crypt.key[16]), 8); >> + ¶m->u.crypt.key[16], 8); >> memcpy(psta->tkiprxmickey. skey, >> - &(param->u.crypt.key[24]), 8); >> + ¶m->u.crypt.key[24], 8); >> padapter->securitypriv. busetkipkey = false; >> mod_timer(&padapter->securitypriv.tkip_timer, >> jiffies + msecs_to_jiffies(50)); >> @@ -600,7 +600,7 @@ static int r8711_wx_get_name(struct net_device *dev, >> u32 ht_ielen = 0; >> char *p; >> u8 ht_cap = false; >> - struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); >> + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; >> struct wlan_bssid_ex *pcur_bss = &pmlmepriv->cur_network.network; >> u8 *prates; >> >> @@ -1494,7 +1494,7 @@ static int r8711_wx_set_enc(struct net_device *dev, >> u32 keyindex_provided; >> struct NDIS_802_11_WEP wep; >> enum NDIS_802_11_AUTHENTICATION_MODE authmode; >> - struct iw_point *erq = &(wrqu->encoding); >> + struct iw_point *erq = &wrqu->encoding; >> struct _adapter *padapter = netdev_priv(dev); >> >> key = erq->flags & IW_ENCODE_INDEX; >> @@ -1589,8 +1589,8 @@ static int r8711_wx_get_enc(struct net_device *dev, >> { >> uint key; >> struct _adapter *padapter = netdev_priv(dev); >> - struct iw_point *erq = &(wrqu->encoding); >> - struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); >> + struct iw_point *erq = &wrqu->encoding; >> + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; >> union Keytype *dk = padapter->securitypriv.DefKey; >> >> if (!check_fwstate(pmlmepriv, _FW_LINKED)) { >> @@ -1670,7 +1670,7 @@ static int r871x_wx_set_auth(struct net_device *dev, >> union iwreq_data *wrqu, char *extra) >> { >> struct _adapter *padapter = netdev_priv(dev); >> - struct iw_param *param = (struct iw_param *)&(wrqu->param); >> + struct iw_param *param = (struct iw_param *)&wrqu->param; >> int paramid; >> int paramval; >> int ret = 0; >> @@ -1964,7 +1964,7 @@ static int r871x_get_ap_info(struct net_device *dev, >> return -EINVAL; >> data[32] = 0; >> >> - spin_lock_irqsave(&(pmlmepriv->scanned_queue.lock), irqL); >> + spin_lock_irqsave(&pmlmepriv->scanned_queue.lock, irqL); >> phead = &queue->queue; >> plist = phead->next; >> while (1) { >> @@ -1974,7 +1974,7 @@ static int r871x_get_ap_info(struct net_device *dev, >> if (!mac_pton(data, bssid)) { >> netdev_info(dev, "r8712u: Invalid BSSID '%s'.\n", >> (u8 *)data); >> - spin_unlock_irqrestore(&(pmlmepriv->scanned_queue.lock), >> + spin_unlock_irqrestore(&pmlmepriv->scanned_queue.lock, >> irqL); >> return -EINVAL; >> } >> @@ -1996,7 +1996,7 @@ static int r871x_get_ap_info(struct net_device *dev, >> } >> plist = plist->next; >> } >> - spin_unlock_irqrestore(&(pmlmepriv->scanned_queue.lock), irqL); >> + spin_unlock_irqrestore(&pmlmepriv->scanned_queue.lock, irqL); >> if (pdata->length >= 34) { >> if (copy_to_user((u8 __user *)pdata->pointer + 32, >> (u8 *)&pdata->flags, 1)) >> -- >> 2.35.1 >> >> >>