diff options
author | Arnd Bergmann <arnd@arndb.de> | 2021-03-22 14:44:58 +0300 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2021-03-22 19:20:06 +0300 |
commit | 9de82caad0282205d4c38a39456bce58e3219540 (patch) | |
tree | 10e33a280ccfc249e7c505880e9542de1c474034 /drivers/dax | |
parent | 1e28eed17697bcf343c6743f0028cc3b5dd88bf0 (diff) | |
download | linux-9de82caad0282205d4c38a39456bce58e3219540.tar.xz |
dax: avoid -Wempty-body warnings
gcc warns about an empty body in an else statement:
drivers/dax/bus.c: In function 'do_id_store':
drivers/dax/bus.c:94:48: error: suggest braces around empty body in an 'else' statement [-Werror=empty-body]
94 | /* nothing to remove */;
| ^
drivers/dax/bus.c:99:43: error: suggest braces around empty body in an 'else' statement [-Werror=empty-body]
99 | /* dax_id already added */;
| ^
In both of these cases, the 'else' exists only to have a place to
add a comment, but that comment doesn't really explain that much
either, so the easiest way to shut up that warning is to just
remove the else.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20210322114514.3490752-1-arnd@kernel.org
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/dax')
-rw-r--r-- | drivers/dax/bus.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/dax/bus.c b/drivers/dax/bus.c index 452e85ae87a8..5aee26e1bbd6 100644 --- a/drivers/dax/bus.c +++ b/drivers/dax/bus.c @@ -90,13 +90,11 @@ static ssize_t do_id_store(struct device_driver *drv, const char *buf, list_add(&dax_id->list, &dax_drv->ids); } else rc = -ENOMEM; - } else - /* nothing to remove */; + } } else if (action == ID_REMOVE) { list_del(&dax_id->list); kfree(dax_id); - } else - /* dax_id already added */; + } mutex_unlock(&dax_bus_lock); if (rc < 0) |