Skip to contentSkip to conversation

Add braces around if condition

PATCH Superseded Sreya Mittal 3 participants 4 messages Mar 7, 2017

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add braces around if condition

Fix the checkpatch issue:
braces {} should be used on all arms
of if-else statement.

---
 drivers/staging/sm750fb/ddk750_chip.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/sm750fb/ddk750_chip.c +2 -2
index 10cf729..7948ca9 100644
@@ -16,9 +16,9 @@ logical_chip_type_t sm750_get_chip_type(void)
 
 void sm750_set_chip_type(unsigned short devId, u8 revId)
 {
-	if (devId == 0x718)
+	if (devId == 0x718) {
 		chip = SM718;
-	else if (devId == 0x750) {
+	} else if (devId == 0x750) {
 		chip = SM750;
 		/* SM750 and SM750LE are different in their revision ID only. */
 		if (revId == SM750LE_REVISION_ID) {
Signature · 1 line
2.9.3
#1 lore raw
Quoted 5 lines · Sreya Mittal

Fix the checkpatch issue:
braces {} should be used on all arms
of if-else statement.

Please add tags to your commit subject. In order to find which tags to use for a certain file you can use git log <file.c> and see what tags were used for previous commits.

E.g for this patch the tag used by previous patches is "staging: sm750fb:" so the commit subject should be:

staging: sm750fb: Add braces around if condition

thanks,
Daniel.

#2 lore raw
Quoted 9 lines · Daniel Baluta
Quoted 5 lines · On Tue, Mar 7, 2017 at 3:16 PM, Sreya Mittal <[email protected]…

Fix the checkpatch issue:
braces {} should be used on all arms
of if-else statement.

Signed-off-by Sreya Mittal <[email protected] <javascript:>>
Quoted 9 lines

Please add tags to your commit subject. In order to find which tags to use for a certain file you can use git log <file.c> and see what tags were used for previous commits.

E.g for this patch the tag used by previous patches is "staging: sm750fb:" so the commit subject should be:

staging: sm750fb: Add braces around if condition

Sorry, my bad. I have corrected it in the next version.

Thanks,
Sreya

Quoted 4 lines

thanks,
Daniel.

#3 lore raw
In reply to Sreya Mittal
Quoted 3 lines · Sreya Mittal

Fix the checkpatch issue:
braces {} should be used on all arms
of if-else statement.

It's not a reason to resend, but it would be better to figure out how to be informed that you are exceeding 70 or so characters in the commit message rather than making very tiny lines. Tiny lines are a bit hard to read, because one has to switch lines frequently.

julia

Quoted 32 lines
---
 drivers/staging/sm750fb/ddk750_chip.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/sm750fb/ddk750_chip.c +2 -3
index 10cf729..7948ca9 100644
@@ -16,9 +16,9 @@ logical_chip_type_t sm750_get_chip_type(void)
 
 void sm750_set_chip_type(unsigned short devId, u8 revId)
 {
-	if (devId == 0x718)
+	if (devId == 0x718) {
 		chip = SM718;
-	else if (devId == 0x750) {
+	} else if (devId == 0x750) {
 		chip = SM750;
 		/* SM750 and SM750LE are different in their revision ID only. */
 		if (revId == SM750LE_REVISION_ID) {
--

2.9.3

--
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/20170307131650.4318-1-sreyamittal5%40gmail.com.
For more options, visit https://groups.google.com/d/optout.