linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input: da7280 - delete a stray tab
@ 2020-12-16  8:32 Dan Carpenter
  2020-12-16 10:51 ` Roy Im
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2020-12-16  8:32 UTC (permalink / raw)
  To: Support Opensource, Roy Im; +Cc: Dmitry Torokhov, linux-input, kernel-janitors

This line is indented one tab too far.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/input/misc/da7280.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/misc/da7280.c b/drivers/input/misc/da7280.c
index 37568b00873d..fe06693579ca 100644
--- a/drivers/input/misc/da7280.c
+++ b/drivers/input/misc/da7280.c
@@ -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);
 	}
 
-- 
2.29.2


^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH] Input: da7280 - delete a stray tab
  2020-12-16  8:32 [PATCH] Input: da7280 - delete a stray tab Dan Carpenter
@ 2020-12-16 10:51 ` Roy Im
  2020-12-16 11:32   ` Dan Carpenter
  0 siblings, 1 reply; 3+ messages in thread
From: Roy Im @ 2020-12-16 10:51 UTC (permalink / raw)
  To: Dan Carpenter, Support Opensource, Roy Im
  Cc: Dmitry Torokhov, linux-input, kernel-janitors

On Wednesday, December 16, 2020 5:33 PM, Dan Carpenter wrote: 

> This line is indented one tab too far.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Input: da7280 - delete a stray tab
  2020-12-16 10:51 ` Roy Im
@ 2020-12-16 11:32   ` Dan Carpenter
  0 siblings, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2020-12-16 11:32 UTC (permalink / raw)
  To: Roy Im; +Cc: Support Opensource, Dmitry Torokhov, linux-input, kernel-janitors

On Wed, Dec 16, 2020 at 10:51:23AM +0000, Roy Im wrote:
> On Wednesday, December 16, 2020 5:33 PM, Dan Carpenter wrote: 
> 
> > This line is indented one tab too far.
> > 
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> > ---
> 
> 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);
> 

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/kbuild-all@lists.01.org/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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-12-16 11:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-16  8:32 [PATCH] Input: da7280 - delete a stray tab Dan Carpenter
2020-12-16 10:51 ` Roy Im
2020-12-16 11:32   ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).