Skip to content
/ linux Public
forked from torvalds/linux

Commit

Permalink
nvmet: Use nvmet_is_port_enabled helper for pi_enable
Browse files Browse the repository at this point in the history
Remove code duplication.

Signed-off-by: Israel Rukshin <[email protected]>
Reviewed-by: Max Gurtovoy <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
  • Loading branch information
israelru authored and Christoph Hellwig committed Feb 2, 2021
1 parent e862801 commit cc34562
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/nvme/target/configfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,10 +266,8 @@ static ssize_t nvmet_param_pi_enable_store(struct config_item *item,
if (strtobool(page, &val))
return -EINVAL;

if (port->enabled) {
pr_err("Disable port before setting pi_enable value.\n");
if (nvmet_is_port_enabled(port, __func__))
return -EACCES;
}

port->pi_enable = val;
return count;
Expand Down

0 comments on commit cc34562

Please sign in to comment.