X-GM-THRID: 6674202395831959552 X-Received: by 2002:a2e:8912:: with SMTP id d18mr1520065lji.26.1553962691148; Sat, 30 Mar 2019 09:18:11 -0700 (PDT) X-BeenThere: outreachy-kernel@googlegroups.com Received: by 2002:ac2:48a7:: with SMTP id u7ls472361lfg.5.gmail; Sat, 30 Mar 2019 09:18:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqzqib2wHC/dUm8PK+24qMD9Vc9cjmVh7VPISLhymYtxGqQkTvPsk/dJdVzRQC+OuXUaPVFb X-Received: by 2002:a05:6512:204:: with SMTP id a4mr1257020lfo.10.1553962690374; Sat, 30 Mar 2019 09:18:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553962690; cv=none; d=google.com; s=arc-20160816; b=tcR/IY1Y4UTWKG+jNW1/xx6OgDX+UzkOcd/qV32NZzQlFwABvD1UiF0sy0u5W4C366 rIkuLtTL1tfz1xgwB9ppF0NVGrnLvoCtNFLuo9JzmYwzavxRq7scj4Kv6wyV0ij/oCOX BbXDueyT120YV1AvYqlnVXcCz3TObVDqtDPsrLnTGmoJv7iUxQm2qTbxJfJtK+M8Lva6 w0eOWbYQTPPSWKfhuiMsiqgu7otwi9fzpa7lrGLWIOEFxcEqr5+tOdRG/8ScthFNOilo zRVkeHhPPz/l2E6lOx5gF8JFnu+xzUtRr9rRrzLEhH7VzL5lXBaNOZE1UMUHDrGXvgAO 6eEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:references:message-id:in-reply-to:subject :cc:to:from:date; bh=oHV0ncFtZ5LKUvmGsm1C1KzSosdSSvmgBlUGD8dzCBY=; b=Z5kLRvS3uWUwCDaTqqd/ygeWo/8VQR5ldCaZ0DT/uq5n4WZRm22wb+RPIe7SQh1c3q JCjj0UNOAbY48kjgNUYA7IasQjFIFzzj0eD7rGRMGEbihSw30r9OM+LRMR2Ye4vgasuq lEuAx6+K8rK4iVEc/icdcQOn2QWi69a1tREMw8ty/xulFT9fv3ecVmA4aGUXmm9VWJmi b0kVbrIvXp5toWxkIGUyx0tqh7Rhj4HKEyWksEMpTyquIN9Wfi3cTEMmtMEAvZsehXgf ncCU9Laq9oix9Jr4id8psnjDjOiqfNtvnubUTCYq89kvzq3Nd+C8Nem7q1PivDOJTNLq 1/oA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 192.134.164.83 is neither permitted nor denied by domain of julia.lawall@lip6.fr) smtp.mailfrom=julia.lawall@lip6.fr Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr. [192.134.164.83]) by gmr-mx.google.com with ESMTPS id z15si231524lfe.5.2019.03.30.09.18.10 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 30 Mar 2019 09:18:10 -0700 (PDT) Received-SPF: neutral (google.com: 192.134.164.83 is neither permitted nor denied by domain of julia.lawall@lip6.fr) client-ip=192.134.164.83; Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 192.134.164.83 is neither permitted nor denied by domain of julia.lawall@lip6.fr) smtp.mailfrom=julia.lawall@lip6.fr X-IronPort-AV: E=Sophos;i="5.60,289,1549926000"; d="scan'208";a="376470405" Received: from abo-75-106-68.mrs.modulonet.fr (HELO hadrien) ([85.68.106.75]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Mar 2019 17:18:09 +0100 Date: Sat, 30 Mar 2019 17:18:09 +0100 (CET) From: Julia Lawall X-X-Sender: jll@hadrien To: Nishka Dasgupta cc: gregkh@linuxfoundation.org, outreachy-kernel@googlegroups.com Subject: Re: [Outreachy kernel] [PATCH v3] staging: rtlwifi: phydm: Remove parentheses In-Reply-To: <20190330155517.2194-1-nishka.dasgupta@yahoo.com> Message-ID: References: <20190330155517.2194-1-nishka.dasgupta@yahoo.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII On Sat, 30 Mar 2019, 'Nishka Dasgupta' via outreachy-kernel wrote: > Remove unnecessary parentheses on the right hand side and simplify > expression from 'status = status & ' to 'status &= > expression' to make code more readable. It should be two patches, since you have done two things. There is a third thing to do, which is get rid of the checkpatch error about a ( at the end of a line. There is plenty of room for the first two arguments, as far as I can see. julia > Issue first detected using Coccinelle. > > Signed-off-by: Nishka Dasgupta > --- > Changes in v3: > - Move explanation of simplification to commit log. > > drivers/staging/rtlwifi/phydm/phydm_debug.c | 18 ++++++++---------- > 1 file changed, 8 insertions(+), 10 deletions(-) > > diff --git a/drivers/staging/rtlwifi/phydm/phydm_debug.c b/drivers/staging/rtlwifi/phydm/phydm_debug.c > index 91f2c054d83b..13b34dc33011 100644 > --- a/drivers/staging/rtlwifi/phydm/phydm_debug.c > +++ b/drivers/staging/rtlwifi/phydm/phydm_debug.c > @@ -51,20 +51,18 @@ static inline void phydm_check_dmval_txagc(struct phy_dm_struct *dm, u32 used, > (power_index << 16) | (power_index << 8) | > (power_index); > for (i = 0; i < ODM_RATEVHTSS2MCS9; i += 4) > - status = (status & > - phydm_api_set_txagc( > - dm, power_index, > - (enum odm_rf_radio_path) > + status &= phydm_api_set_txagc( > + dm, power_index, > + (enum odm_rf_radio_path) > dm_value[1], > - i, false)); > + i, false); > } else if (dm->support_ic_type & ODM_RTL8197F) { > for (i = 0; i <= ODM_RATEMCS15; i++) > - status = (status & > - phydm_api_set_txagc( > - dm, power_index, > - (enum odm_rf_radio_path) > + status &= phydm_api_set_txagc( > + dm, power_index, > + (enum odm_rf_radio_path) > dm_value[1], > - i, false)); > + i, false); > } > > if (status) > -- > 2.19.1 > > -- > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group. > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com. > To post to this group, send email to outreachy-kernel@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20190330155517.2194-1-nishka.dasgupta%40yahoo.com. > For more options, visit https://groups.google.com/d/optout. >