Skip to contentSkip to conversation

Input: da7280 - delete a stray tab

PATCH In review Dan Carpenter 2 participants 3 messages Dec 16, 2020

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

PATCH 1/1 Input: da7280 - delete a stray tab

This line is indented one tab too far.

---
 drivers/input/misc/da7280.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/misc/da7280.c +0 -1
index 37568b00873d..fe06693579ca 100644
@@ -863,7 +863,7 @@ static void da7280_parse_properties(struct device *dev,
 		gpi_str3[7] = '0' + i;
 		haptics->gpi_ctl[i].polarity = 0;
 		error = device_property_read_string(dev, gpi_str3, &str);
-			haptics->gpi_ctl[i].polarity +		haptics->gpi_ctl[i].polarity  				da7280_haptic_of_gpi_pol_str(dev, str);
 	}
 
Signature · 1 line
2.29.2
#1 lore raw
Quoted 4 lines · Dan Carpenter

This line is indented one tab too far.

---

Thanks for the patch but it is already fixed by Dmitry as below.
---
An "if" testing for error condition has accidentally been dropped from the code.

		error = device_property_read_string(dev, gpi_str3, &str);

+ if (!error)
haptics->gpi_ctl[i].polarity =
da7280_haptic_of_gpi_pol_str(dev, str);

Kind regards,
Roy

#2 lore raw
Quoted 12 lines · Roy Im
Quoted 4 lines · Dan Carpenter

This line is indented one tab too far.

---

Thanks for the patch but it is already fixed by Dmitry as below.
---
An "if" testing for error condition has accidentally been dropped from the code.

		error = device_property_read_string(dev, gpi_str3, &str);

Review

Quoted 2 lines
(quoted diff) +1 -0
+		if (!error)
 			haptics->gpi_ctl[i].polarity >  				da7280_haptic_of_gpi_pol_str(dev, str);

Huh... Well, at least the kbuild bot discovered this using the Smatch warning for inconsistent indenting so that's nice.

https://lists.01.org/hyperkitty/list/[email protected]/thread/IB3H2KDL2HZ5WGNAER7TLCJQHZJH7S7E/

This is one of the first real bugs that that indenting has found, maybe if Smatch had used some more of the context clues the warning could have been made better.

Presumably W=1 and some of the other analysis tools would have warned about the unused "error = " assignment if we had waited another day.

regards,
dan carpenter