From e16769d4bca67218531505ad1a8365d227fedcf9 Mon Sep 17 00:00:00 2001 From: Andrzej Pietrasiewicz Date: Mon, 28 Nov 2016 13:22:42 +0100 Subject: fs: configfs: don't return anything from drop_link Documentation/filesystems/configfs/configfs.txt says: "When unlink(2) is called on the symbolic link, the source item is notified via the ->drop_link() method. Like the ->drop_item() method, this is a void function and cannot return failure." The ->drop_item() is indeed a void function, the ->drop_link() is actually not. This, together with the fact that the value of ->drop_link() is silently ignored suggests, that it is the ->drop_link() return type that should be corrected and changed to void. This patch changes drop_link() signature and all its users. Signed-off-by: Andrzej Pietrasiewicz [hch: reverted reformatting of some code] Signed-off-by: Christoph Hellwig --- drivers/nvme/target/configfs.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'drivers/nvme') diff --git a/drivers/nvme/target/configfs.c b/drivers/nvme/target/configfs.c index af5e2dc4a3d5..a780e2dbc940 100644 --- a/drivers/nvme/target/configfs.c +++ b/drivers/nvme/target/configfs.c @@ -466,7 +466,7 @@ out_free_link: return ret; } -static int nvmet_port_subsys_drop_link(struct config_item *parent, +static void nvmet_port_subsys_drop_link(struct config_item *parent, struct config_item *target) { struct nvmet_port *port = to_nvmet_port(parent->ci_parent); @@ -479,7 +479,7 @@ static int nvmet_port_subsys_drop_link(struct config_item *parent, goto found; } up_write(&nvmet_config_sem); - return -EINVAL; + return; found: list_del(&p->entry); @@ -488,7 +488,6 @@ found: nvmet_disable_port(port); up_write(&nvmet_config_sem); kfree(p); - return 0; } static struct configfs_item_operations nvmet_port_subsys_item_ops = { @@ -542,7 +541,7 @@ out_free_link: return ret; } -static int nvmet_allowed_hosts_drop_link(struct config_item *parent, +static void nvmet_allowed_hosts_drop_link(struct config_item *parent, struct config_item *target) { struct nvmet_subsys *subsys = to_subsys(parent->ci_parent); @@ -555,14 +554,13 @@ static int nvmet_allowed_hosts_drop_link(struct config_item *parent, goto found; } up_write(&nvmet_config_sem); - return -EINVAL; + return; found: list_del(&p->entry); nvmet_genctr++; up_write(&nvmet_config_sem); kfree(p); - return 0; } static struct configfs_item_operations nvmet_allowed_hosts_item_ops = { -- cgit v1.2.3-59-g8ed1b