From 95032dca336e5578cf4ab22e403aa426c82e37aa Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Mon, 7 Sep 2009 12:09:16 +0000 Subject: [PATCH] The patch below fixes occurrences of the following recently introduced checkpatch warning: "do not use assignment in if condition". Signed-off-by: Bart Van Assche with some fixes git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1079 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_lib.c | 3 ++- scst/src/scst_targ.c | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 6ed5d2b90..6f123fa3f 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -2100,7 +2100,8 @@ static void scst_req_done(struct scsi_cmnd *scsi_cmd) TRACE_ENTRY(); - if (scsi_cmd && (req = scsi_cmd->sc_request)) { + if (scsi_cmd) { + req = scsi_cmd->sc_request; if (req) { if (req->sr_bufflen) kfree(req->sr_buffer); diff --git a/scst/src/scst_targ.c b/scst/src/scst_targ.c index c512d3fc8..fb77f550c 100644 --- a/scst/src/scst_targ.c +++ b/scst/src/scst_targ.c @@ -1255,8 +1255,11 @@ static inline struct scst_cmd *scst_get_cmd(struct scsi_cmnd *scsi_cmd, { struct scst_cmd *cmd = NULL; - if (scsi_cmd && (*req = scsi_cmd->sc_request)) - cmd = (struct scst_cmd *)(*req)->upper_private_data; + if (scsi_cmd) { + *req = scsi_cmd->sc_request; + if (*req) + cmd = (struct scst_cmd *)(*req)->upper_private_data; + } if (cmd == NULL) { PRINT_ERROR("%s", "Request with NULL cmd");