All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jes Sorensen <jes.sorensen@gmail.com>
To: Vatika Harlalka <vatikaharlalka@gmail.com>,
	 outreachy-kernel@googlegroups.com
Subject: Re: [Outreachy kernel] [PATCH v4] Staging: rtl8188eu: Remove redundant if condition
Date: Mon, 23 Feb 2015 14:51:07 -0500	[thread overview]
Message-ID: <54EB84AB.3040408@gmail.com> (raw)
In-Reply-To: <20150223194642.GA28233@gmail.com>

On 02/23/15 14:46, Vatika Harlalka wrote:
> Remove redundant if condition as !result is always false.
> 
> Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
> ---
> Changes in v4: Added "Staging: rtl8188eu" to commit message.
> Changes in v3: Removed unneeded newline after if condition to
>                 follow kernel coding conventions.
> Changes in v2: Removed {} around the outer if condition as
>                 it has single statement.
> 
>  drivers/staging/rtl8188eu/hal/phy.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)

The patch description here does not match the code.

Jes


> diff --git a/drivers/staging/rtl8188eu/hal/phy.c b/drivers/staging/rtl8188eu/hal/phy.c
> index 3f663fe..e005150 100644
> --- a/drivers/staging/rtl8188eu/hal/phy.c
> +++ b/drivers/staging/rtl8188eu/hal/phy.c
> @@ -386,19 +386,18 @@ void phy_sw_chnl(struct adapter *adapt, u8 channel)
>  
>  static u8 get_right_chnl_for_iqk(u8 chnl)
>  {
> +	u8 place;
>  	u8 channel_all[ODM_TARGET_CHNL_NUM_2G_5G] = {
> -		1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
>  		36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64,
>  		100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122,
>  		124, 126, 128, 130, 132, 134, 136, 138, 140, 149, 151, 153,
>  		155, 157, 159, 161, 163, 165
>  	};
> -	u8 place = chnl;
>  
>  	if (chnl > 14) {
> -		for (place = 14; place < sizeof(channel_all); place++) {
> +		for (place = 0; place < sizeof(channel_all); place++) {
>  			if (channel_all[place] == chnl)
> -				return place-13;
> +				return ++place;
>  		}
>  	}
>  	return 0;
> 



      reply	other threads:[~2015-02-23 19:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-23 19:46 [PATCH v4] Staging: rtl8188eu: Remove redundant if condition Vatika Harlalka
2015-02-23 19:51 ` Jes Sorensen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54EB84AB.3040408@gmail.com \
    --to=jes.sorensen@gmail.com \
    --cc=outreachy-kernel@googlegroups.com \
    --cc=vatikaharlalka@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.