Skip to contentSkip to conversation

staging: rtl8188eu: checkpatch fixes: removed not necessary braces {}

PATCH Superseded Martin Karamihov 4 participants 11 messages Jan 28, 2017 – Feb 2, 2017 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: rtl8188eu: checkpatch fixes: removed not necessary braces {}

---
checkpatch fixes: remove not necessary braces

 drivers/staging/rtl8188eu/hal/bb_cfg.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/rtl8188eu/hal/bb_cfg.c +1 -2
index 134fa6c595a8..26e0ef224299 100644
@@ -534,9 +534,8 @@ static void store_pwrindex_offset(struct adapter *adapter,
 		power_level_offset[11] = data;
 	if (regaddr == rTxAGC_B_Mcs11_Mcs08)
 		power_level_offset[12] = data;
-	if (regaddr == rTxAGC_B_Mcs15_Mcs12) {
+	if (regaddr == rTxAGC_B_Mcs15_Mcs12)
 		power_level_offset[13] = data;
-	}
 }
 
 static void rtl_addr_delay(struct adapter *adapt,
Signature · 1 line
2.11.0
maintainer
#1 lore raw
Quoted 3 lines · Martin Karamihov

---
checkpatch fixes: remove not necessary braces

{sigh}

Please take some time, and go read Documentation/SubmittingPatches. Then wait a day, review the patches that other people send out, and then compose your patch to match the requirements and what you see other people do.

good luck!

greg k-h

#2 lore raw
Quoted 1 line · Greg KH

Please take some time, and go read Documentation/SubmittingPatches.

That's quickly done nowadays:

 bjorn@miraculix:/usr/local/src/git/linux$ cat Documentation/SubmittingPatches
 This file has moved to process/submitting-patches.rst

I don't know why it was necessary to move that file, but it looks like you, and the gazillion links and references to this document, just have to adopt to a new location.

Or submit a patch to fix it :)

Bjørn

author
#3 lore raw
Quoted 13 lines · Bjørn Mork
Quoted 1 line · Greg KH

Please take some time, and go read Documentation/SubmittingPatches.

That's quickly done nowadays:

  bjorn@miraculix:/usr/local/src/git/linux$ cat Documentation/SubmittingPatches
  This file has moved to process/submitting-patches.rst

I don't know why it was necessary to move that file, but it looks like you, and the gazillion links and references to this document, just have to adopt to a new location.

Quoted 5 lines

Or submit a patch to fix it :)

Bjørn

Hi all,

Sorry for the noise and thank you for the polite dialogue. Another eudyptula participant here, you guess :) I will try to figure out my mistakes and will send the patch again.

Martin

#4 lore raw
In reply to Bjørn Mork
Quoted 10 lines · Bjørn Mork
Quoted 1 line · Greg KH

Please take some time, and go read Documentation/SubmittingPatches.

That's quickly done nowadays:

 bjorn@miraculix:/usr/local/src/git/linux$ cat Documentation/SubmittingPatches
 This file has moved to process/submitting-patches.rst
Quoted 5 lines

I don't know why it was necessary to move that file, but it looks like you, and the gazillion links and references to this document, just have to adopt to a new location.

Or submit a patch to fix it :)

I did exactly that.
https://lkml.org/lkml/2017/1/10/1059

#5 lore raw

PATCH v2 1/1 staging: rtl8188eu: remove not necessary braces {} (checkpatch fix)

In reply to Martin Karamihov

This is checkpatch fix for hal/bb_cfg.c file:
remove not necessary braces {}

---
 drivers/staging/rtl8188eu/hal/bb_cfg.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/rtl8188eu/hal/bb_cfg.c +1 -2
