summaryrefslogtreecommitdiffstats
path: root/drivers/s390/cio/vfio_ccw_cp.c
diff options
context:
space:
mode:
authorEric Farman <farman@linux.ibm.com>2019-06-06 22:28:24 +0200
committerCornelia Huck <cohuck@redhat.com>2019-06-17 13:28:50 +0200
commite64bd68946bec40d9dfe6ea5d22733119908e6f3 (patch)
tree5d324ee4495974d5dd40f511d17101b52ea20d76 /drivers/s390/cio/vfio_ccw_cp.c
parent812271b91006e59407ea30ee72341d92b240f667 (diff)
downloadtalos-op-linux-e64bd68946bec40d9dfe6ea5d22733119908e6f3.tar.gz
talos-op-linux-e64bd68946bec40d9dfe6ea5d22733119908e6f3.zip
s390/cio: Refactor the routine that handles TIC CCWs
Extract the "does the target of this TIC already exist?" check from ccwchain_handle_tic(), so that it's easier to refactor that function into one that cp_init() is able to use. Signed-off-by: Eric Farman <farman@linux.ibm.com> Reviewed-by: Cornelia Huck <cohuck@redhat.com> Message-Id: <20190606202831.44135-3-farman@linux.ibm.com> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
Diffstat (limited to 'drivers/s390/cio/vfio_ccw_cp.c')
-rw-r--r--drivers/s390/cio/vfio_ccw_cp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/s390/cio/vfio_ccw_cp.c b/drivers/s390/cio/vfio_ccw_cp.c
index 47cd7f94f42f..628daf1a8f9a 100644
--- a/drivers/s390/cio/vfio_ccw_cp.c
+++ b/drivers/s390/cio/vfio_ccw_cp.c
@@ -502,10 +502,6 @@ static int ccwchain_handle_tic(struct ccw1 *tic, struct channel_program *cp)
struct ccwchain *chain;
int len, ret;
- /* May transfer to an existing chain. */
- if (tic_target_chain_exists(tic, cp))
- return 0;
-
/* Get chain length. */
len = ccwchain_calc_length(tic->cda, cp);
if (len < 0)
@@ -540,6 +536,10 @@ static int ccwchain_loop_tic(struct ccwchain *chain, struct channel_program *cp)
if (!ccw_is_tic(tic))
continue;
+ /* May transfer to an existing chain. */
+ if (tic_target_chain_exists(tic, cp))
+ continue;
+
ret = ccwchain_handle_tic(tic, cp);
if (ret)
return ret;
OpenPOWER on IntegriCloud