init/bootconfig: Reorder init parameter from bootconfig and cmdline
[linux-2.6-microblaze.git] / drivers / target / target_core_pscsi.c
index 9ee797b..2629d2e 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))
@@ -910,7 +909,7 @@ new_bio:
                                        " %d i: %d bio: %p, allocating another"
                                        " bio\n", bio->bi_vcnt, i, bio);
 
-                               rc = blk_rq_append_bio(req, &bio);
+                               rc = blk_rq_append_bio(req, bio);
                                if (rc) {
                                        pr_err("pSCSI: failed to append bio\n");
                                        goto fail;
@@ -929,7 +928,7 @@ new_bio:
        }
 
        if (bio) {
-               rc = blk_rq_append_bio(req, &bio);
+               rc = blk_rq_append_bio(req, bio);
                if (rc) {
                        pr_err("pSCSI: failed to append bio\n");
                        goto fail;
@@ -983,7 +982,7 @@ pscsi_execute_cmd(struct se_cmd *cmd)
 
        req = blk_get_request(pdv->pdv_sd->request_queue,
                        cmd->data_direction == DMA_TO_DEVICE ?
-                       REQ_OP_SCSI_OUT : REQ_OP_SCSI_IN, 0);
+                       REQ_OP_DRV_OUT : REQ_OP_DRV_IN, 0);
        if (IS_ERR(req)) {
                pr_err("PSCSI: blk_get_request() failed\n");
                ret = TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE;
@@ -1045,9 +1044,9 @@ static void pscsi_req_done(struct request *req, blk_status_t status)
        struct se_cmd *cmd = req->end_io_data;
        struct pscsi_plugin_task *pt = cmd->priv;
        int result = scsi_req(req)->result;
-       u8 scsi_status = status_byte(result) << 1;
+       enum sam_status scsi_status = result & 0xff;
 
-       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);