linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: rtl8712: rtl871x_ioctl_linux.c:  Cleaning up useless if statement
@ 2014-06-15 17:20 Rickard Strandqvist
  2014-06-15 17:20 ` Rickard Strandqvist
  2014-06-16  9:05 ` Dan Carpenter
  0 siblings, 2 replies; 5+ messages in thread
From: Rickard Strandqvist @ 2014-06-15 17:20 UTC (permalink / raw)
  To: Larry Finger, Florian Schilhabel
  Cc: Rickard Strandqvist, Greg Kroah-Hartman, Paul Gortmaker,
	Thomas Cort, Andy Shevchenko, devel, linux-kernel

The same code regardless of the outcome of the if statement. This may of
course be a miss and there should be a difference in the code.
And clean up another duplicate line of code.

This was partly found using a static code analysis program called cppcheck.

Rickard Strandqvist (1):
  staging: rtl8712: rtl871x_ioctl_linux.c:  Cleaning up useless if statement

 drivers/staging/rtl8712/rtl871x_ioctl_linux.c |    7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] staging: rtl8712: rtl871x_ioctl_linux.c:  Cleaning up useless if statement
  2014-06-15 17:20 [PATCH] staging: rtl8712: rtl871x_ioctl_linux.c: Cleaning up useless if statement Rickard Strandqvist
@ 2014-06-15 17:20 ` Rickard Strandqvist
  2014-06-16  9:05 ` Dan Carpenter
  1 sibling, 0 replies; 5+ messages in thread
From: Rickard Strandqvist @ 2014-06-15 17:20 UTC (permalink / raw)
  To: Larry Finger, Florian Schilhabel
  Cc: Rickard Strandqvist, Greg Kroah-Hartman, Paul Gortmaker,
	Thomas Cort, Andy Shevchenko, devel, linux-kernel

The same code regardless of the outcome of the if statement.
And clean up another duplicate line of code.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
 drivers/staging/rtl8712/rtl871x_ioctl_linux.c |    7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
index 23d539d..bd82bd3 100644
--- a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
+++ b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
@@ -1465,17 +1465,12 @@ static int r8711_wx_get_rate(struct net_device *dev,
 				RTL8712_RF_2T2R == rf_type)
 				max_rate = (bw_40MHz) ? ((short_GI) ? 300 :
 					    270) : ((short_GI) ? 144 : 130);
-			else if (mcs_rate & 0x0080) /* MCS7 */
-				max_rate = (bw_40MHz) ? ((short_GI) ? 150 :
-					    135) : ((short_GI) ? 72 : 65);
 			else /* default MCS7 */
 				max_rate = (bw_40MHz) ? ((short_GI) ? 150 :
 					    135) : ((short_GI) ? 72 : 65);
 			max_rate *= 2; /* Mbps/2 */
-			wrqu->bitrate.value = max_rate * 500000;
-		} else {
-			wrqu->bitrate.value = max_rate * 500000;
 		}
+		wrqu->bitrate.value = max_rate * 500000;
 	} else
 		return -ENOLINK;
 	return 0;
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] staging: rtl8712: rtl871x_ioctl_linux.c: Cleaning up useless if statement
  2014-06-15 17:20 [PATCH] staging: rtl8712: rtl871x_ioctl_linux.c: Cleaning up useless if statement Rickard Strandqvist
  2014-06-15 17:20 ` Rickard Strandqvist
@ 2014-06-16  9:05 ` Dan Carpenter
  2014-06-20 10:46   ` Rickard Strandqvist
  1 sibling, 1 reply; 5+ messages in thread
From: Dan Carpenter @ 2014-06-16  9:05 UTC (permalink / raw)
  To: Rickard Strandqvist
  Cc: Larry Finger, Florian Schilhabel, devel, Greg Kroah-Hartman,
	linux-kernel, Paul Gortmaker, Thomas Cort, Andy Shevchenko

On Sun, Jun 15, 2014 at 07:20:57PM +0200, Rickard Strandqvist wrote:
> The same code regardless of the outcome of the if statement. This may of
> course be a miss and there should be a difference in the code.
> And clean up another duplicate line of code.
> 
> This was partly found using a static code analysis program called cppcheck.
> 

We don't need a cover letter for a single patch.  Just put this stuff in
the patch description next time.

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] staging: rtl8712: rtl871x_ioctl_linux.c: Cleaning up useless if statement
  2014-06-16  9:05 ` Dan Carpenter
@ 2014-06-20 10:46   ` Rickard Strandqvist
  2014-06-20 10:59     ` Dan Carpenter
  0 siblings, 1 reply; 5+ messages in thread
From: Rickard Strandqvist @ 2014-06-20 10:46 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Larry Finger, Florian Schilhabel, devel, Greg Kroah-Hartman,
	linux-kernel, Paul Gortmaker, Thomas Cort, Andy Shevchenko

Hi

It's a bit confusing with this, I have received a lot of complaints
that I have not had a cover letter.
When should I include it? In an obvious patching. But where there's a
need to explain anything further should have a cover letter.

In this case, I suspected that there is a missed special case, that I
mentioned in the cover letter.
But did my patch that otherwise took away the otherwise unnecessary
code.  Thought it was the right use...?



Kind regards
Rickard Strandqvist


2014-06-16 11:05 GMT+02:00 Dan Carpenter <dan.carpenter@oracle.com>:
> On Sun, Jun 15, 2014 at 07:20:57PM +0200, Rickard Strandqvist wrote:
>> The same code regardless of the outcome of the if statement. This may of
>> course be a miss and there should be a difference in the code.
>> And clean up another duplicate line of code.
>>
>> This was partly found using a static code analysis program called cppcheck.
>>
>
> We don't need a cover letter for a single patch.  Just put this stuff in
> the patch description next time.
>
> regards,
> dan carpenter
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] staging: rtl8712: rtl871x_ioctl_linux.c: Cleaning up useless if statement
  2014-06-20 10:46   ` Rickard Strandqvist
@ 2014-06-20 10:59     ` Dan Carpenter
  0 siblings, 0 replies; 5+ messages in thread
From: Dan Carpenter @ 2014-06-20 10:59 UTC (permalink / raw)
  To: Rickard Strandqvist
  Cc: devel, Florian Schilhabel, Greg Kroah-Hartman, linux-kernel,
	Paul Gortmaker, Thomas Cort, Andy Shevchenko, Larry Finger

On Fri, Jun 20, 2014 at 12:46:33PM +0200, Rickard Strandqvist wrote:
> Hi
> 
> It's a bit confusing with this, I have received a lot of complaints
> that I have not had a cover letter.
> When should I include it? In an obvious patching. But where there's a
> need to explain anything further should have a cover letter.

Cover letters are for if you have a series of patches and they follow a
theme.  "Add support for XXX feature in a series of 8 patches".  "What
is in my pull request for the new kernel."  It's just a shorter summary.
This is just one patch not a series.

I have never sent a cover letter in my life.  I don't know who is
complaining to you...

In this case the changelog would have been better and more complete if
all the cover letter information were in the permanent commit log.

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-06-20 10:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-15 17:20 [PATCH] staging: rtl8712: rtl871x_ioctl_linux.c: Cleaning up useless if statement Rickard Strandqvist
2014-06-15 17:20 ` Rickard Strandqvist
2014-06-16  9:05 ` Dan Carpenter
2014-06-20 10:46   ` Rickard Strandqvist
2014-06-20 10:59     ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).