Merge branch 'urgent.2021.05.20a' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-microblaze.git] / drivers / target / target_core_pscsi.c
index d64c3ff..f2a1141 100644 (file)
@@ -34,8 +34,6 @@
 #include "target_core_internal.h"
 #include "target_core_pscsi.h"
 
-#define ISPRINT(a)  ((a >= ' ') && (a <= '~'))
-
 static inline struct pscsi_dev_virt *PSCSI_DEV(struct se_device *dev)
 {
        return container_of(dev, struct pscsi_dev_virt, dev);
@@ -620,8 +618,9 @@ static void pscsi_complete_cmd(struct se_cmd *cmd, u8 scsi_status,
                        unsigned char *buf;
 
                        buf = transport_kmap_data_sg(cmd);
-                       if (!buf)
+                       if (!buf) {
                                ; /* XXX: TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE */
+                       }
 
                        if (cdb[0] == MODE_SENSE_10) {
                                if (!(buf[3] & 0x80))
@@ -1047,7 +1046,7 @@ static void pscsi_req_done(struct request *req, blk_status_t status)
        int result = scsi_req(req)->result;
        u8 scsi_status = status_byte(result) << 1;
 
-       if (scsi_status) {
+       if (scsi_status != SAM_STAT_GOOD) {
                pr_debug("PSCSI Status Byte exception at cmd: %p CDB:"
                        " 0x%02x Result: 0x%08x\n", cmd, pt->pscsi_cdb[0],
                        result);