diff options
author | Israel Rukshin <israelr@mellanox.com> | 2019-05-15 12:49:25 +0200 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2019-05-21 20:01:05 +0200 |
commit | a7b287bf7845fc335d53550a228ad4fa9aa659e5 (patch) | |
tree | c350ee382f1fc2b98ca5fa723c4805487f0a05d8 | |
parent | Linux 5.2-rc1 (diff) | |
download | linux-a7b287bf7845fc335d53550a228ad4fa9aa659e5.tar.xz linux-a7b287bf7845fc335d53550a228ad4fa9aa659e5.zip |
IB/iser: Refactor iscsi_iser_check_protection function
Reduce lines of code by using local variable.
Signed-off-by: Israel Rukshin <israelr@mellanox.com>
Reviewed-by: Max Gurtovoy <maxg@mellanox.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
-rw-r--r-- | drivers/infiniband/ulp/iser/iscsi_iser.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.c b/drivers/infiniband/ulp/iser/iscsi_iser.c index 9c185a8dabd3..dbad8275b3bc 100644 --- a/drivers/infiniband/ulp/iser/iscsi_iser.c +++ b/drivers/infiniband/ulp/iser/iscsi_iser.c @@ -406,13 +406,10 @@ static u8 iscsi_iser_check_protection(struct iscsi_task *task, sector_t *sector) { struct iscsi_iser_task *iser_task = task->dd_data; + enum iser_data_dir dir = iser_task->dir[ISER_DIR_IN] ? + ISER_DIR_IN : ISER_DIR_OUT; - if (iser_task->dir[ISER_DIR_IN]) - return iser_check_task_pi_status(iser_task, ISER_DIR_IN, - sector); - else - return iser_check_task_pi_status(iser_task, ISER_DIR_OUT, - sector); + return iser_check_task_pi_status(iser_task, dir, sector); } /** |