Re: [PATCH 01/19] staging: rtl8188eu: cleanup inconsistent indenting

From: Dan Carpenter
Date: Mon Oct 01 2018 - 01:20:07 EST


On Sun, Sep 30, 2018 at 01:30:11PM -0700, Joe Perches wrote:
> On Sun, 2018-09-30 at 21:52 +0200, Michael Straube wrote:
> > Cleanup all inconsistent indenting reported by smatch.
>
> There are also some others like:
>
> drivers/staging/rtl8188eu/core/rtw_mlme.c:1752: WARNING:SUSPECT_CODE_INDENT: suspect code indent for conditional statements (8, 24)
> 1750: if ((ndisauthmode == Ndis802_11AuthModeWPA) ||
> 1751: (ndisauthmode == Ndis802_11AuthModeWPAPSK))
> 1752: authmode = _WPA_IE_ID_;
>
> Perhaps smatch can be enhanced to find those too.
>

Style issues are not something I want to get into... I had hoped that
this test would find bugs, because stuff like this looks so suspicious:

diff --git a/drivers/staging/rtl8188eu/core/rtw_ieee80211.c b/drivers/staging/rtl8188eu/core/rtw_ieee80211.c
index 20f34d25c369..5c4ff81987bd 100644
--- a/drivers/staging/rtl8188eu/core/rtw_ieee80211.c
+++ b/drivers/staging/rtl8188eu/core/rtw_ieee80211.c
@@ -246,7 +246,7 @@ int rtw_generate_ie(struct registry_priv *pregistrypriv)
wireless_mode = pregistrypriv->wireless_mode;
}

- rtw_set_supported_rate(pdev_network->SupportedRates, wireless_mode);
+ rtw_set_supported_rate(pdev_network->SupportedRates, wireless_mode);

rateLen = rtw_get_rateset_len(pdev_network->SupportedRates);

But I've never found even one bug with the inconsistent indenting
check. The other related test about missing curly braces is pretty
useful though.

regards,
dan carpenter