Skip to contentSkip to conversation

mmc: host: s3cmci: fix broken conditional expression

PATCH Applied Arnd Bergmann 2 participants 2 messages Mar 29, 2017 – Mar 30, 2017 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: host: s3cmci: fix broken conditional expression

The DT support introduced a typo that gcc detects when -Wempty-body is enabled:

drivers/mmc/host/s3cmci.c: In function 's3cmci_probe_pdata':
drivers/mmc/host/s3cmci.c:1543:29: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
if (pdata->wprotect_invert);

Clearly the ';' was not intended here, so remove it.

Fixes 4b13f3b290d1 ("mmc: host: s3cmci: allow probing from device tree")
---
 drivers/mmc/host/s3cmci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/host/s3cmci.c +1 -1
index 09eab2120bbd..bbf1fbbc8e2a 100644
@@ -1540,7 +1540,7 @@ static int s3cmci_probe_pdata(struct s3cmci_host *host)
 	if (pdata->no_detect)
 		mmc->caps |= MMC_CAP_NEEDS_POLL;
 
-	if (pdata->wprotect_invert);
+	if (pdata->wprotect_invert)
 		mmc->caps2 |= MMC_CAP2_RO_ACTIVE_HIGH;
 
 	if (pdata->detect_invert)
Signature · 1 line
2.9.0
Applied
#1 lore raw
Quoted 11 lines · Arnd Bergmann

The DT support introduced a typo that gcc detects when -Wempty-body is enabled:

drivers/mmc/host/s3cmci.c: In function 's3cmci_probe_pdata':
drivers/mmc/host/s3cmci.c:1543:29: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
if (pdata->wprotect_invert);

Clearly the ';' was not intended here, so remove it.

Fixes 4b13f3b290d1 ("mmc: host: s3cmci: allow probing from device tree")

Thanks, applied for next!

Kind regards
Uffe

Quoted 20 lines
---
 drivers/mmc/host/s3cmci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/host/s3cmci.c +1 -2
index 09eab2120bbd..bbf1fbbc8e2a 100644
@@ -1540,7 +1540,7 @@ static int s3cmci_probe_pdata(struct s3cmci_host *host)
        if (pdata->no_detect)
                mmc->caps |= MMC_CAP_NEEDS_POLL;
 
-       if (pdata->wprotect_invert);
+       if (pdata->wprotect_invert)
                mmc->caps2 |= MMC_CAP2_RO_ACTIVE_HIGH;
 
        if (pdata->detect_invert)
--

2.9.0