Skip to contentSkip to conversation

ath/ath9k/ar9003_eeprom.c: Remove unnecessary semicolon

PATCH Superseded Peter Senna Tschudin 3 participants 5 messages Sep 30, 2012 – Oct 10, 2012 1 message not in the archive

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ath/ath9k/ar9003_eeprom.c: Remove unnecessary semicolon

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r1@
position p;
@@
if (...);@p

@script:python@
p0 << r1.p;
@@
// Emacs org-mode output
cocci.print_main("", p0)
cocci.print_secs("", p0)
// </smpl>

---
 drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath9k/ar9003_eeprom.c +1 -1
index 5bbe505..189aeb2 100644
@@ -2989,7 +2989,7 @@ static u32 ath9k_hw_ar9300_get_eeprom(struct ath_hw *ah,
 	case EEP_PAPRD:
 		if (AR_SREV_9462(ah))
 			return false;
-		if (!ah->config.enable_paprd);
+		if (!ah->config.enable_paprd)
 			return false;
 		return !!(pBase->featureEnable & BIT(5));
 	case EEP_CHAIN_MASK_REDUCE:
Signature · 1 line
1.7.11.4
#2 lore raw
In reply to a message not in the archive

drivers/net/wireless/ath/ath9k/ar9003_eeprom.c static u32 ath9k_hw_ar9300_get_eeprom(struct ath_hw *ah, · line 2993

Quoted 3 lines · Peter Senna Tschudin
drivers/net/wireless/ath/ath9k/ar9003_eeprom.c +1 -1
-		if (!ah->config.enable_paprd);
+		if (!ah->config.enable_paprd)
 			return false;

That's not an "unnecessary semicolon", it's a pretty strange bug :)

johannes

#3 lore raw

PATCH v2 1/1 ath/ath9k/ar9003_eeprom.c: Remove semicolon after if

In reply to Peter Senna Tschudin

The semantic patch that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r1@
position p;
@@
if (...);@p

@script:python@
p0 << r1.p;
@@
// Emacs org-mode output
cocci.print_main("", p0)
cocci.print_secs("", p0)
// </smpl>

---
NOTE: This patch changes the semantics.

Changes from V1:
Commit message
Added a note about semantics change

 drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath9k/ar9003_eeprom.c +1 -1
index 5bbe505..189aeb2 100644
@@ -2989,7 +2989,7 @@ static u32 ath9k_hw_ar9300_get_eeprom(struct ath_hw *ah,
 	case EEP_PAPRD:
 		if (AR_SREV_9462(ah))
 			return false;
-		if (!ah->config.enable_paprd);
+		if (!ah->config.enable_paprd)
 			return false;
 		return !!(pBase->featureEnable & BIT(5));
 	case EEP_CHAIN_MASK_REDUCE:
Signature · 1 line
1.7.11.4
#4 lore raw

PATCH v3 1/1 ath/ath9k/ar9003_eeprom.c: Remove semicolon after if

This patch remove a semicolon after if(...) that is preventing the error check to work correctly. Removing this semicolon will change the code behavior, but this is intended.

The semantic patch that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r1@
position p;
@@
if (...);@p

@script:python@
p0 << r1.p;
@@
// Emacs org-mode output
cocci.print_main("", p0)
cocci.print_secs("", p0)
// </smpl>

---
NOTE: This patch changes the semantics.

Changes from V1:
Commit message
Added a note about semantics change

Changes from V2:
Commit message

 drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath9k/ar9003_eeprom.c +1 -1
index 5bbe505..189aeb2 100644
@@ -2989,7 +2989,7 @@ static u32 ath9k_hw_ar9300_get_eeprom(struct ath_hw *ah,
 	case EEP_PAPRD:
 		if (AR_SREV_9462(ah))
 			return false;
-		if (!ah->config.enable_paprd);
+		if (!ah->config.enable_paprd)
 			return false;
 		return !!(pBase->featureEnable & BIT(5));
 	case EEP_CHAIN_MASK_REDUCE:
Signature · 1 line
1.7.11.4
#5 lore raw

Re: [PATCH V3] ath/ath9k/ar9003_eeprom.c: Remove semicolon after if

Quoted 4 lines · Peter Senna Tschudin

This patch remove a semicolon after if(...) that is preventing the error check to work correctly. Removing this semicolon will change the code behavior, but this is intended.

Quoted 8 lines

The semantic patch that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r1@
position p;
@@
if (...);@p

this semantic patch would be a lot less tedious to inspect the results if it excluded else after the semicolon.

I've used perl for more or less the same output.