Skip to contentSkip to conversation

Staging: dgnc: Removed unnecessary braces

PATCH In review Melike Yurtoglu 2 participants 2 messages Feb 19, 2015 Staging

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Staging: dgnc: Removed unnecessary braces

The following patch fixes the checkpatch.pl warning:
WARNING: braces {} are not necessary for single statement blocks

---

v2:changed the subject

 drivers/staging/dgnc/dgnc_tty.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/staging/dgnc/dgnc_tty.c +0 -4
index f81a375..9ae1656 100644
@@ -887,9 +887,7 @@ void dgnc_check_queue_flow_control(struct channel_t *ch)
 			}
 		}
 		/* No FLOW */
-		else {
 			/* Empty... Can't do anything about the impending overflow... */
-		}
 	}
 
 	/*
@@ -921,9 +919,7 @@ void dgnc_check_queue_flow_control(struct channel_t *ch)
 			ch->ch_bd->bd_ops->send_start_character(ch);
 		}
 		/* No FLOW */
-		else {
 			/* Nothing needed. */
-		}
 	}
 }
 
Signature · 1 line
1.8.3.2
#1 lore raw
Quoted 2 lines · Melike Yurtoglu

The following patch fixes the checkpatch.pl warning:
WARNING: braces {} are not necessary for single statement blocks

I think it would be much clearer to say eg "remove empty else branch". In this case, if you remove the braces and leave the else, you have invalid code. Also, what is in the braces is not a statement, it is only comments. So the checkpatch message is overall more misleading than useful.

julia

Quoted 43 lines

---

v2:changed the subject

 drivers/staging/dgnc/dgnc_tty.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/staging/dgnc/dgnc_tty.c +0 -4
index f81a375..9ae1656 100644
@@ -887,9 +887,7 @@ void dgnc_check_queue_flow_control(struct channel_t *ch)
 			}
 		}
 		/* No FLOW */
-		else {
 			/* Empty... Can't do anything about the impending overflow... */
-		}
 	}
 
 	/*
@@ -921,9 +919,7 @@ void dgnc_check_queue_flow_control(struct channel_t *ch)
 			ch->ch_bd->bd_ops->send_start_character(ch);
 		}
 		/* No FLOW */
-		else {
 			/* Nothing needed. */
-		}
 	}
 }
 
Signature · 8 lines
1.8.3.2

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1424370082-14359-1-git-send-email-aysemelikeyurtoglu%40gmail.com.
For more options, visit https://groups.google.com/d/optout.