index 134fa6c595a8..26e0ef224299 100644
@@ -534,9 +534,8 @@ static void store_pwrindex_offset(struct adapter *adapter,
 		power_level_offset[11] = data;
 	if (regaddr == rTxAGC_B_Mcs11_Mcs08)
 		power_level_offset[12] = data;
-	if (regaddr == rTxAGC_B_Mcs15_Mcs12) {
+	if (regaddr == rTxAGC_B_Mcs15_Mcs12)
 		power_level_offset[13] = data;
-	}
 }
 
 static void rtl_addr_delay(struct adapter *adapt,
Signature · 1 line
2.11.0
#6 lore raw

Re: [PATCH v2] staging: rtl8188eu: remove not necessary braces {} (checkpatch fix)

Quoted 13 lines · Martin Karamihov

This is checkpatch fix for hal/bb_cfg.c file:
remove not necessary braces {}

---
 drivers/staging/rtl8188eu/hal/bb_cfg.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/rtl8188eu/hal/bb_cfg.c +0 -0
index 134fa6c595a8..26e0ef224299 100644

drivers/staging/rtl8188eu/hal/bb_cfg.c static void store_pwrindex_offset(struct adapter *adapter, · line 539

Quoted 7 lines
drivers/staging/rtl8188eu/hal/bb_cfg.c +1 -2
@@ -534,9 +534,8 @@ static void store_pwrindex_offset(struct adapter *adapter,
 		power_level_offset[11] = data;
 	if (regaddr == rTxAGC_B_Mcs11_Mcs08)
 		power_level_offset[12] = data;
-	if (regaddr == rTxAGC_B_Mcs15_Mcs12) {
+	if (regaddr == rTxAGC_B_Mcs15_Mcs12)
 		power_level_offset[13] = data;
-	}

presumably, this and the regaddr block above it
should be an else if or a switch/case.

#7 lore raw

Re: [PATCH v2] staging: rtl8188eu: remove not necessary braces {} (checkpatch fix)

Quoted 9 lines · Joe Perches
Quoted 8 lines · Martin Karamihov

This is checkpatch fix for hal/bb_cfg.c file:
remove not necessary braces {}

---
  drivers/staging/rtl8188eu/hal/bb_cfg.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
Quoted 16 lines

drivers/staging/rtl8188eu/hal/bb_cfg.c static void store_pwrindex_offset(struct adapter *adapter, · line 539

Quoted 12 lines
drivers/staging/rtl8188eu/hal/bb_cfg.c +1 -2
index 134fa6c595a8..26e0ef224299 100644
@@ -534,9 +534,8 @@ static void store_pwrindex_offset(struct adapter *adapter,
  		power_level_offset[11] = data;
  	if (regaddr == rTxAGC_B_Mcs11_Mcs08)
  		power_level_offset[12] = data;
-	if (regaddr == rTxAGC_B_Mcs15_Mcs12) {
+	if (regaddr == rTxAGC_B_Mcs15_Mcs12)
  		power_level_offset[13] = data;
-	}

presumably, this and the regaddr block above it
should be an else if or a switch/case.

I will prepare the patch if this code modification is needed right now. Is it?

#8 lore raw

Re: [PATCH v2] staging: rtl8188eu: remove not necessary braces {} (checkpatch fix)

Quoted 27 lines · Martin Karamihov
Quoted 9 lines · Joe Perches
Quoted 8 lines · Martin Karamihov

This is checkpatch fix for hal/bb_cfg.c file:
remove not necessary braces {}

---
  drivers/staging/rtl8188eu/hal/bb_cfg.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
Quoted 16 lines

drivers/staging/rtl8188eu/hal/bb_cfg.c static void store_pwrindex_offset(struct adapter *adapter, · line 539

Quoted 12 lines
drivers/staging/rtl8188eu/hal/bb_cfg.c +1 -2
index 134fa6c595a8..26e0ef224299 100644
@@ -534,9 +534,8 @@ static void store_pwrindex_offset(struct adapter *adapter,
  		power_level_offset[11] = data;
  	if (regaddr == rTxAGC_B_Mcs11_Mcs08)
  		power_level_offset[12] = data;
-	if (regaddr == rTxAGC_B_Mcs15_Mcs12) {
+	if (regaddr == rTxAGC_B_Mcs15_Mcs12)
  		power_level_offset[13] = data;
-	}

presumably, this and the regaddr block above it
should be an else if or a switch/case.

Quoted 2 lines

I will prepare the patch if this code modification is needed right now. Is it?

No more nor less than the suggested brace removal. Do please remember (or learn) that checkpatch is a brainless script and clarifying the code for a human reader is much more important than making a file not have any checkpatch warnings.

#9 lore raw

Re: [PATCH v2] staging: rtl8188eu: remove not necessary braces {} (checkpatch fix)

Quoted 3 lines · Joe Perches

...and clarifying the code for a
human reader is much more important than making a
file not have any checkpatch warnings.

I agree. I respect the developers' own coding style and believe that some things (>80 characters long lines, name conventions, etc) should be fixed by themselves (if they want to do that). I selected several TODOs with requests for code cleanups and chose a fix in attempt to accomplish my task with minimal inconvenience for the maintainers. I failed in my first attempts breaking some basic rules, sorry about that.

Martin

#10 lore raw

Re: [PATCH v2] staging: rtl8188eu: remove not necessary braces {} (checkpatch fix)

Quoted 11 lines · Martin Karamihov
Quoted 3 lines · Joe Perches

...and clarifying the code for a
human reader is much more important than making a
file not have any checkpatch warnings.

I agree. I respect the developers' own coding style and believe that some things (>80 characters long lines, name conventions, etc) should be fixed by themselves (if they want to do that). I selected several TODOs with requests for code cleanups and chose a fix in attempt to accomplish my task with minimal inconvenience for the maintainers. I failed in my first attempts breaking some basic rules, sorry about that.

No, not at all. You did fine for a basic checkpatch cleanup. I just wanted to tell you to think beyond checkpatch.

cheers, Joe