The patch below fixes occurrences of the following recently introduced
authorvlnb <vlnb@d57e44dd-8a1f-0410-8b47-8ef2f437770f>
Mon, 7 Sep 2009 12:09:16 +0000 (12:09 +0000)
committervlnb <vlnb@d57e44dd-8a1f-0410-8b47-8ef2f437770f>
Mon, 7 Sep 2009 12:09:16 +0000 (12:09 +0000)
checkpatch warning: "do not use assignment in if condition".

Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>
with some fixes

git-svn-id: https://scst.svn.sourceforge.net/svnroot/scst/trunk@1079 d57e44dd-8a1f-0410-8b47-8ef2f437770f

scst/src/scst_lib.c
scst/src/scst_targ.c

index 6ed5d2b..6f123fa 100644 (file)
@@ -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);
index c512d3f..fb77f55 100644 (file)
@@ -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");