Skip to content

Commit 9de82ca

Browse files
arndbdjbw
authored andcommitted
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>
1 parent 1e28eed commit 9de82ca

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/dax/bus.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,11 @@ static ssize_t do_id_store(struct device_driver *drv, const char *buf,
9090
list_add(&dax_id->list, &dax_drv->ids);
9191
} else
9292
rc = -ENOMEM;
93-
} else
94-
/* nothing to remove */;
93+
}
9594
} else if (action == ID_REMOVE) {
9695
list_del(&dax_id->list);
9796
kfree(dax_id);
98-
} else
99-
/* dax_id already added */;
97+
}
10098
mutex_unlock(&dax_bus_lock);
10199

102100
if (rc < 0)

0 commit comments

Comments
 (0)