target: Follow up core updates from AGrover and HCH (round 4)
Andy Grover [Wed, 8 Jun 2011 17:36:43 +0000 (10:36 -0700)]
This patch contains the squashed version of forth round series cleanups
from Andy and Christoph following the post heavy lifting in the preceeding:
'Eliminate usage of struct se_mem' and 'Make all control CDBs scatter-gather'
changes.  This also includes a conversion of target core and the v3.0
mainline fabric modules (loopback and tcm_fc) to use pr_debug and the
CONFIG_DYNAMIC_DEBUG infrastructure!

These have been squashed into this third and final round for v3.1.

target: Remove ifdeffed code in t_g_process_write
target: Remove direct ramdisk code
target: Rename task_sg_num to task_sg_nents
target: Remove custom debug macros for pr_debug. Use pr_err().
target: Remove custom debug macros in mainline fabrics
target: Set WSNZ=1 in block limits VPD. Abort if WRITE_SAME sectors = 0
target: Remove transport do_se_mem_map callback
target: Further simplify transport_free_pages
target: Redo task allocation return value handling
target: Remove extra parentheses
target: change alloc_task call to take *cdb, not *cmd

(nab: Fix bogus struct file assignments in fd_do_readv and fd_do_writev)

Signed-off-by: Andy Grover <agrover@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>

30 files changed:
drivers/target/loopback/Kconfig
drivers/target/loopback/tcm_loop.c
drivers/target/loopback/tcm_loop.h
drivers/target/target_core_alua.c
drivers/target/target_core_cdb.c
drivers/target/target_core_configfs.c
drivers/target/target_core_device.c
drivers/target/target_core_fabric_configfs.c
drivers/target/target_core_fabric_lib.c
drivers/target/target_core_file.c
drivers/target/target_core_file.h
drivers/target/target_core_hba.c
drivers/target/target_core_iblock.c
drivers/target/target_core_iblock.h
drivers/target/target_core_pr.c
drivers/target/target_core_pscsi.c
drivers/target/target_core_pscsi.h
drivers/target/target_core_rd.c
drivers/target/target_core_rd.h
drivers/target/target_core_tmr.c
drivers/target/target_core_tpg.c
drivers/target/target_core_transport.c
drivers/target/target_core_ua.c
drivers/target/tcm_fc/tcm_fc.h
drivers/target/tcm_fc/tfc_cmd.c
drivers/target/tcm_fc/tfc_conf.c
drivers/target/tcm_fc/tfc_io.c
drivers/target/tcm_fc/tfc_sess.c
include/target/target_core_base.h
include/target/target_core_transport.h

index 57dcbc2..abe8ecb 100644 (file)
@@ -3,9 +3,3 @@ config LOOPBACK_TARGET
        help
          Say Y here to enable the TCM Virtual SAS target and Linux/SCSI LLD
          fabric loopback module.
-
-config LOOPBACK_TARGET_CDB_DEBUG
-       bool "TCM loopback fabric module CDB debug code"
-       depends on LOOPBACK_TARGET
-       help
-         Say Y here to enable the TCM loopback fabric module CDB debug code
index 99603bc..aa2d679 100644 (file)
@@ -79,7 +79,7 @@ static struct se_cmd *tcm_loop_allocate_core_cmd(
 
        tl_cmd = kmem_cache_zalloc(tcm_loop_cmd_cache, GFP_ATOMIC);
        if (!tl_cmd) {
-               printk(KERN_ERR "Unable to allocate struct tcm_loop_cmd\n");
+               pr_err("Unable to allocate struct tcm_loop_cmd\n");
                set_host_byte(sc, DID_ERROR);
                return NULL;
        }
@@ -281,7 +281,7 @@ static int tcm_loop_queuecommand(
        struct tcm_loop_hba *tl_hba;
        struct tcm_loop_tpg *tl_tpg;
 
-       TL_CDB_DEBUG("tcm_loop_queuecommand() %d:%d:%d:%d got CDB: 0x%02x"
+       pr_debug("tcm_loop_queuecommand() %d:%d:%d:%d got CDB: 0x%02x"
                " scsi_buf_len: %u\n", sc->device->host->host_no,
                sc->device->id, sc->device->channel, sc->device->lun,
                sc->cmnd[0], scsi_bufflen(sc));
@@ -331,7 +331,7 @@ static int tcm_loop_device_reset(struct scsi_cmnd *sc)
         */
        tl_nexus = tl_hba->tl_nexus;
        if (!tl_nexus) {
-               printk(KERN_ERR "Unable to perform device reset without"
+               pr_err("Unable to perform device reset without"
                                " active I_T Nexus\n");
                return FAILED;
        }
@@ -344,13 +344,13 @@ static int tcm_loop_device_reset(struct scsi_cmnd *sc)
 
        tl_cmd = kmem_cache_zalloc(tcm_loop_cmd_cache, GFP_KERNEL);
        if (!tl_cmd) {
-               printk(KERN_ERR "Unable to allocate memory for tl_cmd\n");
+               pr_err("Unable to allocate memory for tl_cmd\n");
                return FAILED;
        }
 
        tl_tmr = kzalloc(sizeof(struct tcm_loop_tmr), GFP_KERNEL);
        if (!tl_tmr) {
-               printk(KERN_ERR "Unable to allocate memory for tl_tmr\n");
+               pr_err("Unable to allocate memory for tl_tmr\n");
                goto release;
        }
        init_waitqueue_head(&tl_tmr->tl_tmr_wait);
@@ -435,7 +435,7 @@ static int tcm_loop_driver_probe(struct device *dev)
        sh = scsi_host_alloc(&tcm_loop_driver_template,
                        sizeof(struct tcm_loop_hba));
        if (!sh) {
-               printk(KERN_ERR "Unable to allocate struct scsi_host\n");
+               pr_err("Unable to allocate struct scsi_host\n");
                return -ENODEV;
        }
        tl_hba->sh = sh;
@@ -454,7 +454,7 @@ static int tcm_loop_driver_probe(struct device *dev)
 
        error = scsi_add_host(sh, &tl_hba->dev);
        if (error) {
-               printk(KERN_ERR "%s: scsi_add_host failed\n", __func__);
+               pr_err("%s: scsi_add_host failed\n", __func__);
                scsi_host_put(sh);
                return -ENODEV;
        }
@@ -495,7 +495,7 @@ static int tcm_loop_setup_hba_bus(struct tcm_loop_hba *tl_hba, int tcm_loop_host
 
        ret = device_register(&tl_hba->dev);
        if (ret) {
-               printk(KERN_ERR "device_register() failed for"
+               pr_err("device_register() failed for"
                                " tl_hba->dev: %d\n", ret);
                return -ENODEV;
        }
@@ -513,24 +513,24 @@ static int tcm_loop_alloc_core_bus(void)
 
        tcm_loop_primary = root_device_register("tcm_loop_0");
        if (IS_ERR(tcm_loop_primary)) {
-               printk(KERN_ERR "Unable to allocate tcm_loop_primary\n");
+               pr_err("Unable to allocate tcm_loop_primary\n");
                return PTR_ERR(tcm_loop_primary);
        }
 
        ret = bus_register(&tcm_loop_lld_bus);
        if (ret) {
-               printk(KERN_ERR "bus_register() failed for tcm_loop_lld_bus\n");
+               pr_err("bus_register() failed for tcm_loop_lld_bus\n");
                goto dev_unreg;
        }
 
        ret = driver_register(&tcm_loop_driverfs);
        if (ret) {
-               printk(KERN_ERR "driver_register() failed for"
+               pr_err("driver_register() failed for"
                                "tcm_loop_driverfs\n");
                goto bus_unreg;
        }
 
-       printk(KERN_INFO "Initialized TCM Loop Core Bus\n");
+       pr_debug("Initialized TCM Loop Core Bus\n");
        return ret;
 
 bus_unreg:
@@ -546,7 +546,7 @@ static void tcm_loop_release_core_bus(void)
        bus_unregister(&tcm_loop_lld_bus);
        root_device_unregister(tcm_loop_primary);
 
-       printk(KERN_INFO "Releasing TCM Loop Core BUS\n");
+       pr_debug("Releasing TCM Loop Core BUS\n");
 }
 
 static char *tcm_loop_get_fabric_name(void)
@@ -574,7 +574,7 @@ static u8 tcm_loop_get_fabric_proto_ident(struct se_portal_group *se_tpg)
        case SCSI_PROTOCOL_ISCSI:
                return iscsi_get_fabric_proto_ident(se_tpg);
        default:
-               printk(KERN_ERR "Unknown tl_proto_id: 0x%02x, using"
+               pr_err("Unknown tl_proto_id: 0x%02x, using"
                        " SAS emulation\n", tl_hba->tl_proto_id);
                break;
        }
@@ -630,7 +630,7 @@ static u32 tcm_loop_get_pr_transport_id(
                return iscsi_get_pr_transport_id(se_tpg, se_nacl, pr_reg,
                                        format_code, buf);
        default:
-               printk(KERN_ERR "Unknown tl_proto_id: 0x%02x, using"
+               pr_err("Unknown tl_proto_id: 0x%02x, using"
                        " SAS emulation\n", tl_hba->tl_proto_id);
                break;
        }
@@ -660,7 +660,7 @@ static u32 tcm_loop_get_pr_transport_id_len(
                return iscsi_get_pr_transport_id_len(se_tpg, se_nacl, pr_reg,
                                        format_code);
        default:
-               printk(KERN_ERR "Unknown tl_proto_id: 0x%02x, using"
+               pr_err("Unknown tl_proto_id: 0x%02x, using"
                        " SAS emulation\n", tl_hba->tl_proto_id);
                break;
        }
@@ -694,7 +694,7 @@ static char *tcm_loop_parse_pr_out_transport_id(
                return iscsi_parse_pr_out_transport_id(se_tpg, buf, out_tid_len,
                                        port_nexus_ptr);
        default:
-               printk(KERN_ERR "Unknown tl_proto_id: 0x%02x, using"
+               pr_err("Unknown tl_proto_id: 0x%02x, using"
                        " SAS emulation\n", tl_hba->tl_proto_id);
                break;
        }
@@ -743,7 +743,7 @@ static struct se_node_acl *tcm_loop_tpg_alloc_fabric_acl(
 
        tl_nacl = kzalloc(sizeof(struct tcm_loop_nacl), GFP_KERNEL);
        if (!tl_nacl) {
-               printk(KERN_ERR "Unable to allocate struct tcm_loop_nacl\n");
+               pr_err("Unable to allocate struct tcm_loop_nacl\n");
                return NULL;
        }
 
@@ -853,7 +853,7 @@ static int tcm_loop_queue_data_in(struct se_cmd *se_cmd)
                                struct tcm_loop_cmd, tl_se_cmd);
        struct scsi_cmnd *sc = tl_cmd->sc;
 
-       TL_CDB_DEBUG("tcm_loop_queue_data_in() called for scsi_cmnd: %p"
+       pr_debug("tcm_loop_queue_data_in() called for scsi_cmnd: %p"
                     " cdb: 0x%02x\n", sc, sc->cmnd[0]);
 
        sc->result = SAM_STAT_GOOD;
@@ -868,7 +868,7 @@ static int tcm_loop_queue_status(struct se_cmd *se_cmd)
                                struct tcm_loop_cmd, tl_se_cmd);
        struct scsi_cmnd *sc = tl_cmd->sc;
 
-       TL_CDB_DEBUG("tcm_loop_queue_status() called for scsi_cmnd: %p"
+       pr_debug("tcm_loop_queue_status() called for scsi_cmnd: %p"
                        " cdb: 0x%02x\n", sc, sc->cmnd[0]);
 
        if (se_cmd->sense_buffer &&
@@ -943,7 +943,7 @@ static int tcm_loop_port_link(
         */
        scsi_add_device(tl_hba->sh, 0, tl_tpg->tl_tpgt, lun->unpacked_lun);
 
-       printk(KERN_INFO "TCM_Loop_ConfigFS: Port Link Successful\n");
+       pr_debug("TCM_Loop_ConfigFS: Port Link Successful\n");
        return 0;
 }
 
@@ -961,7 +961,7 @@ static void tcm_loop_port_unlink(
        sd = scsi_device_lookup(tl_hba->sh, 0, tl_tpg->tl_tpgt,
                                se_lun->unpacked_lun);
        if (!sd) {
-               printk(KERN_ERR "Unable to locate struct scsi_device for %d:%d:"
+               pr_err("Unable to locate struct scsi_device for %d:%d:"
                        "%d\n", 0, tl_tpg->tl_tpgt, se_lun->unpacked_lun);
                return;
        }
@@ -974,7 +974,7 @@ static void tcm_loop_port_unlink(
        atomic_dec(&tl_tpg->tl_tpg_port_count);
        smp_mb__after_atomic_dec();
 
-       printk(KERN_INFO "TCM_Loop_ConfigFS: Port Unlink Successful\n");
+       pr_debug("TCM_Loop_ConfigFS: Port Unlink Successful\n");
 }
 
 /* End items for tcm_loop_port_cit */
@@ -991,14 +991,14 @@ static int tcm_loop_make_nexus(
        int ret = -ENOMEM;
 
        if (tl_tpg->tl_hba->tl_nexus) {
-               printk(KERN_INFO "tl_tpg->tl_hba->tl_nexus already exists\n");
+               pr_debug("tl_tpg->tl_hba->tl_nexus already exists\n");
                return -EEXIST;
        }
        se_tpg = &tl_tpg->tl_se_tpg;
 
        tl_nexus = kzalloc(sizeof(struct tcm_loop_nexus), GFP_KERNEL);
        if (!tl_nexus) {
-               printk(KERN_ERR "Unable to allocate struct tcm_loop_nexus\n");
+               pr_err("Unable to allocate struct tcm_loop_nexus\n");
                return -ENOMEM;
        }
        /*
@@ -1027,7 +1027,7 @@ static int tcm_loop_make_nexus(
        __transport_register_session(se_tpg, tl_nexus->se_sess->se_node_acl,
                        tl_nexus->se_sess, tl_nexus);
        tl_tpg->tl_hba->tl_nexus = tl_nexus;
-       printk(KERN_INFO "TCM_Loop_ConfigFS: Established I_T Nexus to emulated"
+       pr_debug("TCM_Loop_ConfigFS: Established I_T Nexus to emulated"
                " %s Initiator Port: %s\n", tcm_loop_dump_proto_id(tl_hba),
                name);
        return 0;
@@ -1053,13 +1053,13 @@ static int tcm_loop_drop_nexus(
                return -ENODEV;
 
        if (atomic_read(&tpg->tl_tpg_port_count)) {
-               printk(KERN_ERR "Unable to remove TCM_Loop I_T Nexus with"
+               pr_err("Unable to remove TCM_Loop I_T Nexus with"
                        " active TPG port count: %d\n",
                        atomic_read(&tpg->tl_tpg_port_count));
                return -EPERM;
        }
 
-       printk(KERN_INFO "TCM_Loop_ConfigFS: Removing I_T Nexus to emulated"
+       pr_debug("TCM_Loop_ConfigFS: Removing I_T Nexus to emulated"
                " %s Initiator Port: %s\n", tcm_loop_dump_proto_id(tl_hba),
                tl_nexus->se_sess->se_node_acl->initiatorname);
        /*
@@ -1115,7 +1115,7 @@ static ssize_t tcm_loop_tpg_store_nexus(
         * tcm_loop_make_nexus()
         */
        if (strlen(page) >= TL_WWN_ADDR_LEN) {
-               printk(KERN_ERR "Emulated NAA Sas Address: %s, exceeds"
+               pr_err("Emulated NAA Sas Address: %s, exceeds"
                                " max: %d\n", page, TL_WWN_ADDR_LEN);
                return -EINVAL;
        }
@@ -1124,7 +1124,7 @@ static ssize_t tcm_loop_tpg_store_nexus(
        ptr = strstr(i_port, "naa.");
        if (ptr) {
                if (tl_hba->tl_proto_id != SCSI_PROTOCOL_SAS) {
-                       printk(KERN_ERR "Passed SAS Initiator Port %s does not"
+                       pr_err("Passed SAS Initiator Port %s does not"
                                " match target port protoid: %s\n", i_port,
                                tcm_loop_dump_proto_id(tl_hba));
                        return -EINVAL;
@@ -1135,7 +1135,7 @@ static ssize_t tcm_loop_tpg_store_nexus(
        ptr = strstr(i_port, "fc.");
        if (ptr) {
                if (tl_hba->tl_proto_id != SCSI_PROTOCOL_FCP) {
-                       printk(KERN_ERR "Passed FCP Initiator Port %s does not"
+                       pr_err("Passed FCP Initiator Port %s does not"
                                " match target port protoid: %s\n", i_port,
                                tcm_loop_dump_proto_id(tl_hba));
                        return -EINVAL;
@@ -1146,7 +1146,7 @@ static ssize_t tcm_loop_tpg_store_nexus(
        ptr = strstr(i_port, "iqn.");
        if (ptr) {
                if (tl_hba->tl_proto_id != SCSI_PROTOCOL_ISCSI) {
-                       printk(KERN_ERR "Passed iSCSI Initiator Port %s does not"
+                       pr_err("Passed iSCSI Initiator Port %s does not"
                                " match target port protoid: %s\n", i_port,
                                tcm_loop_dump_proto_id(tl_hba));
                        return -EINVAL;
@@ -1154,7 +1154,7 @@ static ssize_t tcm_loop_tpg_store_nexus(
                port_ptr = &i_port[0];
                goto check_newline;
        }
-       printk(KERN_ERR "Unable to locate prefix for emulated Initiator Port:"
+       pr_err("Unable to locate prefix for emulated Initiator Port:"
                        " %s\n", i_port);
        return -EINVAL;
        /*
@@ -1194,7 +1194,7 @@ struct se_portal_group *tcm_loop_make_naa_tpg(
 
        tpgt_str = strstr(name, "tpgt_");
        if (!tpgt_str) {
-               printk(KERN_ERR "Unable to locate \"tpgt_#\" directory"
+               pr_err("Unable to locate \"tpgt_#\" directory"
                                " group\n");
                return ERR_PTR(-EINVAL);
        }
@@ -1202,7 +1202,7 @@ struct se_portal_group *tcm_loop_make_naa_tpg(
        tpgt = (unsigned short int) simple_strtoul(tpgt_str, &end_ptr, 0);
 
        if (tpgt >= TL_TPGS_PER_HBA) {
-               printk(KERN_ERR "Passed tpgt: %hu exceeds TL_TPGS_PER_HBA:"
+               pr_err("Passed tpgt: %hu exceeds TL_TPGS_PER_HBA:"
                                " %u\n", tpgt, TL_TPGS_PER_HBA);
                return ERR_PTR(-EINVAL);
        }
@@ -1218,7 +1218,7 @@ struct se_portal_group *tcm_loop_make_naa_tpg(
        if (ret < 0)
                return ERR_PTR(-ENOMEM);
 
-       printk(KERN_INFO "TCM_Loop_ConfigFS: Allocated Emulated %s"
+       pr_debug("TCM_Loop_ConfigFS: Allocated Emulated %s"
                " Target Port %s,t,0x%04x\n", tcm_loop_dump_proto_id(tl_hba),
                config_item_name(&wwn->wwn_group.cg_item), tpgt);
 
@@ -1245,7 +1245,7 @@ void tcm_loop_drop_naa_tpg(
         */
        core_tpg_deregister(se_tpg);
 
-       printk(KERN_INFO "TCM_Loop_ConfigFS: Deallocated Emulated %s"
+       pr_debug("TCM_Loop_ConfigFS: Deallocated Emulated %s"
                " Target Port %s,t,0x%04x\n", tcm_loop_dump_proto_id(tl_hba),
                config_item_name(&wwn->wwn_group.cg_item), tpgt);
 }
@@ -1266,7 +1266,7 @@ struct se_wwn *tcm_loop_make_scsi_hba(
 
        tl_hba = kzalloc(sizeof(struct tcm_loop_hba), GFP_KERNEL);
        if (!tl_hba) {
-               printk(KERN_ERR "Unable to allocate struct tcm_loop_hba\n");
+               pr_err("Unable to allocate struct tcm_loop_hba\n");
                return ERR_PTR(-ENOMEM);
        }
        /*
@@ -1286,7 +1286,7 @@ struct se_wwn *tcm_loop_make_scsi_hba(
        }
        ptr = strstr(name, "iqn.");
        if (!ptr) {
-               printk(KERN_ERR "Unable to locate prefix for emulated Target "
+               pr_err("Unable to locate prefix for emulated Target "
                                "Port: %s\n", name);
                ret = -EINVAL;
                goto out;
@@ -1295,7 +1295,7 @@ struct se_wwn *tcm_loop_make_scsi_hba(
 
 check_len:
        if (strlen(name) >= TL_WWN_ADDR_LEN) {
-               printk(KERN_ERR "Emulated NAA %s Address: %s, exceeds"
+               pr_err("Emulated NAA %s Address: %s, exceeds"
                        " max: %d\n", name, tcm_loop_dump_proto_id(tl_hba),
                        TL_WWN_ADDR_LEN);
                ret = -EINVAL;
@@ -1314,7 +1314,7 @@ check_len:
 
        sh = tl_hba->sh;
        tcm_loop_hba_no_cnt++;
-       printk(KERN_INFO "TCM_Loop_ConfigFS: Allocated emulated Target"
+       pr_debug("TCM_Loop_ConfigFS: Allocated emulated Target"
                " %s Address: %s at Linux/SCSI Host ID: %d\n",
                tcm_loop_dump_proto_id(tl_hba), name, sh->host_no);
 
@@ -1337,7 +1337,7 @@ void tcm_loop_drop_scsi_hba(
         */
        device_unregister(&tl_hba->dev);
 
-       printk(KERN_INFO "TCM_Loop_ConfigFS: Deallocated emulated Target"
+       pr_debug("TCM_Loop_ConfigFS: Deallocated emulated Target"
                " SAS Address: %s at Linux/SCSI Host ID: %d\n",
                config_item_name(&wwn->wwn_group.cg_item), host_no);
 }
@@ -1373,7 +1373,7 @@ static int tcm_loop_register_configfs(void)
         */
        fabric = target_fabric_configfs_init(THIS_MODULE, "loopback");
        if (IS_ERR(fabric)) {
-               printk(KERN_ERR "tcm_loop_register_configfs() failed!\n");
+               pr_err("tcm_loop_register_configfs() failed!\n");
                return PTR_ERR(fabric);
        }
        /*
@@ -1464,7 +1464,7 @@ static int tcm_loop_register_configfs(void)
         */
        ret = target_fabric_configfs_register(fabric);
        if (ret < 0) {
-               printk(KERN_ERR "target_fabric_configfs_register() for"
+               pr_err("target_fabric_configfs_register() for"
                                " TCM_Loop failed!\n");
                target_fabric_configfs_free(fabric);
                return -1;
@@ -1473,7 +1473,7 @@ static int tcm_loop_register_configfs(void)
         * Setup our local pointer to *fabric.
         */
        tcm_loop_fabric_configfs = fabric;
-       printk(KERN_INFO "TCM_LOOP[0] - Set fabric ->"
+       pr_debug("TCM_LOOP[0] - Set fabric ->"
                        " tcm_loop_fabric_configfs\n");
        return 0;
 }
@@ -1485,7 +1485,7 @@ static void tcm_loop_deregister_configfs(void)
 
        target_fabric_configfs_deregister(tcm_loop_fabric_configfs);
        tcm_loop_fabric_configfs = NULL;
-       printk(KERN_INFO "TCM_LOOP[0] - Cleared"
+       pr_debug("TCM_LOOP[0] - Cleared"
                                " tcm_loop_fabric_configfs\n");
 }
 
@@ -1498,7 +1498,7 @@ static int __init tcm_loop_fabric_init(void)
                                __alignof__(struct tcm_loop_cmd),
                                0, NULL);
        if (!tcm_loop_cmd_cache) {
-               printk(KERN_ERR "kmem_cache_create() for"
+               pr_debug("kmem_cache_create() for"
                        " tcm_loop_cmd_cache failed\n");
                return -ENOMEM;
        }
index 7e9f7ab..6b76c7a 100644 (file)
  */
 #define TL_SCSI_MAX_CMD_LEN            32
 
-#ifdef CONFIG_LOOPBACK_TARGET_CDB_DEBUG
-# define TL_CDB_DEBUG(x...)            printk(KERN_INFO x)
-#else
-# define TL_CDB_DEBUG(x...)
-#endif
-
 struct tcm_loop_cmd {
        /* State of Linux/SCSI CDB+Data descriptor */
        u32 sc_cmd_state;
index dba412f..98c98a3 100644 (file)
@@ -167,7 +167,7 @@ int core_emulate_set_target_port_groups(struct se_cmd *cmd)
        int alua_access_state, primary = 0, rc;
        u16 tg_pt_id, rtpi;
 
-       if (!(l_port))
+       if (!l_port)
                return PYX_TRANSPORT_LU_COMM_FAILURE;
 
        buf = transport_kmap_first_data_page(cmd);
@@ -177,24 +177,24 @@ int core_emulate_set_target_port_groups(struct se_cmd *cmd)
         * for the local tg_pt_gp.
         */
        l_tg_pt_gp_mem = l_port->sep_alua_tg_pt_gp_mem;
-       if (!(l_tg_pt_gp_mem)) {
-               printk(KERN_ERR "Unable to access l_port->sep_alua_tg_pt_gp_mem\n");
+       if (!l_tg_pt_gp_mem) {
+               pr_err("Unable to access l_port->sep_alua_tg_pt_gp_mem\n");
                rc = PYX_TRANSPORT_UNKNOWN_SAM_OPCODE;
                goto out;
        }
        spin_lock(&l_tg_pt_gp_mem->tg_pt_gp_mem_lock);
        l_tg_pt_gp = l_tg_pt_gp_mem->tg_pt_gp;
-       if (!(l_tg_pt_gp)) {
+       if (!l_tg_pt_gp) {
                spin_unlock(&l_tg_pt_gp_mem->tg_pt_gp_mem_lock);
-               printk(KERN_ERR "Unable to access *l_tg_pt_gp_mem->tg_pt_gp\n");
+               pr_err("Unable to access *l_tg_pt_gp_mem->tg_pt_gp\n");
                rc = PYX_TRANSPORT_UNKNOWN_SAM_OPCODE;
                goto out;
        }
        rc = (l_tg_pt_gp->tg_pt_gp_alua_access_type & TPGS_EXPLICT_ALUA);
        spin_unlock(&l_tg_pt_gp_mem->tg_pt_gp_mem_lock);
 
-       if (!(rc)) {
-               printk(KERN_INFO "Unable to process SET_TARGET_PORT_GROUPS"
+       if (!rc) {
+               pr_debug("Unable to process SET_TARGET_PORT_GROUPS"
                                " while TPGS_EXPLICT_ALUA is disabled\n");
                rc = PYX_TRANSPORT_UNKNOWN_SAM_OPCODE;
                goto out;
@@ -249,7 +249,7 @@ int core_emulate_set_target_port_groups(struct se_cmd *cmd)
                        list_for_each_entry(tg_pt_gp,
                                        &su_dev->t10_alua.tg_pt_gps_list,
                                        tg_pt_gp_list) {
-                               if (!(tg_pt_gp->tg_pt_gp_valid_id))
+                               if (!tg_pt_gp->tg_pt_gp_valid_id)
                                        continue;
 
                                if (tg_pt_id != tg_pt_gp->tg_pt_gp_id)
@@ -498,7 +498,7 @@ static int core_alua_state_check(
        struct t10_alua_tg_pt_gp_member *tg_pt_gp_mem;
        int out_alua_state, nonop_delay_msecs;
 
-       if (!(port))
+       if (!port)
                return 0;
        /*
         * First, check for a struct se_port specific secondary ALUA target port
@@ -506,7 +506,7 @@ static int core_alua_state_check(
         */
        if (atomic_read(&port->sep_tg_pt_secondary_offline)) {
                *alua_ascq = ASCQ_04H_ALUA_OFFLINE;
-               printk(KERN_INFO "ALUA: Got secondary offline status for local"
+               pr_debug("ALUA: Got secondary offline status for local"
                                " target port\n");
                *alua_ascq = ASCQ_04H_ALUA_OFFLINE;
                return 1;
@@ -548,7 +548,7 @@ static int core_alua_state_check(
         */
        case ALUA_ACCESS_STATE_OFFLINE:
        default:
-               printk(KERN_ERR "Unknown ALUA access state: 0x%02x\n",
+               pr_err("Unknown ALUA access state: 0x%02x\n",
                                out_alua_state);
                return -EINVAL;
        }
@@ -580,7 +580,7 @@ static int core_alua_check_transition(int state, int *primary)
                *primary = 0;
                break;
        default:
-               printk(KERN_ERR "Unknown ALUA access state: 0x%02x\n", state);
+               pr_err("Unknown ALUA access state: 0x%02x\n", state);
                return -EINVAL;
        }
 
@@ -638,7 +638,7 @@ int core_alua_check_nonop_delay(
         * The ALUA Active/NonOptimized access state delay can be disabled
         * in via configfs with a value of zero
         */
-       if (!(cmd->alua_nonop_delay))
+       if (!cmd->alua_nonop_delay)
                return 0;
        /*
         * struct se_cmd->alua_nonop_delay gets set by a target port group
@@ -667,7 +667,7 @@ static int core_alua_write_tpg_metadata(
 
        file = filp_open(path, flags, 0600);
        if (IS_ERR(file) || !file || !file->f_dentry) {
-               printk(KERN_ERR "filp_open(%s) for ALUA metadata failed\n",
+               pr_err("filp_open(%s) for ALUA metadata failed\n",
                        path);
                return -ENODEV;
        }
@@ -681,7 +681,7 @@ static int core_alua_write_tpg_metadata(
        set_fs(old_fs);
 
        if (ret < 0) {
-               printk(KERN_ERR "Error writing ALUA metadata file: %s\n", path);
+               pr_err("Error writing ALUA metadata file: %s\n", path);
                filp_close(file, NULL);
                return -EIO;
        }
@@ -778,7 +778,7 @@ static int core_alua_do_transition_tg_pt(
                         * se_deve->se_lun_acl pointer may be NULL for a
                         * entry created without explict Node+MappedLUN ACLs
                         */
-                       if (!(lacl))
+                       if (!lacl)
                                continue;
 
                        if (explict &&
@@ -820,7 +820,7 @@ static int core_alua_do_transition_tg_pt(
         */
        atomic_set(&tg_pt_gp->tg_pt_gp_alua_access_state, new_state);
 
-       printk(KERN_INFO "Successful %s ALUA transition TG PT Group: %s ID: %hu"
+       pr_debug("Successful %s ALUA transition TG PT Group: %s ID: %hu"
                " from primary access state %s to %s\n", (explict) ? "explict" :
                "implict", config_item_name(&tg_pt_gp->tg_pt_gp_group.cg_item),
                tg_pt_gp->tg_pt_gp_id, core_alua_dump_state(old_state),
@@ -851,8 +851,8 @@ int core_alua_do_port_transition(
                return -EINVAL;
 
        md_buf = kzalloc(l_tg_pt_gp->tg_pt_gp_md_buf_len, GFP_KERNEL);
-       if (!(md_buf)) {
-               printk("Unable to allocate buf for ALUA metadata\n");
+       if (!md_buf) {
+               pr_err("Unable to allocate buf for ALUA metadata\n");
                return -ENOMEM;
        }
 
@@ -867,7 +867,7 @@ int core_alua_do_port_transition(
         * we only do transition on the passed *l_tp_pt_gp, and not
         * on all of the matching target port groups IDs in default_lu_gp.
         */
-       if (!(lu_gp->lu_gp_id)) {
+       if (!lu_gp->lu_gp_id) {
                /*
                 * core_alua_do_transition_tg_pt() will always return
                 * success.
@@ -899,7 +899,7 @@ int core_alua_do_port_transition(
                                &su_dev->t10_alua.tg_pt_gps_list,
                                tg_pt_gp_list) {
 
-                       if (!(tg_pt_gp->tg_pt_gp_valid_id))
+                       if (!tg_pt_gp->tg_pt_gp_valid_id)
                                continue;
                        /*
                         * If the target behavior port asymmetric access state
@@ -941,7 +941,7 @@ int core_alua_do_port_transition(
        }
        spin_unlock(&lu_gp->lu_gp_lock);
 
-       printk(KERN_INFO "Successfully processed LU Group: %s all ALUA TG PT"
+       pr_debug("Successfully processed LU Group: %s all ALUA TG PT"
                " Group IDs: %hu %s transition to primary state: %s\n",
                config_item_name(&lu_gp->lu_gp_group.cg_item),
                l_tg_pt_gp->tg_pt_gp_id, (explict) ? "explict" : "implict",
@@ -1001,9 +1001,9 @@ static int core_alua_set_tg_pt_secondary_state(
 
        spin_lock(&tg_pt_gp_mem->tg_pt_gp_mem_lock);
        tg_pt_gp = tg_pt_gp_mem->tg_pt_gp;
-       if (!(tg_pt_gp)) {
+       if (!tg_pt_gp) {
                spin_unlock(&tg_pt_gp_mem->tg_pt_gp_mem_lock);
-               printk(KERN_ERR "Unable to complete secondary state"
+               pr_err("Unable to complete secondary state"
                                " transition\n");
                return -EINVAL;
        }
@@ -1022,7 +1022,7 @@ static int core_alua_set_tg_pt_secondary_state(
                        ALUA_STATUS_ALTERED_BY_EXPLICT_STPG :
                        ALUA_STATUS_ALTERED_BY_IMPLICT_ALUA;
 
-       printk(KERN_INFO "Successful %s ALUA transition TG PT Group: %s ID: %hu"
+       pr_debug("Successful %s ALUA transition TG PT Group: %s ID: %hu"
                " to secondary access state: %s\n", (explict) ? "explict" :
                "implict", config_item_name(&tg_pt_gp->tg_pt_gp_group.cg_item),
                tg_pt_gp->tg_pt_gp_id, (offline) ? "OFFLINE" : "ONLINE");
@@ -1040,8 +1040,8 @@ static int core_alua_set_tg_pt_secondary_state(
         */
        if (port->sep_tg_pt_secondary_write_md) {
                md_buf = kzalloc(md_buf_len, GFP_KERNEL);
-               if (!(md_buf)) {
-                       printk(KERN_ERR "Unable to allocate md_buf for"
+               if (!md_buf) {
+                       pr_err("Unable to allocate md_buf for"
                                " secondary ALUA access metadata\n");
                        return -ENOMEM;
                }
@@ -1062,8 +1062,8 @@ core_alua_allocate_lu_gp(const char *name, int def_group)
        struct t10_alua_lu_gp *lu_gp;
 
        lu_gp = kmem_cache_zalloc(t10_alua_lu_gp_cache, GFP_KERNEL);
-       if (!(lu_gp)) {
-               printk(KERN_ERR "Unable to allocate struct t10_alua_lu_gp\n");
+       if (!lu_gp) {
+               pr_err("Unable to allocate struct t10_alua_lu_gp\n");
                return ERR_PTR(-ENOMEM);
        }
        INIT_LIST_HEAD(&lu_gp->lu_gp_node);
@@ -1088,14 +1088,14 @@ int core_alua_set_lu_gp_id(struct t10_alua_lu_gp *lu_gp, u16 lu_gp_id)
         * The lu_gp->lu_gp_id may only be set once..
         */
        if (lu_gp->lu_gp_valid_id) {
-               printk(KERN_WARNING "ALUA LU Group already has a valid ID,"
+               pr_warn("ALUA LU Group already has a valid ID,"
                        " ignoring request\n");
                return -EINVAL;
        }
 
        spin_lock(&lu_gps_lock);
        if (alua_lu_gps_count == 0x0000ffff) {
-               printk(KERN_ERR "Maximum ALUA alua_lu_gps_count:"
+               pr_err("Maximum ALUA alua_lu_gps_count:"
                                " 0x0000ffff reached\n");
                spin_unlock(&lu_gps_lock);
                kmem_cache_free(t10_alua_lu_gp_cache, lu_gp);
@@ -1107,10 +1107,10 @@ again:
 
        list_for_each_entry(lu_gp_tmp, &lu_gps_list, lu_gp_node) {
                if (lu_gp_tmp->lu_gp_id == lu_gp_id_tmp) {
-                       if (!(lu_gp_id))
+                       if (!lu_gp_id)
                                goto again;
 
-                       printk(KERN_WARNING "ALUA Logical Unit Group ID: %hu"
+                       pr_warn("ALUA Logical Unit Group ID: %hu"
                                " already exists, ignoring request\n",
                                lu_gp_id);
                        spin_unlock(&lu_gps_lock);
@@ -1133,8 +1133,8 @@ core_alua_allocate_lu_gp_mem(struct se_device *dev)
        struct t10_alua_lu_gp_member *lu_gp_mem;
 
        lu_gp_mem = kmem_cache_zalloc(t10_alua_lu_gp_mem_cache, GFP_KERNEL);
-       if (!(lu_gp_mem)) {
-               printk(KERN_ERR "Unable to allocate struct t10_alua_lu_gp_member\n");
+       if (!lu_gp_mem) {
+               pr_err("Unable to allocate struct t10_alua_lu_gp_member\n");
                return ERR_PTR(-ENOMEM);
        }
        INIT_LIST_HEAD(&lu_gp_mem->lu_gp_mem_list);
@@ -1218,7 +1218,7 @@ void core_alua_free_lu_gp_mem(struct se_device *dev)
                return;
 
        lu_gp_mem = dev->dev_alua_lu_gp_mem;
-       if (!(lu_gp_mem))
+       if (!lu_gp_mem)
                return;
 
        while (atomic_read(&lu_gp_mem->lu_gp_mem_ref_cnt))
@@ -1226,7 +1226,7 @@ void core_alua_free_lu_gp_mem(struct se_device *dev)
 
        spin_lock(&lu_gp_mem->lu_gp_mem_lock);
        lu_gp = lu_gp_mem->lu_gp;
-       if ((lu_gp)) {
+       if (lu_gp) {
                spin_lock(&lu_gp->lu_gp_lock);
                if (lu_gp_mem->lu_gp_assoc) {
                        list_del(&lu_gp_mem->lu_gp_mem_list);
@@ -1248,10 +1248,10 @@ struct t10_alua_lu_gp *core_alua_get_lu_gp_by_name(const char *name)
 
        spin_lock(&lu_gps_lock);
        list_for_each_entry(lu_gp, &lu_gps_list, lu_gp_node) {
-               if (!(lu_gp->lu_gp_valid_id))
+               if (!lu_gp->lu_gp_valid_id)
                        continue;
                ci = &lu_gp->lu_gp_group.cg_item;
-               if (!(strcmp(config_item_name(ci), name))) {
+               if (!strcmp(config_item_name(ci), name)) {
                        atomic_inc(&lu_gp->lu_gp_ref_cnt);
                        spin_unlock(&lu_gps_lock);
                        return lu_gp;
@@ -1307,8 +1307,8 @@ struct t10_alua_tg_pt_gp *core_alua_allocate_tg_pt_gp(
        struct t10_alua_tg_pt_gp *tg_pt_gp;
 
        tg_pt_gp = kmem_cache_zalloc(t10_alua_tg_pt_gp_cache, GFP_KERNEL);
-       if (!(tg_pt_gp)) {
-               printk(KERN_ERR "Unable to allocate struct t10_alua_tg_pt_gp\n");
+       if (!tg_pt_gp) {
+               pr_err("Unable to allocate struct t10_alua_tg_pt_gp\n");
                return NULL;
        }
        INIT_LIST_HEAD(&tg_pt_gp->tg_pt_gp_list);
@@ -1356,14 +1356,14 @@ int core_alua_set_tg_pt_gp_id(
         * The tg_pt_gp->tg_pt_gp_id may only be set once..
         */
        if (tg_pt_gp->tg_pt_gp_valid_id) {
-               printk(KERN_WARNING "ALUA TG PT Group already has a valid ID,"
+               pr_warn("ALUA TG PT Group already has a valid ID,"
                        " ignoring request\n");
                return -EINVAL;
        }
 
        spin_lock(&su_dev->t10_alua.tg_pt_gps_lock);
        if (su_dev->t10_alua.alua_tg_pt_gps_count == 0x0000ffff) {
-               printk(KERN_ERR "Maximum ALUA alua_tg_pt_gps_count:"
+               pr_err("Maximum ALUA alua_tg_pt_gps_count:"
                        " 0x0000ffff reached\n");
                spin_unlock(&su_dev->t10_alua.tg_pt_gps_lock);
                kmem_cache_free(t10_alua_tg_pt_gp_cache, tg_pt_gp);
@@ -1376,10 +1376,10 @@ again:
        list_for_each_entry(tg_pt_gp_tmp, &su_dev->t10_alua.tg_pt_gps_list,
                        tg_pt_gp_list) {
                if (tg_pt_gp_tmp->tg_pt_gp_id == tg_pt_gp_id_tmp) {
-                       if (!(tg_pt_gp_id))
+                       if (!tg_pt_gp_id)
                                goto again;
 
-                       printk(KERN_ERR "ALUA Target Port Group ID: %hu already"
+                       pr_err("ALUA Target Port Group ID: %hu already"
                                " exists, ignoring request\n", tg_pt_gp_id);
                        spin_unlock(&su_dev->t10_alua.tg_pt_gps_lock);
                        return -EINVAL;
@@ -1403,8 +1403,8 @@ struct t10_alua_tg_pt_gp_member *core_alua_allocate_tg_pt_gp_mem(
 
        tg_pt_gp_mem = kmem_cache_zalloc(t10_alua_tg_pt_gp_mem_cache,
                                GFP_KERNEL);
-       if (!(tg_pt_gp_mem)) {
-               printk(KERN_ERR "Unable to allocate struct t10_alua_tg_pt_gp_member\n");
+       if (!tg_pt_gp_mem) {
+               pr_err("Unable to allocate struct t10_alua_tg_pt_gp_member\n");
                return ERR_PTR(-ENOMEM);
        }
        INIT_LIST_HEAD(&tg_pt_gp_mem->tg_pt_gp_mem_list);
@@ -1491,7 +1491,7 @@ void core_alua_free_tg_pt_gp_mem(struct se_port *port)
                return;
 
        tg_pt_gp_mem = port->sep_alua_tg_pt_gp_mem;
-       if (!(tg_pt_gp_mem))
+       if (!tg_pt_gp_mem)
                return;
 
        while (atomic_read(&tg_pt_gp_mem->tg_pt_gp_mem_ref_cnt))
@@ -1499,7 +1499,7 @@ void core_alua_free_tg_pt_gp_mem(struct se_port *port)
 
        spin_lock(&tg_pt_gp_mem->tg_pt_gp_mem_lock);
        tg_pt_gp = tg_pt_gp_mem->tg_pt_gp;
-       if ((tg_pt_gp)) {
+       if (tg_pt_gp) {
                spin_lock(&tg_pt_gp->tg_pt_gp_lock);
                if (tg_pt_gp_mem->tg_pt_gp_assoc) {
                        list_del(&tg_pt_gp_mem->tg_pt_gp_mem_list);
@@ -1524,10 +1524,10 @@ static struct t10_alua_tg_pt_gp *core_alua_get_tg_pt_gp_by_name(
        spin_lock(&su_dev->t10_alua.tg_pt_gps_lock);
        list_for_each_entry(tg_pt_gp, &su_dev->t10_alua.tg_pt_gps_list,
                        tg_pt_gp_list) {
-               if (!(tg_pt_gp->tg_pt_gp_valid_id))
+               if (!tg_pt_gp->tg_pt_gp_valid_id)
                        continue;
                ci = &tg_pt_gp->tg_pt_gp_group.cg_item;
-               if (!(strcmp(config_item_name(ci), name))) {
+               if (!strcmp(config_item_name(ci), name)) {
                        atomic_inc(&tg_pt_gp->tg_pt_gp_ref_cnt);
                        spin_unlock(&su_dev->t10_alua.tg_pt_gps_lock);
                        return tg_pt_gp;
@@ -1592,12 +1592,12 @@ ssize_t core_alua_show_tg_pt_gp_info(struct se_port *port, char *page)
                return len;
 
        tg_pt_gp_mem = port->sep_alua_tg_pt_gp_mem;
-       if (!(tg_pt_gp_mem))
+       if (!tg_pt_gp_mem)
                return len;
 
        spin_lock(&tg_pt_gp_mem->tg_pt_gp_mem_lock);
        tg_pt_gp = tg_pt_gp_mem->tg_pt_gp;
-       if ((tg_pt_gp)) {
+       if (tg_pt_gp) {
                tg_pt_ci = &tg_pt_gp->tg_pt_gp_group.cg_item;
                len += sprintf(page, "TG Port Alias: %s\nTG Port Group ID:"
                        " %hu\nTG Port Primary Access State: %s\nTG Port "
@@ -1634,7 +1634,7 @@ ssize_t core_alua_store_tg_pt_gp_info(
        lun = port->sep_lun;
 
        if (su_dev->t10_alua.alua_type != SPC3_ALUA_EMULATED) {
-               printk(KERN_WARNING "SPC3_ALUA_EMULATED not enabled for"
+               pr_warn("SPC3_ALUA_EMULATED not enabled for"
                        " %s/tpgt_%hu/%s\n", tpg->se_tpg_tfo->tpg_get_wwn(tpg),
                        tpg->se_tpg_tfo->tpg_get_tag(tpg),
                        config_item_name(&lun->lun_group.cg_item));
@@ -1642,7 +1642,7 @@ ssize_t core_alua_store_tg_pt_gp_info(
        }
 
        if (count > TG_PT_GROUP_NAME_BUF) {
-               printk(KERN_ERR "ALUA Target Port Group alias too large!\n");
+               pr_err("ALUA Target Port Group alias too large!\n");
                return -EINVAL;
        }
        memset(buf, 0, TG_PT_GROUP_NAME_BUF);
@@ -1659,26 +1659,26 @@ ssize_t core_alua_store_tg_pt_gp_info(
                 */
                tg_pt_gp_new = core_alua_get_tg_pt_gp_by_name(su_dev,
                                        strstrip(buf));
-               if (!(tg_pt_gp_new))
+               if (!tg_pt_gp_new)
                        return -ENODEV;
        }
        tg_pt_gp_mem = port->sep_alua_tg_pt_gp_mem;
-       if (!(tg_pt_gp_mem)) {
+       if (!tg_pt_gp_mem) {
                if (tg_pt_gp_new)
                        core_alua_put_tg_pt_gp_from_name(tg_pt_gp_new);
-               printk(KERN_ERR "NULL struct se_port->sep_alua_tg_pt_gp_mem pointer\n");
+               pr_err("NULL struct se_port->sep_alua_tg_pt_gp_mem pointer\n");
                return -EINVAL;
        }
 
        spin_lock(&tg_pt_gp_mem->tg_pt_gp_mem_lock);
        tg_pt_gp = tg_pt_gp_mem->tg_pt_gp;
-       if ((tg_pt_gp)) {
+       if (tg_pt_gp) {
                /*
                 * Clearing an existing tg_pt_gp association, and replacing
                 * with the default_tg_pt_gp.
                 */
-               if (!(tg_pt_gp_new)) {
-                       printk(KERN_INFO "Target_Core_ConfigFS: Moving"
+               if (!tg_pt_gp_new) {
+                       pr_debug("Target_Core_ConfigFS: Moving"
                                " %s/tpgt_%hu/%s from ALUA Target Port Group:"
                                " alua/%s, ID: %hu back to"
                                " default_tg_pt_gp\n",
@@ -1707,7 +1707,7 @@ ssize_t core_alua_store_tg_pt_gp_info(
         */
        __core_alua_attach_tg_pt_gp_mem(tg_pt_gp_mem, tg_pt_gp_new);
        spin_unlock(&tg_pt_gp_mem->tg_pt_gp_mem_lock);
-       printk(KERN_INFO "Target_Core_ConfigFS: %s %s/tpgt_%hu/%s to ALUA"
+       pr_debug("Target_Core_ConfigFS: %s %s/tpgt_%hu/%s to ALUA"
                " Target Port Group: alua/%s, ID: %hu\n", (move) ?
                "Moving" : "Adding", tpg->se_tpg_tfo->tpg_get_wwn(tpg),
                tpg->se_tpg_tfo->tpg_get_tag(tpg),
@@ -1744,11 +1744,11 @@ ssize_t core_alua_store_access_type(
 
        ret = strict_strtoul(page, 0, &tmp);
        if (ret < 0) {
-               printk(KERN_ERR "Unable to extract alua_access_type\n");
+               pr_err("Unable to extract alua_access_type\n");
                return -EINVAL;
        }
        if ((tmp != 0) && (tmp != 1) && (tmp != 2) && (tmp != 3)) {
-               printk(KERN_ERR "Illegal value for alua_access_type:"
+               pr_err("Illegal value for alua_access_type:"
                                " %lu\n", tmp);
                return -EINVAL;
        }
@@ -1782,11 +1782,11 @@ ssize_t core_alua_store_nonop_delay_msecs(
 
        ret = strict_strtoul(page, 0, &tmp);
        if (ret < 0) {
-               printk(KERN_ERR "Unable to extract nonop_delay_msecs\n");
+               pr_err("Unable to extract nonop_delay_msecs\n");
                return -EINVAL;
        }
        if (tmp > ALUA_MAX_NONOP_DELAY_MSECS) {
-               printk(KERN_ERR "Passed nonop_delay_msecs: %lu, exceeds"
+               pr_err("Passed nonop_delay_msecs: %lu, exceeds"
                        " ALUA_MAX_NONOP_DELAY_MSECS: %d\n", tmp,
                        ALUA_MAX_NONOP_DELAY_MSECS);
                return -EINVAL;
@@ -1813,11 +1813,11 @@ ssize_t core_alua_store_trans_delay_msecs(
 
        ret = strict_strtoul(page, 0, &tmp);
        if (ret < 0) {
-               printk(KERN_ERR "Unable to extract trans_delay_msecs\n");
+               pr_err("Unable to extract trans_delay_msecs\n");
                return -EINVAL;
        }
        if (tmp > ALUA_MAX_TRANS_DELAY_MSECS) {
-               printk(KERN_ERR "Passed trans_delay_msecs: %lu, exceeds"
+               pr_err("Passed trans_delay_msecs: %lu, exceeds"
                        " ALUA_MAX_TRANS_DELAY_MSECS: %d\n", tmp,
                        ALUA_MAX_TRANS_DELAY_MSECS);
                return -EINVAL;
@@ -1844,11 +1844,11 @@ ssize_t core_alua_store_preferred_bit(
 
        ret = strict_strtoul(page, 0, &tmp);
        if (ret < 0) {
-               printk(KERN_ERR "Unable to extract preferred ALUA value\n");
+               pr_err("Unable to extract preferred ALUA value\n");
                return -EINVAL;
        }
        if ((tmp != 0) && (tmp != 1)) {
-               printk(KERN_ERR "Illegal value for preferred ALUA: %lu\n", tmp);
+               pr_err("Illegal value for preferred ALUA: %lu\n", tmp);
                return -EINVAL;
        }
        tg_pt_gp->tg_pt_gp_pref = (int)tmp;
@@ -1858,7 +1858,7 @@ ssize_t core_alua_store_preferred_bit(
 
 ssize_t core_alua_show_offline_bit(struct se_lun *lun, char *page)
 {
-       if (!(lun->lun_sep))
+       if (!lun->lun_sep)
                return -ENODEV;
 
        return sprintf(page, "%d\n",
@@ -1874,22 +1874,22 @@ ssize_t core_alua_store_offline_bit(
        unsigned long tmp;
        int ret;
 
-       if (!(lun->lun_sep))
+       if (!lun->lun_sep)
                return -ENODEV;
 
        ret = strict_strtoul(page, 0, &tmp);
        if (ret < 0) {
-               printk(KERN_ERR "Unable to extract alua_tg_pt_offline value\n");
+               pr_err("Unable to extract alua_tg_pt_offline value\n");
                return -EINVAL;
        }
        if ((tmp != 0) && (tmp != 1)) {
-               printk(KERN_ERR "Illegal value for alua_tg_pt_offline: %lu\n",
+               pr_err("Illegal value for alua_tg_pt_offline: %lu\n",
                                tmp);
                return -EINVAL;
        }
        tg_pt_gp_mem = lun->lun_sep->sep_alua_tg_pt_gp_mem;
-       if (!(tg_pt_gp_mem)) {
-               printk(KERN_ERR "Unable to locate *tg_pt_gp_mem\n");
+       if (!tg_pt_gp_mem) {
+               pr_err("Unable to locate *tg_pt_gp_mem\n");
                return -EINVAL;
        }
 
@@ -1918,13 +1918,13 @@ ssize_t core_alua_store_secondary_status(
 
        ret = strict_strtoul(page, 0, &tmp);
        if (ret < 0) {
-               printk(KERN_ERR "Unable to extract alua_tg_pt_status\n");
+               pr_err("Unable to extract alua_tg_pt_status\n");
                return -EINVAL;
        }
        if ((tmp != ALUA_STATUS_NONE) &&
            (tmp != ALUA_STATUS_ALTERED_BY_EXPLICT_STPG) &&
            (tmp != ALUA_STATUS_ALTERED_BY_IMPLICT_ALUA)) {
-               printk(KERN_ERR "Illegal value for alua_tg_pt_status: %lu\n",
+               pr_err("Illegal value for alua_tg_pt_status: %lu\n",
                                tmp);
                return -EINVAL;
        }
@@ -1951,11 +1951,11 @@ ssize_t core_alua_store_secondary_write_metadata(
 
        ret = strict_strtoul(page, 0, &tmp);
        if (ret < 0) {
-               printk(KERN_ERR "Unable to extract alua_tg_pt_write_md\n");
+               pr_err("Unable to extract alua_tg_pt_write_md\n");
                return -EINVAL;
        }
        if ((tmp != 0) && (tmp != 1)) {
-               printk(KERN_ERR "Illegal value for alua_tg_pt_write_md:"
+               pr_err("Illegal value for alua_tg_pt_write_md:"
                                " %lu\n", tmp);
                return -EINVAL;
        }
@@ -1979,7 +1979,7 @@ int core_setup_alua(struct se_device *dev, int force_pt)
            !(dev->se_sub_dev->se_dev_attrib.emulate_alua)) || force_pt) {
                alua->alua_type = SPC_ALUA_PASSTHROUGH;
                alua->alua_state_check = &core_alua_state_check_nop;
-               printk(KERN_INFO "%s: Using SPC_ALUA_PASSTHROUGH, no ALUA"
+               pr_debug("%s: Using SPC_ALUA_PASSTHROUGH, no ALUA"
                        " emulation\n", dev->transport->name);
                return 0;
        }
@@ -1988,7 +1988,7 @@ int core_setup_alua(struct se_device *dev, int force_pt)
         * use emulated ALUA.
         */
        if (dev->transport->get_device_rev(dev) >= SCSI_3) {
-               printk(KERN_INFO "%s: Enabling ALUA Emulation for SPC-3"
+               pr_debug("%s: Enabling ALUA Emulation for SPC-3"
                        " device\n", dev->transport->name);
                /*
                 * Associate this struct se_device with the default ALUA
@@ -2005,13 +2005,13 @@ int core_setup_alua(struct se_device *dev, int force_pt)
                                default_lu_gp);
                spin_unlock(&lu_gp_mem->lu_gp_mem_lock);
 
-               printk(KERN_INFO "%s: Adding to default ALUA LU Group:"
+               pr_debug("%s: Adding to default ALUA LU Group:"
                        " core/alua/lu_gps/default_lu_gp\n",
                        dev->transport->name);
        } else {
                alua->alua_type = SPC2_ALUA_DISABLED;
                alua->alua_state_check = &core_alua_state_check_nop;
-               printk(KERN_INFO "%s: Disabling ALUA Emulation for SPC-2"
+               pr_debug("%s: Disabling ALUA Emulation for SPC-2"
                        " device\n", dev->transport->name);
        }
 
index 418282d..9828300 100644 (file)
@@ -73,7 +73,7 @@ target_emulate_inquiry_std(struct se_cmd *cmd)
         * payload going back for EVPD=0
         */
        if (cmd->data_length < 6) {
-               printk(KERN_ERR "SCSI Inquiry payload length: %u"
+               pr_err("SCSI Inquiry payload length: %u"
                        " too small for EVPD=0\n", cmd->data_length);
                return -EINVAL;
        }
@@ -327,7 +327,7 @@ check_tpgi:
 
                spin_lock(&tg_pt_gp_mem->tg_pt_gp_mem_lock);
                tg_pt_gp = tg_pt_gp_mem->tg_pt_gp;
-               if (!(tg_pt_gp)) {
+               if (!tg_pt_gp) {
                        spin_unlock(&tg_pt_gp_mem->tg_pt_gp_mem_lock);
                        goto check_lu_gp;
                }
@@ -358,12 +358,12 @@ check_lu_gp:
                        goto check_scsi_name;
                }
                lu_gp_mem = dev->dev_alua_lu_gp_mem;
-               if (!(lu_gp_mem))
+               if (!lu_gp_mem)
                        goto check_scsi_name;
 
                spin_lock(&lu_gp_mem->lu_gp_mem_lock);
                lu_gp = lu_gp_mem->lu_gp;
-               if (!(lu_gp)) {
+               if (!lu_gp) {
                        spin_unlock(&lu_gp_mem->lu_gp_mem_lock);
                        goto check_scsi_name;
                }
@@ -475,14 +475,14 @@ target_emulate_evpd_b0(struct se_cmd *cmd, unsigned char *buf)
                have_tp = 1;
 
        if (cmd->data_length < (0x10 + 4)) {
-               printk(KERN_INFO "Received data_length: %u"
+               pr_debug("Received data_length: %u"
                        " too small for EVPD 0xb0\n",
                        cmd->data_length);
                return -EINVAL;
        }
 
        if (have_tp && cmd->data_length < (0x3c + 4)) {
-               printk(KERN_INFO "Received data_length: %u"
+               pr_debug("Received data_length: %u"
                        " too small for TPE=1 EVPD 0xb0\n",
                        cmd->data_length);
                have_tp = 0;
@@ -491,6 +491,9 @@ target_emulate_evpd_b0(struct se_cmd *cmd, unsigned char *buf)
        buf[0] = dev->transport->get_device_type(dev);
        buf[3] = have_tp ? 0x3c : 0x10;
 
+       /* Set WSNZ to 1 */
+       buf[4] = 0x01;
+
        /*
         * Set OPTIMAL TRANSFER LENGTH GRANULARITY
         */
@@ -667,7 +670,7 @@ target_emulate_inquiry(struct se_cmd *cmd)
         * payload length left for the next outgoing EVPD metadata
         */
        if (cmd->data_length < 4) {
-               printk(KERN_ERR "SCSI Inquiry payload length: %u"
+               pr_err("SCSI Inquiry payload length: %u"
                        " too small for EVPD=1\n", cmd->data_length);
                return -EINVAL;
        }
@@ -685,7 +688,7 @@ target_emulate_inquiry(struct se_cmd *cmd)
                }
 
        transport_kunmap_first_data_page(cmd);
-       printk(KERN_ERR "Unknown VPD Code: 0x%02x\n", cdb[2]);
+       pr_err("Unknown VPD Code: 0x%02x\n", cdb[2]);
        return -EINVAL;
 }
 
@@ -891,7 +894,7 @@ target_emulate_modesense(struct se_cmd *cmd, int ten)
                length += target_modesense_control(dev, &buf[offset+length]);
                break;
        default:
-               printk(KERN_ERR "Got Unknown Mode Page: 0x%02x\n",
+               pr_err("Got Unknown Mode Page: 0x%02x\n",
                                cdb[2] & 0x3f);
                return PYX_TRANSPORT_UNKNOWN_MODE_PAGE;
        }
@@ -947,14 +950,14 @@ target_emulate_request_sense(struct se_cmd *cmd)
        int err = 0;
 
        if (cdb[1] & 0x01) {
-               printk(KERN_ERR "REQUEST_SENSE description emulation not"
+               pr_err("REQUEST_SENSE description emulation not"
                        " supported\n");
                return PYX_TRANSPORT_INVALID_CDB_FIELD;
        }
 
        buf = transport_kmap_first_data_page(cmd);
 
-       if (!(core_scsi3_ua_clear_for_request_sense(cmd, &ua_asc, &ua_ascq))) {
+       if (!core_scsi3_ua_clear_for_request_sense(cmd, &ua_asc, &ua_ascq)) {
                /*
                 * CURRENT ERROR, UNIT ATTENTION
                 */
@@ -1028,18 +1031,18 @@ target_emulate_unmap(struct se_task *task)
        buf = transport_kmap_first_data_page(cmd);
 
        ptr = &buf[offset];
-       printk(KERN_INFO "UNMAP: Sub: %s Using dl: %hu bd_dl: %hu size: %hu"
+       pr_debug("UNMAP: Sub: %s Using dl: %hu bd_dl: %hu size: %hu"
                " ptr: %p\n", dev->transport->name, dl, bd_dl, size, ptr);
 
        while (size) {
                lba = get_unaligned_be64(&ptr[0]);
                range = get_unaligned_be32(&ptr[8]);
-               printk(KERN_INFO "UNMAP: Using lba: %llu and range: %u\n",
+               pr_debug("UNMAP: Using lba: %llu and range: %u\n",
                                 (unsigned long long)lba, range);
 
                ret = dev->transport->do_discard(dev, lba, range);
                if (ret < 0) {
-                       printk(KERN_ERR "blkdev_issue_discard() failed: %d\n",
+                       pr_err("blkdev_issue_discard() failed: %d\n",
                                        ret);
                        goto err;
                }
@@ -1084,12 +1087,12 @@ target_emulate_write_same(struct se_task *task, int write_same32)
        else
                range = (dev->transport->get_blocks(dev) - lba);
 
-       printk(KERN_INFO "WRITE_SAME UNMAP: LBA: %llu Range: %llu\n",
+       pr_debug("WRITE_SAME UNMAP: LBA: %llu Range: %llu\n",
                 (unsigned long long)lba, (unsigned long long)range);
 
        ret = dev->transport->do_discard(dev, lba, range);
        if (ret < 0) {
-               printk(KERN_INFO "blkdev_issue_discard() failed for WRITE_SAME\n");
+               pr_debug("blkdev_issue_discard() failed for WRITE_SAME\n");
                return ret;
        }
 
@@ -1125,7 +1128,7 @@ transport_emulate_control_cdb(struct se_task *task)
                        ret = target_emulate_readcapacity_16(cmd);
                        break;
                default:
-                       printk(KERN_ERR "Unsupported SA: 0x%02x\n",
+                       pr_err("Unsupported SA: 0x%02x\n",
                                cmd->t_task_cdb[1] & 0x1f);
                        return PYX_TRANSPORT_UNKNOWN_SAM_OPCODE;
                }
@@ -1135,7 +1138,7 @@ transport_emulate_control_cdb(struct se_task *task)
                break;
        case UNMAP:
                if (!dev->transport->do_discard) {
-                       printk(KERN_ERR "UNMAP emulation not supported for: %s\n",
+                       pr_err("UNMAP emulation not supported for: %s\n",
                                        dev->transport->name);
                        return PYX_TRANSPORT_UNKNOWN_SAM_OPCODE;
                }
@@ -1143,7 +1146,7 @@ transport_emulate_control_cdb(struct se_task *task)
                break;
        case WRITE_SAME_16:
                if (!dev->transport->do_discard) {
-                       printk(KERN_ERR "WRITE_SAME_16 emulation not supported"
+                       pr_err("WRITE_SAME_16 emulation not supported"
                                        " for: %s\n", dev->transport->name);
                        return PYX_TRANSPORT_UNKNOWN_SAM_OPCODE;
                }
@@ -1155,7 +1158,7 @@ transport_emulate_control_cdb(struct se_task *task)
                switch (service_action) {
                case WRITE_SAME_32:
                        if (!dev->transport->do_discard) {
-                               printk(KERN_ERR "WRITE_SAME_32 SA emulation not"
+                               pr_err("WRITE_SAME_32 SA emulation not"
                                        " supported for: %s\n",
                                        dev->transport->name);
                                return PYX_TRANSPORT_UNKNOWN_SAM_OPCODE;
@@ -1163,7 +1166,7 @@ transport_emulate_control_cdb(struct se_task *task)
                        ret = target_emulate_write_same(task, 1);
                        break;
                default:
-                       printk(KERN_ERR "Unsupported VARIABLE_LENGTH_CMD SA:"
+                       pr_err("Unsupported VARIABLE_LENGTH_CMD SA:"
                                        " 0x%02x\n", service_action);
                        break;
                }
@@ -1171,8 +1174,7 @@ transport_emulate_control_cdb(struct se_task *task)
        case SYNCHRONIZE_CACHE:
        case 0x91: /* SYNCHRONIZE_CACHE_16: */
                if (!dev->transport->do_sync_cache) {
-                       printk(KERN_ERR
-                               "SYNCHRONIZE_CACHE emulation not supported"
+                       pr_err("SYNCHRONIZE_CACHE emulation not supported"
                                " for: %s\n", dev->transport->name);
                        return PYX_TRANSPORT_UNKNOWN_SAM_OPCODE;
                }
@@ -1189,7 +1191,7 @@ transport_emulate_control_cdb(struct se_task *task)
        case WRITE_FILEMARKS:
                break;
        default:
-               printk(KERN_ERR "Unsupported SCSI Opcode: 0x%02x for %s\n",
+               pr_err("Unsupported SCSI Opcode: 0x%02x for %s\n",
                        cmd->t_task_cdb[0], dev->transport->name);
                return PYX_TRANSPORT_UNKNOWN_SAM_OPCODE;
        }
index 6b00810..e56c39d 100644 (file)
@@ -104,12 +104,12 @@ static struct target_fabric_configfs *target_core_get_fabric(
 {
        struct target_fabric_configfs *tf;
 
-       if (!(name))
+       if (!name)
                return NULL;
 
        mutex_lock(&g_tf_lock);
        list_for_each_entry(tf, &g_tf_list, tf_list) {
-               if (!(strcmp(tf->tf_name, name))) {
+               if (!strcmp(tf->tf_name, name)) {
                        atomic_inc(&tf->tf_access_cnt);
                        mutex_unlock(&g_tf_lock);
                        return tf;
@@ -130,7 +130,7 @@ static struct config_group *target_core_register_fabric(
        struct target_fabric_configfs *tf;
        int ret;
 
-       printk(KERN_INFO "Target_Core_ConfigFS: REGISTER -> group: %p name:"
+       pr_debug("Target_Core_ConfigFS: REGISTER -> group: %p name:"
                        " %s\n", group, name);
        /*
         * Ensure that TCM subsystem plugins are loaded at this point for
@@ -150,7 +150,7 @@ static struct config_group *target_core_register_fabric(
         * registered, but simply provids auto loading logic for modules with
         * mkdir(2) system calls with known TCM fabric modules.
         */
-       if (!(strncmp(name, "iscsi", 5))) {
+       if (!strncmp(name, "iscsi", 5)) {
                /*
                 * Automatically load the LIO Target fabric module when the
                 * following is called:
@@ -159,11 +159,11 @@ static struct config_group *target_core_register_fabric(
                 */
                ret = request_module("iscsi_target_mod");
                if (ret < 0) {
-                       printk(KERN_ERR "request_module() failed for"
+                       pr_err("request_module() failed for"
                                " iscsi_target_mod.ko: %d\n", ret);
                        return ERR_PTR(-EINVAL);
                }
-       } else if (!(strncmp(name, "loopback", 8))) {
+       } else if (!strncmp(name, "loopback", 8)) {
                /*
                 * Automatically load the tcm_loop fabric module when the
                 * following is called:
@@ -172,25 +172,25 @@ static struct config_group *target_core_register_fabric(
                 */
                ret = request_module("tcm_loop");
                if (ret < 0) {
-                       printk(KERN_ERR "request_module() failed for"
+                       pr_err("request_module() failed for"
                                " tcm_loop.ko: %d\n", ret);
                        return ERR_PTR(-EINVAL);
                }
        }
 
        tf = target_core_get_fabric(name);
-       if (!(tf)) {
-               printk(KERN_ERR "target_core_get_fabric() failed for %s\n",
+       if (!tf) {
+               pr_err("target_core_get_fabric() failed for %s\n",
                        name);
                return ERR_PTR(-EINVAL);
        }
-       printk(KERN_INFO "Target_Core_ConfigFS: REGISTER -> Located fabric:"
+       pr_debug("Target_Core_ConfigFS: REGISTER -> Located fabric:"
                        " %s\n", tf->tf_name);
        /*
         * On a successful target_core_get_fabric() look, the returned
         * struct target_fabric_configfs *tf will contain a usage reference.
         */
-       printk(KERN_INFO "Target_Core_ConfigFS: REGISTER tfc_wwn_cit -> %p\n",
+       pr_debug("Target_Core_ConfigFS: REGISTER tfc_wwn_cit -> %p\n",
                        &TF_CIT_TMPL(tf)->tfc_wwn_cit);
 
        tf->tf_group.default_groups = tf->tf_default_groups;
@@ -202,14 +202,14 @@ static struct config_group *target_core_register_fabric(
        config_group_init_type_name(&tf->tf_disc_group, "discovery_auth",
                        &TF_CIT_TMPL(tf)->tfc_discovery_cit);
 
-       printk(KERN_INFO "Target_Core_ConfigFS: REGISTER -> Allocated Fabric:"
+       pr_debug("Target_Core_ConfigFS: REGISTER -> Allocated Fabric:"
                        " %s\n", tf->tf_group.cg_item.ci_name);
        /*
         * Setup tf_ops.tf_subsys pointer for usage with configfs_depend_item()
         */
        tf->tf_ops.tf_subsys = tf->tf_subsys;
        tf->tf_fabric = &tf->tf_group.cg_item;
-       printk(KERN_INFO "Target_Core_ConfigFS: REGISTER -> Set tf->tf_fabric"
+       pr_debug("Target_Core_ConfigFS: REGISTER -> Set tf->tf_fabric"
                        " for %s\n", name);
 
        return &tf->tf_group;
@@ -228,18 +228,18 @@ static void target_core_deregister_fabric(
        struct config_item *df_item;
        int i;
 
-       printk(KERN_INFO "Target_Core_ConfigFS: DEREGISTER -> Looking up %s in"
+       pr_debug("Target_Core_ConfigFS: DEREGISTER -> Looking up %s in"
                " tf list\n", config_item_name(item));
 
-       printk(KERN_INFO "Target_Core_ConfigFS: DEREGISTER -> located fabric:"
+       pr_debug("Target_Core_ConfigFS: DEREGISTER -> located fabric:"
                        " %s\n", tf->tf_name);
        atomic_dec(&tf->tf_access_cnt);
 
-       printk(KERN_INFO "Target_Core_ConfigFS: DEREGISTER -> Releasing"
+       pr_debug("Target_Core_ConfigFS: DEREGISTER -> Releasing"
                        " tf->tf_fabric for %s\n", tf->tf_name);
        tf->tf_fabric = NULL;
 
-       printk(KERN_INFO "Target_Core_ConfigFS: DEREGISTER -> Releasing ci"
+       pr_debug("Target_Core_ConfigFS: DEREGISTER -> Releasing ci"
                        " %s\n", config_item_name(item));
 
        tf_group = &tf->tf_group;
@@ -307,17 +307,17 @@ struct target_fabric_configfs *target_fabric_configfs_init(
        struct target_fabric_configfs *tf;
 
        if (!(name)) {
-               printk(KERN_ERR "Unable to locate passed fabric name\n");
+               pr_err("Unable to locate passed fabric name\n");
                return ERR_PTR(-EINVAL);
        }
        if (strlen(name) >= TARGET_FABRIC_NAME_SIZE) {
-               printk(KERN_ERR "Passed name: %s exceeds TARGET_FABRIC"
+               pr_err("Passed name: %s exceeds TARGET_FABRIC"
                        "_NAME_SIZE\n", name);
                return ERR_PTR(-EINVAL);
        }
 
        tf = kzalloc(sizeof(struct target_fabric_configfs), GFP_KERNEL);
-       if (!(tf))
+       if (!tf)
                return ERR_PTR(-ENOMEM);
 
        INIT_LIST_HEAD(&tf->tf_list);
@@ -336,9 +336,9 @@ struct target_fabric_configfs *target_fabric_configfs_init(
        list_add_tail(&tf->tf_list, &g_tf_list);
        mutex_unlock(&g_tf_lock);
 
-       printk(KERN_INFO "<<<<<<<<<<<<<<<<<<<<<< BEGIN FABRIC API >>>>>>>>"
+       pr_debug("<<<<<<<<<<<<<<<<<<<<<< BEGIN FABRIC API >>>>>>>>"
                        ">>>>>>>>>>>>>>\n");
-       printk(KERN_INFO "Initialized struct target_fabric_configfs: %p for"
+       pr_debug("Initialized struct target_fabric_configfs: %p for"
                        " %s\n", tf, tf->tf_name);
        return tf;
 }
@@ -367,132 +367,132 @@ static int target_fabric_tf_ops_check(
 {
        struct target_core_fabric_ops *tfo = &tf->tf_ops;
 
-       if (!(tfo->get_fabric_name)) {
-               printk(KERN_ERR "Missing tfo->get_fabric_name()\n");
+       if (!tfo->get_fabric_name) {
+               pr_err("Missing tfo->get_fabric_name()\n");
                return -EINVAL;
        }
-       if (!(tfo->get_fabric_proto_ident)) {
-               printk(KERN_ERR "Missing tfo->get_fabric_proto_ident()\n");
+       if (!tfo->get_fabric_proto_ident) {
+               pr_err("Missing tfo->get_fabric_proto_ident()\n");
                return -EINVAL;
        }
-       if (!(tfo->tpg_get_wwn)) {
-               printk(KERN_ERR "Missing tfo->tpg_get_wwn()\n");
+       if (!tfo->tpg_get_wwn) {
+               pr_err("Missing tfo->tpg_get_wwn()\n");
                return -EINVAL;
        }
-       if (!(tfo->tpg_get_tag)) {
-               printk(KERN_ERR "Missing tfo->tpg_get_tag()\n");
+       if (!tfo->tpg_get_tag) {
+               pr_err("Missing tfo->tpg_get_tag()\n");
                return -EINVAL;
        }
-       if (!(tfo->tpg_get_default_depth)) {
-               printk(KERN_ERR "Missing tfo->tpg_get_default_depth()\n");
+       if (!tfo->tpg_get_default_depth) {
+               pr_err("Missing tfo->tpg_get_default_depth()\n");
                return -EINVAL;
        }
-       if (!(tfo->tpg_get_pr_transport_id)) {
-               printk(KERN_ERR "Missing tfo->tpg_get_pr_transport_id()\n");
+       if (!tfo->tpg_get_pr_transport_id) {
+               pr_err("Missing tfo->tpg_get_pr_transport_id()\n");
                return -EINVAL;
        }
-       if (!(tfo->tpg_get_pr_transport_id_len)) {
-               printk(KERN_ERR "Missing tfo->tpg_get_pr_transport_id_len()\n");
+       if (!tfo->tpg_get_pr_transport_id_len) {
+               pr_err("Missing tfo->tpg_get_pr_transport_id_len()\n");
                return -EINVAL;
        }
-       if (!(tfo->tpg_check_demo_mode)) {
-               printk(KERN_ERR "Missing tfo->tpg_check_demo_mode()\n");
+       if (!tfo->tpg_check_demo_mode) {
+               pr_err("Missing tfo->tpg_check_demo_mode()\n");
                return -EINVAL;
        }
-       if (!(tfo->tpg_check_demo_mode_cache)) {
-               printk(KERN_ERR "Missing tfo->tpg_check_demo_mode_cache()\n");
+       if (!tfo->tpg_check_demo_mode_cache) {
+               pr_err("Missing tfo->tpg_check_demo_mode_cache()\n");
                return -EINVAL;
        }
-       if (!(tfo->tpg_check_demo_mode_write_protect)) {
-               printk(KERN_ERR "Missing tfo->tpg_check_demo_mode_write_protect()\n");
+       if (!tfo->tpg_check_demo_mode_write_protect) {
+               pr_err("Missing tfo->tpg_check_demo_mode_write_protect()\n");
                return -EINVAL;
        }
-       if (!(tfo->tpg_check_prod_mode_write_protect)) {
-               printk(KERN_ERR "Missing tfo->tpg_check_prod_mode_write_protect()\n");
+       if (!tfo->tpg_check_prod_mode_write_protect) {
+               pr_err("Missing tfo->tpg_check_prod_mode_write_protect()\n");
                return -EINVAL;
        }
-       if (!(tfo->tpg_alloc_fabric_acl)) {
-               printk(KERN_ERR "Missing tfo->tpg_alloc_fabric_acl()\n");
+       if (!tfo->tpg_alloc_fabric_acl) {
+               pr_err("Missing tfo->tpg_alloc_fabric_acl()\n");
                return -EINVAL;
        }
-       if (!(tfo->tpg_release_fabric_acl)) {
-               printk(KERN_ERR "Missing tfo->tpg_release_fabric_acl()\n");
+       if (!tfo->tpg_release_fabric_acl) {
+               pr_err("Missing tfo->tpg_release_fabric_acl()\n");
                return -EINVAL;
        }
-       if (!(tfo->tpg_get_inst_index)) {
-               printk(KERN_ERR "Missing tfo->tpg_get_inst_index()\n");
+       if (!tfo->tpg_get_inst_index) {
+               pr_err("Missing tfo->tpg_get_inst_index()\n");
                return -EINVAL;
        }
        if (!tfo->release_cmd) {
-               printk(KERN_ERR "Missing tfo->release_cmd()\n");
+               pr_err("Missing tfo->release_cmd()\n");
                return -EINVAL;
        }
-       if (!(tfo->shutdown_session)) {
-               printk(KERN_ERR "Missing tfo->shutdown_session()\n");
+       if (!tfo->shutdown_session) {
+               pr_err("Missing tfo->shutdown_session()\n");
                return -EINVAL;
        }
-       if (!(tfo->close_session)) {
-               printk(KERN_ERR "Missing tfo->close_session()\n");
+       if (!tfo->close_session) {
+               pr_err("Missing tfo->close_session()\n");
                return -EINVAL;
        }
-       if (!(tfo->stop_session)) {
-               printk(KERN_ERR "Missing tfo->stop_session()\n");
+       if (!tfo->stop_session) {
+               pr_err("Missing tfo->stop_session()\n");
                return -EINVAL;
        }
-       if (!(tfo->fall_back_to_erl0)) {
-               printk(KERN_ERR "Missing tfo->fall_back_to_erl0()\n");
+       if (!tfo->fall_back_to_erl0) {
+               pr_err("Missing tfo->fall_back_to_erl0()\n");
                return -EINVAL;
        }
-       if (!(tfo->sess_logged_in)) {
-               printk(KERN_ERR "Missing tfo->sess_logged_in()\n");
+       if (!tfo->sess_logged_in) {
+               pr_err("Missing tfo->sess_logged_in()\n");
                return -EINVAL;
        }
-       if (!(tfo->sess_get_index)) {
-               printk(KERN_ERR "Missing tfo->sess_get_index()\n");
+       if (!tfo->sess_get_index) {
+               pr_err("Missing tfo->sess_get_index()\n");
                return -EINVAL;
        }
-       if (!(tfo->write_pending)) {
-               printk(KERN_ERR "Missing tfo->write_pending()\n");
+       if (!tfo->write_pending) {
+               pr_err("Missing tfo->write_pending()\n");
                return -EINVAL;
        }
-       if (!(tfo->write_pending_status)) {
-               printk(KERN_ERR "Missing tfo->write_pending_status()\n");
+       if (!tfo->write_pending_status) {
+               pr_err("Missing tfo->write_pending_status()\n");
                return -EINVAL;
        }
-       if (!(tfo->set_default_node_attributes)) {
-               printk(KERN_ERR "Missing tfo->set_default_node_attributes()\n");
+       if (!tfo->set_default_node_attributes) {
+               pr_err("Missing tfo->set_default_node_attributes()\n");
                return -EINVAL;
        }
-       if (!(tfo->get_task_tag)) {
-               printk(KERN_ERR "Missing tfo->get_task_tag()\n");
+       if (!tfo->get_task_tag) {
+               pr_err("Missing tfo->get_task_tag()\n");
                return -EINVAL;
        }
-       if (!(tfo->get_cmd_state)) {
-               printk(KERN_ERR "Missing tfo->get_cmd_state()\n");
+       if (!tfo->get_cmd_state) {
+               pr_err("Missing tfo->get_cmd_state()\n");
                return -EINVAL;
        }
-       if (!(tfo->queue_data_in)) {
-               printk(KERN_ERR "Missing tfo->queue_data_in()\n");
+       if (!tfo->queue_data_in) {
+               pr_err("Missing tfo->queue_data_in()\n");
                return -EINVAL;
        }
-       if (!(tfo->queue_status)) {
-               printk(KERN_ERR "Missing tfo->queue_status()\n");
+       if (!tfo->queue_status) {
+               pr_err("Missing tfo->queue_status()\n");
                return -EINVAL;
        }
-       if (!(tfo->queue_tm_rsp)) {
-               printk(KERN_ERR "Missing tfo->queue_tm_rsp()\n");
+       if (!tfo->queue_tm_rsp) {
+               pr_err("Missing tfo->queue_tm_rsp()\n");
                return -EINVAL;
        }
-       if (!(tfo->set_fabric_sense_len)) {
-               printk(KERN_ERR "Missing tfo->set_fabric_sense_len()\n");
+       if (!tfo->set_fabric_sense_len) {
+               pr_err("Missing tfo->set_fabric_sense_len()\n");
                return -EINVAL;
        }
-       if (!(tfo->get_fabric_sense_len)) {
-               printk(KERN_ERR "Missing tfo->get_fabric_sense_len()\n");
+       if (!tfo->get_fabric_sense_len) {
+               pr_err("Missing tfo->get_fabric_sense_len()\n");
                return -EINVAL;
        }
-       if (!(tfo->is_state_remove)) {
-               printk(KERN_ERR "Missing tfo->is_state_remove()\n");
+       if (!tfo->is_state_remove) {
+               pr_err("Missing tfo->is_state_remove()\n");
                return -EINVAL;
        }
        /*
@@ -500,20 +500,20 @@ static int target_fabric_tf_ops_check(
         * tfo->fabric_make_tpg() and tfo->fabric_drop_tpg() in
         * target_core_fabric_configfs.c WWN+TPG group context code.
         */
-       if (!(tfo->fabric_make_wwn)) {
-               printk(KERN_ERR "Missing tfo->fabric_make_wwn()\n");
+       if (!tfo->fabric_make_wwn) {
+               pr_err("Missing tfo->fabric_make_wwn()\n");
                return -EINVAL;
        }
-       if (!(tfo->fabric_drop_wwn)) {
-               printk(KERN_ERR "Missing tfo->fabric_drop_wwn()\n");
+       if (!tfo->fabric_drop_wwn) {
+               pr_err("Missing tfo->fabric_drop_wwn()\n");
                return -EINVAL;
        }
-       if (!(tfo->fabric_make_tpg)) {
-               printk(KERN_ERR "Missing tfo->fabric_make_tpg()\n");
+       if (!tfo->fabric_make_tpg) {
+               pr_err("Missing tfo->fabric_make_tpg()\n");
                return -EINVAL;
        }
-       if (!(tfo->fabric_drop_tpg)) {
-               printk(KERN_ERR "Missing tfo->fabric_drop_tpg()\n");
+       if (!tfo->fabric_drop_tpg) {
+               pr_err("Missing tfo->fabric_drop_tpg()\n");
                return -EINVAL;
        }
 
@@ -533,13 +533,13 @@ int target_fabric_configfs_register(
 {
        int ret;
 
-       if (!(tf)) {
-               printk(KERN_ERR "Unable to locate target_fabric_configfs"
+       if (!tf) {
+               pr_err("Unable to locate target_fabric_configfs"
                        " pointer\n");
                return -EINVAL;
        }
-       if (!(tf->tf_subsys)) {
-               printk(KERN_ERR "Unable to target struct config_subsystem"
+       if (!tf->tf_subsys) {
+               pr_err("Unable to target struct config_subsystem"
                        " pointer\n");
                return -EINVAL;
        }
@@ -547,7 +547,7 @@ int target_fabric_configfs_register(
        if (ret < 0)
                return ret;
 
-       printk(KERN_INFO "<<<<<<<<<<<<<<<<<<<<<< END FABRIC API >>>>>>>>>>>>"
+       pr_debug("<<<<<<<<<<<<<<<<<<<<<< END FABRIC API >>>>>>>>>>>>"
                ">>>>>>>>>>\n");
        return 0;
 }
@@ -558,36 +558,36 @@ void target_fabric_configfs_deregister(
 {
        struct configfs_subsystem *su;
 
-       if (!(tf)) {
-               printk(KERN_ERR "Unable to locate passed target_fabric_"
+       if (!tf) {
+               pr_err("Unable to locate passed target_fabric_"
                        "configfs\n");
                return;
        }
        su = tf->tf_subsys;
-       if (!(su)) {
-               printk(KERN_ERR "Unable to locate passed tf->tf_subsys"
+       if (!su) {
+               pr_err("Unable to locate passed tf->tf_subsys"
                        " pointer\n");
                return;
        }
-       printk(KERN_INFO "<<<<<<<<<<<<<<<<<<<<<< BEGIN FABRIC API >>>>>>>>>>"
+       pr_debug("<<<<<<<<<<<<<<<<<<<<<< BEGIN FABRIC API >>>>>>>>>>"
                        ">>>>>>>>>>>>\n");
        mutex_lock(&g_tf_lock);
        if (atomic_read(&tf->tf_access_cnt)) {
                mutex_unlock(&g_tf_lock);
-               printk(KERN_ERR "Non zero tf->tf_access_cnt for fabric %s\n",
+               pr_err("Non zero tf->tf_access_cnt for fabric %s\n",
                        tf->tf_name);
                BUG();
        }
        list_del(&tf->tf_list);
        mutex_unlock(&g_tf_lock);
 
-       printk(KERN_INFO "Target_Core_ConfigFS: DEREGISTER -> Releasing tf:"
+       pr_debug("Target_Core_ConfigFS: DEREGISTER -> Releasing tf:"
                        " %s\n", tf->tf_name);
        tf->tf_module = NULL;
        tf->tf_subsys = NULL;
        kfree(tf);
 
-       printk("<<<<<<<<<<<<<<<<<<<<<< END FABRIC API >>>>>>>>>>>>>>>>>"
+       pr_debug("<<<<<<<<<<<<<<<<<<<<<< END FABRIC API >>>>>>>>>>>>>>>>>"
                        ">>>>>\n");
 }
 EXPORT_SYMBOL(target_fabric_configfs_deregister);
@@ -609,7 +609,7 @@ static ssize_t target_core_dev_show_attr_##_name(                   \
                                                                        \
        spin_lock(&se_dev->se_dev_lock);                                \
        dev = se_dev->se_dev_ptr;                                       \
-       if (!(dev)) {                                                   \
+       if (!dev) {                                                     \
                spin_unlock(&se_dev->se_dev_lock);                      \
                return -ENODEV;                                         \
        }                                                               \
@@ -633,14 +633,14 @@ static ssize_t target_core_dev_store_attr_##_name(                        \
                                                                        \
        spin_lock(&se_dev->se_dev_lock);                                \
        dev = se_dev->se_dev_ptr;                                       \
-       if (!(dev)) {                                                   \
+       if (!dev) {                                                     \
                spin_unlock(&se_dev->se_dev_lock);                      \
                return -ENODEV;                                         \
        }                                                               \
        ret = strict_strtoul(page, 0, &val);                            \
        if (ret < 0) {                                                  \
                spin_unlock(&se_dev->se_dev_lock);                      \
-               printk(KERN_ERR "strict_strtoul() failed with"          \
+               pr_err("strict_strtoul() failed with"           \
                        " ret: %d\n", ret);                             \
                return -EINVAL;                                         \
        }                                                               \
@@ -806,7 +806,7 @@ static ssize_t target_core_dev_wwn_show_attr_vpd_unit_serial(
        struct se_device *dev;
 
        dev = se_dev->se_dev_ptr;
-       if (!(dev))
+       if (!dev)
                return -ENODEV;
 
        return sprintf(page, "T10 VPD Unit Serial Number: %s\n",
@@ -833,13 +833,13 @@ static ssize_t target_core_dev_wwn_store_attr_vpd_unit_serial(
         * VPD Unit Serial Number that OS dependent multipath can depend on.
         */
        if (su_dev->su_dev_flags & SDF_FIRMWARE_VPD_UNIT_SERIAL) {
-               printk(KERN_ERR "Underlying SCSI device firmware provided VPD"
+               pr_err("Underlying SCSI device firmware provided VPD"
                        " Unit Serial, ignoring request\n");
                return -EOPNOTSUPP;
        }
 
        if (strlen(page) >= INQUIRY_VPD_SERIAL_LEN) {
-               printk(KERN_ERR "Emulated VPD Unit Serial exceeds"
+               pr_err("Emulated VPD Unit Serial exceeds"
                " INQUIRY_VPD_SERIAL_LEN: %d\n", INQUIRY_VPD_SERIAL_LEN);
                return -EOVERFLOW;
        }
@@ -850,9 +850,9 @@ static ssize_t target_core_dev_wwn_store_attr_vpd_unit_serial(
         * could cause negative effects.
         */
        dev = su_dev->se_dev_ptr;
-       if ((dev)) {
+       if (dev) {
                if (atomic_read(&dev->dev_export_obj.obj_access_count)) {
-                       printk(KERN_ERR "Unable to set VPD Unit Serial while"
+                       pr_err("Unable to set VPD Unit Serial while"
                                " active %d $FABRIC_MOD exports exist\n",
                                atomic_read(&dev->dev_export_obj.obj_access_count));
                        return -EINVAL;
@@ -870,7 +870,7 @@ static ssize_t target_core_dev_wwn_store_attr_vpd_unit_serial(
                        "%s", strstrip(buf));
        su_dev->su_dev_flags |= SDF_EMULATED_VPD_UNIT_SERIAL;
 
-       printk(KERN_INFO "Target_Core_ConfigFS: Set emulated VPD Unit Serial:"
+       pr_debug("Target_Core_ConfigFS: Set emulated VPD Unit Serial:"
                        " %s\n", su_dev->t10_wwn.unit_serial);
 
        return count;
@@ -892,19 +892,19 @@ static ssize_t target_core_dev_wwn_show_attr_vpd_protocol_identifier(
        ssize_t len = 0;
 
        dev = se_dev->se_dev_ptr;
-       if (!(dev))
+       if (!dev)
                return -ENODEV;
 
        memset(buf, 0, VPD_TMP_BUF_SIZE);
 
        spin_lock(&t10_wwn->t10_vpd_lock);
        list_for_each_entry(vpd, &t10_wwn->t10_vpd_list, vpd_list) {
-               if (!(vpd->protocol_identifier_set))
+               if (!vpd->protocol_identifier_set)
                        continue;
 
                transport_dump_vpd_proto_id(vpd, buf, VPD_TMP_BUF_SIZE);
 
-               if ((len + strlen(buf) >= PAGE_SIZE))
+               if (len + strlen(buf) >= PAGE_SIZE)
                        break;
 
                len += sprintf(page+len, "%s", buf);
@@ -939,7 +939,7 @@ static ssize_t target_core_dev_wwn_show_attr_##_name(                       \
        ssize_t len = 0;                                                \
                                                                        \
        dev = se_dev->se_dev_ptr;                                       \
-       if (!(dev))                                                     \
+       if (!dev)                                                       \
                return -ENODEV;                                         \
                                                                        \
        spin_lock(&t10_wwn->t10_vpd_lock);                              \
@@ -949,19 +949,19 @@ static ssize_t target_core_dev_wwn_show_attr_##_name(                     \
                                                                        \
                memset(buf, 0, VPD_TMP_BUF_SIZE);                       \
                transport_dump_vpd_assoc(vpd, buf, VPD_TMP_BUF_SIZE);   \
-               if ((len + strlen(buf) >= PAGE_SIZE))                   \
+               if (len + strlen(buf) >= PAGE_SIZE)                     \
                        break;                                          \
                len += sprintf(page+len, "%s", buf);                    \
                                                                        \
                memset(buf, 0, VPD_TMP_BUF_SIZE);                       \
                transport_dump_vpd_ident_type(vpd, buf, VPD_TMP_BUF_SIZE); \
-               if ((len + strlen(buf) >= PAGE_SIZE))                   \
+               if (len + strlen(buf) >= PAGE_SIZE)                     \
                        break;                                          \
                len += sprintf(page+len, "%s", buf);                    \
                                                                        \
                memset(buf, 0, VPD_TMP_BUF_SIZE);                       \
                transport_dump_vpd_ident(vpd, buf, VPD_TMP_BUF_SIZE); \
-               if ((len + strlen(buf) >= PAGE_SIZE))                   \
+               if (len + strlen(buf) >= PAGE_SIZE)                     \
                        break;                                          \
                len += sprintf(page+len, "%s", buf);                    \
        }                                                               \
@@ -1070,7 +1070,7 @@ static ssize_t target_core_dev_pr_show_spc3_res(
 
        spin_lock(&dev->dev_reservation_lock);
        pr_reg = dev->dev_pr_res_holder;
-       if (!(pr_reg)) {
+       if (!pr_reg) {
                *len += sprintf(page + *len, "No SPC-3 Reservation holder\n");
                spin_unlock(&dev->dev_reservation_lock);
                return *len;
@@ -1096,7 +1096,7 @@ static ssize_t target_core_dev_pr_show_spc2_res(
 
        spin_lock(&dev->dev_reservation_lock);
        se_nacl = dev->dev_reserved_node_acl;
-       if (!(se_nacl)) {
+       if (!se_nacl) {
                *len += sprintf(page + *len, "No SPC-2 Reservation holder\n");
                spin_unlock(&dev->dev_reservation_lock);
                return *len;
@@ -1115,7 +1115,7 @@ static ssize_t target_core_dev_pr_show_attr_res_holder(
 {
        ssize_t len = 0;
 
-       if (!(su_dev->se_dev_ptr))
+       if (!su_dev->se_dev_ptr)
                return -ENODEV;
 
        switch (su_dev->t10_pr.res_type) {
@@ -1152,7 +1152,7 @@ static ssize_t target_core_dev_pr_show_attr_res_pr_all_tgt_pts(
        ssize_t len = 0;
 
        dev = su_dev->se_dev_ptr;
-       if (!(dev))
+       if (!dev)
                return -ENODEV;
 
        if (su_dev->t10_pr.res_type != SPC3_PERSISTENT_RESERVATIONS)
@@ -1160,7 +1160,7 @@ static ssize_t target_core_dev_pr_show_attr_res_pr_all_tgt_pts(
 
        spin_lock(&dev->dev_reservation_lock);
        pr_reg = dev->dev_pr_res_holder;
-       if (!(pr_reg)) {
+       if (!pr_reg) {
                len = sprintf(page, "No SPC-3 Reservation holder\n");
                spin_unlock(&dev->dev_reservation_lock);
                return len;
@@ -1189,7 +1189,7 @@ static ssize_t target_core_dev_pr_show_attr_res_pr_generation(
        struct se_subsystem_dev *su_dev,
        char *page)
 {
-       if (!(su_dev->se_dev_ptr))
+       if (!su_dev->se_dev_ptr)
                return -ENODEV;
 
        if (su_dev->t10_pr.res_type != SPC3_PERSISTENT_RESERVATIONS)
@@ -1216,7 +1216,7 @@ static ssize_t target_core_dev_pr_show_attr_res_pr_holder_tg_port(
        ssize_t len = 0;
 
        dev = su_dev->se_dev_ptr;
-       if (!(dev))
+       if (!dev)
                return -ENODEV;
 
        if (su_dev->t10_pr.res_type != SPC3_PERSISTENT_RESERVATIONS)
@@ -1224,7 +1224,7 @@ static ssize_t target_core_dev_pr_show_attr_res_pr_holder_tg_port(
 
        spin_lock(&dev->dev_reservation_lock);
        pr_reg = dev->dev_pr_res_holder;
-       if (!(pr_reg)) {
+       if (!pr_reg) {
                len = sprintf(page, "No SPC-3 Reservation holder\n");
                spin_unlock(&dev->dev_reservation_lock);
                return len;
@@ -1263,7 +1263,7 @@ static ssize_t target_core_dev_pr_show_attr_res_pr_registered_i_pts(
        ssize_t len = 0;
        int reg_count = 0, prf_isid;
 
-       if (!(su_dev->se_dev_ptr))
+       if (!su_dev->se_dev_ptr)
                return -ENODEV;
 
        if (su_dev->t10_pr.res_type != SPC3_PERSISTENT_RESERVATIONS)
@@ -1286,7 +1286,7 @@ static ssize_t target_core_dev_pr_show_attr_res_pr_registered_i_pts(
                        &i_buf[0] : "", pr_reg->pr_res_key,
                        pr_reg->pr_res_generation);
 
-               if ((len + strlen(buf) >= PAGE_SIZE))
+               if (len + strlen(buf) >= PAGE_SIZE)
                        break;
 
                len += sprintf(page+len, "%s", buf);
@@ -1294,7 +1294,7 @@ static ssize_t target_core_dev_pr_show_attr_res_pr_registered_i_pts(
        }
        spin_unlock(&su_dev->t10_pr.registration_lock);
 
-       if (!(reg_count))
+       if (!reg_count)
                len += sprintf(page+len, "None\n");
 
        return len;
@@ -1314,7 +1314,7 @@ static ssize_t target_core_dev_pr_show_attr_res_pr_type(
        ssize_t len = 0;
 
        dev = su_dev->se_dev_ptr;
-       if (!(dev))
+       if (!dev)
                return -ENODEV;
 
        if (su_dev->t10_pr.res_type != SPC3_PERSISTENT_RESERVATIONS)
@@ -1322,7 +1322,7 @@ static ssize_t target_core_dev_pr_show_attr_res_pr_type(
 
        spin_lock(&dev->dev_reservation_lock);
        pr_reg = dev->dev_pr_res_holder;
-       if (!(pr_reg)) {
+       if (!pr_reg) {
                len = sprintf(page, "No SPC-3 Reservation holder\n");
                spin_unlock(&dev->dev_reservation_lock);
                return len;
@@ -1345,7 +1345,7 @@ static ssize_t target_core_dev_pr_show_attr_res_type(
 {
        ssize_t len = 0;
 
-       if (!(su_dev->se_dev_ptr))
+       if (!su_dev->se_dev_ptr)
                return -ENODEV;
 
        switch (su_dev->t10_pr.res_type) {
@@ -1376,7 +1376,7 @@ static ssize_t target_core_dev_pr_show_attr_res_aptpl_active(
        struct se_subsystem_dev *su_dev,
        char *page)
 {
-       if (!(su_dev->se_dev_ptr))
+       if (!su_dev->se_dev_ptr)
                return -ENODEV;
 
        if (su_dev->t10_pr.res_type != SPC3_PERSISTENT_RESERVATIONS)
@@ -1395,7 +1395,7 @@ static ssize_t target_core_dev_pr_show_attr_res_aptpl_metadata(
        struct se_subsystem_dev *su_dev,
        char *page)
 {
-       if (!(su_dev->se_dev_ptr))
+       if (!su_dev->se_dev_ptr)
                return -ENODEV;
 
        if (su_dev->t10_pr.res_type != SPC3_PERSISTENT_RESERVATIONS)
@@ -1447,14 +1447,14 @@ static ssize_t target_core_dev_pr_store_attr_res_aptpl_metadata(
        u8 type = 0, scope;
 
        dev = su_dev->se_dev_ptr;
-       if (!(dev))
+       if (!dev)
                return -ENODEV;
 
        if (su_dev->t10_pr.res_type != SPC3_PERSISTENT_RESERVATIONS)
                return 0;
 
        if (atomic_read(&dev->dev_export_obj.obj_access_count)) {
-               printk(KERN_INFO "Unable to process APTPL metadata while"
+               pr_debug("Unable to process APTPL metadata while"
                        " active fabric exports exist\n");
                return -EINVAL;
        }
@@ -1484,7 +1484,7 @@ static ssize_t target_core_dev_pr_store_attr_res_aptpl_metadata(
                                goto out;
                        }
                        if (strlen(i_port) >= PR_APTPL_MAX_IPORT_LEN) {
-                               printk(KERN_ERR "APTPL metadata initiator_node="
+                               pr_err("APTPL metadata initiator_node="
                                        " exceeds PR_APTPL_MAX_IPORT_LEN: %d\n",
                                        PR_APTPL_MAX_IPORT_LEN);
                                ret = -EINVAL;
@@ -1498,7 +1498,7 @@ static ssize_t target_core_dev_pr_store_attr_res_aptpl_metadata(
                                goto out;
                        }
                        if (strlen(isid) >= PR_REG_ISID_LEN) {
-                               printk(KERN_ERR "APTPL metadata initiator_isid"
+                               pr_err("APTPL metadata initiator_isid"
                                        "= exceeds PR_REG_ISID_LEN: %d\n",
                                        PR_REG_ISID_LEN);
                                ret = -EINVAL;
@@ -1513,7 +1513,7 @@ static ssize_t target_core_dev_pr_store_attr_res_aptpl_metadata(
                        }
                        ret = strict_strtoull(arg_p, 0, &tmp_ll);
                        if (ret < 0) {
-                               printk(KERN_ERR "strict_strtoull() failed for"
+                               pr_err("strict_strtoull() failed for"
                                        " sa_res_key=\n");
                                goto out;
                        }
@@ -1559,7 +1559,7 @@ static ssize_t target_core_dev_pr_store_attr_res_aptpl_metadata(
                                goto out;
                        }
                        if (strlen(t_port) >= PR_APTPL_MAX_TPORT_LEN) {
-                               printk(KERN_ERR "APTPL metadata target_node="
+                               pr_err("APTPL metadata target_node="
                                        " exceeds PR_APTPL_MAX_TPORT_LEN: %d\n",
                                        PR_APTPL_MAX_TPORT_LEN);
                                ret = -EINVAL;
@@ -1583,14 +1583,14 @@ static ssize_t target_core_dev_pr_store_attr_res_aptpl_metadata(
                }
        }
 
-       if (!(i_port) || !(t_port) || !(sa_res_key)) {
-               printk(KERN_ERR "Illegal parameters for APTPL registration\n");
+       if (!i_port || !t_port || !sa_res_key) {
+               pr_err("Illegal parameters for APTPL registration\n");
                ret = -EINVAL;
                goto out;
        }
 
        if (res_holder && !(type)) {
-               printk(KERN_ERR "Illegal PR type: 0x%02x for reservation"
+               pr_err("Illegal PR type: 0x%02x for reservation"
                                " holder\n", type);
                ret = -EINVAL;
                goto out;
@@ -1649,7 +1649,7 @@ static ssize_t target_core_show_dev_info(void *p, char *page)
        int bl = 0;
        ssize_t read_bytes = 0;
 
-       if (!(se_dev->se_dev_ptr))
+       if (!se_dev->se_dev_ptr)
                return -ENODEV;
 
        transport_dump_dev_state(se_dev->se_dev_ptr, page, &bl);
@@ -1675,8 +1675,8 @@ static ssize_t target_core_store_dev_control(
        struct se_hba *hba = se_dev->se_dev_hba;
        struct se_subsystem_api *t = hba->transport;
 
-       if (!(se_dev->se_dev_su_ptr)) {
-               printk(KERN_ERR "Unable to locate struct se_subsystem_dev>se"
+       if (!se_dev->se_dev_su_ptr) {
+               pr_err("Unable to locate struct se_subsystem_dev>se"
                                "_dev_su_ptr\n");
                return -EINVAL;
        }
@@ -1712,7 +1712,7 @@ static ssize_t target_core_store_dev_alias(
        ssize_t read_bytes;
 
        if (count > (SE_DEV_ALIAS_LEN-1)) {
-               printk(KERN_ERR "alias count: %d exceeds"
+               pr_err("alias count: %d exceeds"
                        " SE_DEV_ALIAS_LEN-1: %u\n", (int)count,
                        SE_DEV_ALIAS_LEN-1);
                return -EINVAL;
@@ -1722,7 +1722,7 @@ static ssize_t target_core_store_dev_alias(
        read_bytes = snprintf(&se_dev->se_dev_alias[0], SE_DEV_ALIAS_LEN,
                        "%s", page);
 
-       printk(KERN_INFO "Target_Core_ConfigFS: %s/%s set alias: %s\n",
+       pr_debug("Target_Core_ConfigFS: %s/%s set alias: %s\n",
                config_item_name(&hba->hba_group.cg_item),
                config_item_name(&se_dev->se_dev_group.cg_item),
                se_dev->se_dev_alias);
@@ -1758,7 +1758,7 @@ static ssize_t target_core_store_dev_udev_path(
        ssize_t read_bytes;
 
        if (count > (SE_UDEV_PATH_LEN-1)) {
-               printk(KERN_ERR "udev_path count: %d exceeds"
+               pr_err("udev_path count: %d exceeds"
                        " SE_UDEV_PATH_LEN-1: %u\n", (int)count,
                        SE_UDEV_PATH_LEN-1);
                return -EINVAL;
@@ -1768,7 +1768,7 @@ static ssize_t target_core_store_dev_udev_path(
        read_bytes = snprintf(&se_dev->se_dev_udev_path[0], SE_UDEV_PATH_LEN,
                        "%s", page);
 
-       printk(KERN_INFO "Target_Core_ConfigFS: %s/%s set udev_path: %s\n",
+       pr_debug("Target_Core_ConfigFS: %s/%s set udev_path: %s\n",
                config_item_name(&hba->hba_group.cg_item),
                config_item_name(&se_dev->se_dev_group.cg_item),
                se_dev->se_dev_udev_path);
@@ -1796,13 +1796,13 @@ static ssize_t target_core_store_dev_enable(
        char *ptr;
 
        ptr = strstr(page, "1");
-       if (!(ptr)) {
-               printk(KERN_ERR "For dev_enable ops, only valid value"
+       if (!ptr) {
+               pr_err("For dev_enable ops, only valid value"
                                " is \"1\"\n");
                return -EINVAL;
        }
-       if ((se_dev->se_dev_ptr)) {
-               printk(KERN_ERR "se_dev->se_dev_ptr already set for storage"
+       if (se_dev->se_dev_ptr) {
+               pr_err("se_dev->se_dev_ptr already set for storage"
                                " object\n");
                return -EEXIST;
        }
@@ -1817,7 +1817,7 @@ static ssize_t target_core_store_dev_enable(
                return -EINVAL;
 
        se_dev->se_dev_ptr = dev;
-       printk(KERN_INFO "Target_Core_ConfigFS: Registered se_dev->se_dev_ptr:"
+       pr_debug("Target_Core_ConfigFS: Registered se_dev->se_dev_ptr:"
                " %p\n", se_dev->se_dev_ptr);
 
        return count;
@@ -1841,22 +1841,22 @@ static ssize_t target_core_show_alua_lu_gp(void *p, char *page)
        ssize_t len = 0;
 
        dev = su_dev->se_dev_ptr;
-       if (!(dev))
+       if (!dev)
                return -ENODEV;
 
        if (su_dev->t10_alua.alua_type != SPC3_ALUA_EMULATED)
                return len;
 
        lu_gp_mem = dev->dev_alua_lu_gp_mem;
-       if (!(lu_gp_mem)) {
-               printk(KERN_ERR "NULL struct se_device->dev_alua_lu_gp_mem"
+       if (!lu_gp_mem) {
+               pr_err("NULL struct se_device->dev_alua_lu_gp_mem"
                                " pointer\n");
                return -EINVAL;
        }
 
        spin_lock(&lu_gp_mem->lu_gp_mem_lock);
        lu_gp = lu_gp_mem->lu_gp;
-       if ((lu_gp)) {
+       if (lu_gp) {
                lu_ci = &lu_gp->lu_gp_group.cg_item;
                len += sprintf(page, "LU Group Alias: %s\nLU Group ID: %hu\n",
                        config_item_name(lu_ci), lu_gp->lu_gp_id);
@@ -1880,17 +1880,17 @@ static ssize_t target_core_store_alua_lu_gp(
        int move = 0;
 
        dev = su_dev->se_dev_ptr;
-       if (!(dev))
+       if (!dev)
                return -ENODEV;
 
        if (su_dev->t10_alua.alua_type != SPC3_ALUA_EMULATED) {
-               printk(KERN_WARNING "SPC3_ALUA_EMULATED not enabled for %s/%s\n",
+               pr_warn("SPC3_ALUA_EMULATED not enabled for %s/%s\n",
                        config_item_name(&hba->hba_group.cg_item),
                        config_item_name(&su_dev->se_dev_group.cg_item));
                return -EINVAL;
        }
        if (count > LU_GROUP_NAME_BUF) {
-               printk(KERN_ERR "ALUA LU Group Alias too large!\n");
+               pr_err("ALUA LU Group Alias too large!\n");
                return -EINVAL;
        }
        memset(buf, 0, LU_GROUP_NAME_BUF);
@@ -1906,27 +1906,27 @@ static ssize_t target_core_store_alua_lu_gp(
                 * core_alua_get_lu_gp_by_name below().
                 */
                lu_gp_new = core_alua_get_lu_gp_by_name(strstrip(buf));
-               if (!(lu_gp_new))
+               if (!lu_gp_new)
                        return -ENODEV;
        }
        lu_gp_mem = dev->dev_alua_lu_gp_mem;
-       if (!(lu_gp_mem)) {
+       if (!lu_gp_mem) {
                if (lu_gp_new)
                        core_alua_put_lu_gp_from_name(lu_gp_new);
-               printk(KERN_ERR "NULL struct se_device->dev_alua_lu_gp_mem"
+               pr_err("NULL struct se_device->dev_alua_lu_gp_mem"
                                " pointer\n");
                return -EINVAL;
        }
 
        spin_lock(&lu_gp_mem->lu_gp_mem_lock);
        lu_gp = lu_gp_mem->lu_gp;
-       if ((lu_gp)) {
+       if (lu_gp) {
                /*
                 * Clearing an existing lu_gp association, and replacing
                 * with NULL
                 */
-               if (!(lu_gp_new)) {
-                       printk(KERN_INFO "Target_Core_ConfigFS: Releasing %s/%s"
+               if (!lu_gp_new) {
+                       pr_debug("Target_Core_ConfigFS: Releasing %s/%s"
                                " from ALUA LU Group: core/alua/lu_gps/%s, ID:"
                                " %hu\n",
                                config_item_name(&hba->hba_group.cg_item),
@@ -1951,7 +1951,7 @@ static ssize_t target_core_store_alua_lu_gp(
        __core_alua_attach_lu_gp_mem(lu_gp_mem, lu_gp_new);
        spin_unlock(&lu_gp_mem->lu_gp_mem_lock);
 
-       printk(KERN_INFO "Target_Core_ConfigFS: %s %s/%s to ALUA LU Group:"
+       pr_debug("Target_Core_ConfigFS: %s %s/%s to ALUA LU Group:"
                " core/alua/lu_gps/%s, ID: %hu\n",
                (move) ? "Moving" : "Adding",
                config_item_name(&hba->hba_group.cg_item),
@@ -1995,7 +1995,7 @@ static void target_core_dev_release(struct config_item *item)
         *`echo 1 > $CONFIGFS/core/$HBA/$DEV/dev_enable`
         */
        if (se_dev->se_dev_ptr) {
-               printk(KERN_INFO "Target_Core_ConfigFS: Calling se_free_"
+               pr_debug("Target_Core_ConfigFS: Calling se_free_"
                        "virtual_device() for se_dev_ptr: %p\n",
                        se_dev->se_dev_ptr);
 
@@ -2004,14 +2004,14 @@ static void target_core_dev_release(struct config_item *item)
                /*
                 * Release struct se_subsystem_dev->se_dev_su_ptr..
                 */
-               printk(KERN_INFO "Target_Core_ConfigFS: Calling t->free_"
+               pr_debug("Target_Core_ConfigFS: Calling t->free_"
                        "device() for se_dev_su_ptr: %p\n",
                        se_dev->se_dev_su_ptr);
 
                t->free_device(se_dev->se_dev_su_ptr);
        }
 
-       printk(KERN_INFO "Target_Core_ConfigFS: Deallocating se_subsystem"
+       pr_debug("Target_Core_ConfigFS: Deallocating se_subsystem"
                        "_dev_t: %p\n", se_dev);
        kfree(se_dev);
 }
@@ -2026,7 +2026,7 @@ static ssize_t target_core_dev_show(struct config_item *item,
        struct target_core_configfs_attribute *tc_attr = container_of(
                        attr, struct target_core_configfs_attribute, attr);
 
-       if (!(tc_attr->show))
+       if (!tc_attr->show)
                return -EINVAL;
 
        return tc_attr->show(se_dev, page);
@@ -2042,7 +2042,7 @@ static ssize_t target_core_dev_store(struct config_item *item,
        struct target_core_configfs_attribute *tc_attr = container_of(
                        attr, struct target_core_configfs_attribute, attr);
 
-       if (!(tc_attr->store))
+       if (!tc_attr->store)
                return -EINVAL;
 
        return tc_attr->store(se_dev, page, count);
@@ -2085,7 +2085,7 @@ static ssize_t target_core_alua_lu_gp_show_attr_lu_gp_id(
        struct t10_alua_lu_gp *lu_gp,
        char *page)
 {
-       if (!(lu_gp->lu_gp_valid_id))
+       if (!lu_gp->lu_gp_valid_id)
                return 0;
 
        return sprintf(page, "%hu\n", lu_gp->lu_gp_id);
@@ -2102,12 +2102,12 @@ static ssize_t target_core_alua_lu_gp_store_attr_lu_gp_id(
 
        ret = strict_strtoul(page, 0, &lu_gp_id);
        if (ret < 0) {
-               printk(KERN_ERR "strict_strtoul() returned %d for"
+               pr_err("strict_strtoul() returned %d for"
                        " lu_gp_id\n", ret);
                return -EINVAL;
        }
        if (lu_gp_id > 0x0000ffff) {
-               printk(KERN_ERR "ALUA lu_gp_id: %lu exceeds maximum:"
+               pr_err("ALUA lu_gp_id: %lu exceeds maximum:"
                        " 0x0000ffff\n", lu_gp_id);
                return -EINVAL;
        }
@@ -2116,7 +2116,7 @@ static ssize_t target_core_alua_lu_gp_store_attr_lu_gp_id(
        if (ret < 0)
                return -EINVAL;
 
-       printk(KERN_INFO "Target_Core_ConfigFS: Set ALUA Logical Unit"
+       pr_debug("Target_Core_ConfigFS: Set ALUA Logical Unit"
                " Group: core/alua/lu_gps/%s to ID: %hu\n",
                config_item_name(&alua_lu_gp_cg->cg_item),
                lu_gp->lu_gp_id);
@@ -2154,7 +2154,7 @@ static ssize_t target_core_alua_lu_gp_show_attr_members(
                cur_len++; /* Extra byte for NULL terminator */
 
                if ((cur_len + len) > PAGE_SIZE) {
-                       printk(KERN_WARNING "Ran out of lu_gp_show_attr"
+                       pr_warn("Ran out of lu_gp_show_attr"
                                "_members buffer\n");
                        break;
                }
@@ -2218,7 +2218,7 @@ static struct config_group *target_core_alua_create_lu_gp(
        config_group_init_type_name(alua_lu_gp_cg, name,
                        &target_core_alua_lu_gp_cit);
 
-       printk(KERN_INFO "Target_Core_ConfigFS: Allocated ALUA Logical Unit"
+       pr_debug("Target_Core_ConfigFS: Allocated ALUA Logical Unit"
                " Group: core/alua/lu_gps/%s\n",
                config_item_name(alua_lu_gp_ci));
 
@@ -2233,7 +2233,7 @@ static void target_core_alua_drop_lu_gp(
        struct t10_alua_lu_gp *lu_gp = container_of(to_config_group(item),
                        struct t10_alua_lu_gp, lu_gp_group);
 
-       printk(KERN_INFO "Target_Core_ConfigFS: Releasing ALUA Logical Unit"
+       pr_debug("Target_Core_ConfigFS: Releasing ALUA Logical Unit"
                " Group: core/alua/lu_gps/%s, ID: %hu\n",
                config_item_name(item), lu_gp->lu_gp_id);
        /*
@@ -2292,22 +2292,22 @@ static ssize_t target_core_alua_tg_pt_gp_store_attr_alua_access_state(
        unsigned long tmp;
        int new_state, ret;
 
-       if (!(tg_pt_gp->tg_pt_gp_valid_id)) {
-               printk(KERN_ERR "Unable to do implict ALUA on non valid"
+       if (!tg_pt_gp->tg_pt_gp_valid_id) {
+               pr_err("Unable to do implict ALUA on non valid"
                        " tg_pt_gp ID: %hu\n", tg_pt_gp->tg_pt_gp_valid_id);
                return -EINVAL;
        }
 
        ret = strict_strtoul(page, 0, &tmp);
        if (ret < 0) {
-               printk("Unable to extract new ALUA access state from"
+               pr_err("Unable to extract new ALUA access state from"
                                " %s\n", page);
                return -EINVAL;
        }
        new_state = (int)tmp;
 
        if (!(tg_pt_gp->tg_pt_gp_alua_access_type & TPGS_IMPLICT_ALUA)) {
-               printk(KERN_ERR "Unable to process implict configfs ALUA"
+               pr_err("Unable to process implict configfs ALUA"
                        " transition while TPGS_IMPLICT_ALUA is diabled\n");
                return -EINVAL;
        }
@@ -2338,8 +2338,8 @@ static ssize_t target_core_alua_tg_pt_gp_store_attr_alua_access_status(
        unsigned long tmp;
        int new_status, ret;
 
-       if (!(tg_pt_gp->tg_pt_gp_valid_id)) {
-               printk(KERN_ERR "Unable to do set ALUA access status on non"
+       if (!tg_pt_gp->tg_pt_gp_valid_id) {
+               pr_err("Unable to do set ALUA access status on non"
                        " valid tg_pt_gp ID: %hu\n",
                        tg_pt_gp->tg_pt_gp_valid_id);
                return -EINVAL;
@@ -2347,7 +2347,7 @@ static ssize_t target_core_alua_tg_pt_gp_store_attr_alua_access_status(
 
        ret = strict_strtoul(page, 0, &tmp);
        if (ret < 0) {
-               printk(KERN_ERR "Unable to extract new ALUA access status"
+               pr_err("Unable to extract new ALUA access status"
                                " from %s\n", page);
                return -EINVAL;
        }
@@ -2356,7 +2356,7 @@ static ssize_t target_core_alua_tg_pt_gp_store_attr_alua_access_status(
        if ((new_status != ALUA_STATUS_NONE) &&
            (new_status != ALUA_STATUS_ALTERED_BY_EXPLICT_STPG) &&
            (new_status != ALUA_STATUS_ALTERED_BY_IMPLICT_ALUA)) {
-               printk(KERN_ERR "Illegal ALUA access status: 0x%02x\n",
+               pr_err("Illegal ALUA access status: 0x%02x\n",
                                new_status);
                return -EINVAL;
        }
@@ -2407,12 +2407,12 @@ static ssize_t target_core_alua_tg_pt_gp_store_attr_alua_write_metadata(
 
        ret = strict_strtoul(page, 0, &tmp);
        if (ret < 0) {
-               printk(KERN_ERR "Unable to extract alua_write_metadata\n");
+               pr_err("Unable to extract alua_write_metadata\n");
                return -EINVAL;
        }
 
        if ((tmp != 0) && (tmp != 1)) {
-               printk(KERN_ERR "Illegal value for alua_write_metadata:"
+               pr_err("Illegal value for alua_write_metadata:"
                        " %lu\n", tmp);
                return -EINVAL;
        }
@@ -2494,7 +2494,7 @@ static ssize_t target_core_alua_tg_pt_gp_show_attr_tg_pt_gp_id(
        struct t10_alua_tg_pt_gp *tg_pt_gp,
        char *page)
 {
-       if (!(tg_pt_gp->tg_pt_gp_valid_id))
+       if (!tg_pt_gp->tg_pt_gp_valid_id)
                return 0;
 
        return sprintf(page, "%hu\n", tg_pt_gp->tg_pt_gp_id);
@@ -2511,12 +2511,12 @@ static ssize_t target_core_alua_tg_pt_gp_store_attr_tg_pt_gp_id(
 
        ret = strict_strtoul(page, 0, &tg_pt_gp_id);
        if (ret < 0) {
-               printk(KERN_ERR "strict_strtoul() returned %d for"
+               pr_err("strict_strtoul() returned %d for"
                        " tg_pt_gp_id\n", ret);
                return -EINVAL;
        }
        if (tg_pt_gp_id > 0x0000ffff) {
-               printk(KERN_ERR "ALUA tg_pt_gp_id: %lu exceeds maximum:"
+               pr_err("ALUA tg_pt_gp_id: %lu exceeds maximum:"
                        " 0x0000ffff\n", tg_pt_gp_id);
                return -EINVAL;
        }
@@ -2525,7 +2525,7 @@ static ssize_t target_core_alua_tg_pt_gp_store_attr_tg_pt_gp_id(
        if (ret < 0)
                return -EINVAL;
 
-       printk(KERN_INFO "Target_Core_ConfigFS: Set ALUA Target Port Group: "
+       pr_debug("Target_Core_ConfigFS: Set ALUA Target Port Group: "
                "core/alua/tg_pt_gps/%s to ID: %hu\n",
                config_item_name(&alua_tg_pt_gp_cg->cg_item),
                tg_pt_gp->tg_pt_gp_id);
@@ -2566,7 +2566,7 @@ static ssize_t target_core_alua_tg_pt_gp_show_attr_members(
                cur_len++; /* Extra byte for NULL terminator */
 
                if ((cur_len + len) > PAGE_SIZE) {
-                       printk(KERN_WARNING "Ran out of lu_gp_show_attr"
+                       pr_warn("Ran out of lu_gp_show_attr"
                                "_members buffer\n");
                        break;
                }
@@ -2632,7 +2632,7 @@ static struct config_group *target_core_alua_create_tg_pt_gp(
        struct config_item *alua_tg_pt_gp_ci = NULL;
 
        tg_pt_gp = core_alua_allocate_tg_pt_gp(su_dev, name, 0);
-       if (!(tg_pt_gp))
+       if (!tg_pt_gp)
                return NULL;
 
        alua_tg_pt_gp_cg = &tg_pt_gp->tg_pt_gp_group;
@@ -2641,7 +2641,7 @@ static struct config_group *target_core_alua_create_tg_pt_gp(
        config_group_init_type_name(alua_tg_pt_gp_cg, name,
                        &target_core_alua_tg_pt_gp_cit);
 
-       printk(KERN_INFO "Target_Core_ConfigFS: Allocated ALUA Target Port"
+       pr_debug("Target_Core_ConfigFS: Allocated ALUA Target Port"
                " Group: alua/tg_pt_gps/%s\n",
                config_item_name(alua_tg_pt_gp_ci));
 
@@ -2655,7 +2655,7 @@ static void target_core_alua_drop_tg_pt_gp(
        struct t10_alua_tg_pt_gp *tg_pt_gp = container_of(to_config_group(item),
                        struct t10_alua_tg_pt_gp, tg_pt_gp_group);
 
-       printk(KERN_INFO "Target_Core_ConfigFS: Releasing ALUA Target Port"
+       pr_debug("Target_Core_ConfigFS: Releasing ALUA Target Port"
                " Group: alua/tg_pt_gps/%s, ID: %hu\n",
                config_item_name(item), tg_pt_gp->tg_pt_gp_id);
        /*
@@ -2746,7 +2746,7 @@ static struct config_group *target_core_make_subdev(
 
        se_dev = kzalloc(sizeof(struct se_subsystem_dev), GFP_KERNEL);
        if (!se_dev) {
-               printk(KERN_ERR "Unable to allocate memory for"
+               pr_err("Unable to allocate memory for"
                                " struct se_subsystem_dev\n");
                goto unlock;
        }
@@ -2770,7 +2770,7 @@ static struct config_group *target_core_make_subdev(
 
        dev_cg->default_groups = kzalloc(sizeof(struct config_group) * 7,
                        GFP_KERNEL);
-       if (!(dev_cg->default_groups))
+       if (!dev_cg->default_groups)
                goto out;
        /*
         * Set se_dev_su_ptr from struct se_subsystem_api returned void ptr
@@ -2781,8 +2781,8 @@ static struct config_group *target_core_make_subdev(
         * configfs tree for device object's struct config_group.
         */
        se_dev->se_dev_su_ptr = t->allocate_virtdevice(hba, name);
-       if (!(se_dev->se_dev_su_ptr)) {
-               printk(KERN_ERR "Unable to locate subsystem dependent pointer"
+       if (!se_dev->se_dev_su_ptr) {
+               pr_err("Unable to locate subsystem dependent pointer"
                        " from allocate_virtdevice()\n");
                goto out;
        }
@@ -2813,14 +2813,14 @@ static struct config_group *target_core_make_subdev(
         * Add core/$HBA/$DEV/alua/default_tg_pt_gp
         */
        tg_pt_gp = core_alua_allocate_tg_pt_gp(se_dev, "default_tg_pt_gp", 1);
-       if (!(tg_pt_gp))
+       if (!tg_pt_gp)
                goto out;
 
        tg_pt_gp_cg = &se_dev->t10_alua.alua_tg_pt_gps_group;
        tg_pt_gp_cg->default_groups = kzalloc(sizeof(struct config_group) * 2,
                                GFP_KERNEL);
-       if (!(tg_pt_gp_cg->default_groups)) {
-               printk(KERN_ERR "Unable to allocate tg_pt_gp_cg->"
+       if (!tg_pt_gp_cg->default_groups) {
+               pr_err("Unable to allocate tg_pt_gp_cg->"
                                "default_groups\n");
                goto out;
        }
@@ -2837,12 +2837,12 @@ static struct config_group *target_core_make_subdev(
        dev_stat_grp->default_groups = kzalloc(sizeof(struct config_group) * 4,
                                GFP_KERNEL);
        if (!dev_stat_grp->default_groups) {
-               printk(KERN_ERR "Unable to allocate dev_stat_grp->default_groups\n");
+               pr_err("Unable to allocate dev_stat_grp->default_groups\n");
                goto out;
        }
        target_stat_setup_dev_default_groups(se_dev);
 
-       printk(KERN_INFO "Target_Core_ConfigFS: Allocated struct se_subsystem_dev:"
+       pr_debug("Target_Core_ConfigFS: Allocated struct se_subsystem_dev:"
                " %p se_dev_su_ptr: %p\n", se_dev, se_dev->se_dev_su_ptr);
 
        mutex_unlock(&hba->hba_access_mutex);
@@ -2975,13 +2975,13 @@ static ssize_t target_core_hba_store_attr_hba_mode(struct se_hba *hba,
 
        ret = strict_strtoul(page, 0, &mode_flag);
        if (ret < 0) {
-               printk(KERN_ERR "Unable to extract hba mode flag: %d\n", ret);
+               pr_err("Unable to extract hba mode flag: %d\n", ret);
                return -EINVAL;
        }
 
        spin_lock(&hba->device_lock);
-       if (!(list_empty(&hba->hba_dev_list))) {
-               printk(KERN_ERR "Unable to set hba_mode with active devices\n");
+       if (!list_empty(&hba->hba_dev_list)) {
+               pr_err("Unable to set hba_mode with active devices\n");
                spin_unlock(&hba->device_lock);
                return -EINVAL;
        }
@@ -3040,7 +3040,7 @@ static struct config_group *target_core_call_addhbatotarget(
 
        memset(buf, 0, TARGET_CORE_NAME_MAX_LEN);
        if (strlen(name) >= TARGET_CORE_NAME_MAX_LEN) {
-               printk(KERN_ERR "Passed *name strlen(): %d exceeds"
+               pr_err("Passed *name strlen(): %d exceeds"
                        " TARGET_CORE_NAME_MAX_LEN: %d\n", (int)strlen(name),
                        TARGET_CORE_NAME_MAX_LEN);
                return ERR_PTR(-ENAMETOOLONG);
@@ -3048,8 +3048,8 @@ static struct config_group *target_core_call_addhbatotarget(
        snprintf(buf, TARGET_CORE_NAME_MAX_LEN, "%s", name);
 
        str = strstr(buf, "_");
-       if (!(str)) {
-               printk(KERN_ERR "Unable to locate \"_\" for $SUBSYSTEM_PLUGIN_$HOST_ID\n");
+       if (!str) {
+               pr_err("Unable to locate \"_\" for $SUBSYSTEM_PLUGIN_$HOST_ID\n");
                return ERR_PTR(-EINVAL);
        }
        se_plugin_str = buf;
@@ -3058,7 +3058,7 @@ static struct config_group *target_core_call_addhbatotarget(
         * Namely rd_direct and rd_mcp..
         */
        str2 = strstr(str+1, "_");
-       if ((str2)) {
+       if (str2) {
                *str2 = '\0'; /* Terminate for *se_plugin_str */
                str2++; /* Skip to start of plugin dependent ID */
                str = str2;
@@ -3069,7 +3069,7 @@ static struct config_group *target_core_call_addhbatotarget(
 
        ret = strict_strtoul(str, 0, &plugin_dep_id);
        if (ret < 0) {
-               printk(KERN_ERR "strict_strtoul() returned %d for"
+               pr_err("strict_strtoul() returned %d for"
                                " plugin_dep_id\n", ret);
                return ERR_PTR(-EINVAL);
        }
@@ -3122,7 +3122,7 @@ static int __init target_core_init_configfs(void)
        struct t10_alua_lu_gp *lu_gp;
        int ret;
 
-       printk(KERN_INFO "TARGET_CORE[0]: Loading Generic Kernel Storage"
+       pr_debug("TARGET_CORE[0]: Loading Generic Kernel Storage"
                " Engine: %s on %s/%s on "UTS_RELEASE"\n",
                TARGET_CORE_VERSION, utsname()->sysname, utsname()->machine);
 
@@ -3142,8 +3142,8 @@ static int __init target_core_init_configfs(void)
        target_cg = &subsys->su_group;
        target_cg->default_groups = kzalloc(sizeof(struct config_group) * 2,
                                GFP_KERNEL);
-       if (!(target_cg->default_groups)) {
-               printk(KERN_ERR "Unable to allocate target_cg->default_groups\n");
+       if (!target_cg->default_groups) {
+               pr_err("Unable to allocate target_cg->default_groups\n");
                goto out_global;
        }
 
@@ -3157,8 +3157,8 @@ static int __init target_core_init_configfs(void)
        hba_cg = &target_core_hbagroup;
        hba_cg->default_groups = kzalloc(sizeof(struct config_group) * 2,
                                GFP_KERNEL);
-       if (!(hba_cg->default_groups)) {
-               printk(KERN_ERR "Unable to allocate hba_cg->default_groups\n");
+       if (!hba_cg->default_groups) {
+               pr_err("Unable to allocate hba_cg->default_groups\n");
                goto out_global;
        }
        config_group_init_type_name(&alua_group,
@@ -3172,8 +3172,8 @@ static int __init target_core_init_configfs(void)
        alua_cg = &alua_group;
        alua_cg->default_groups = kzalloc(sizeof(struct config_group) * 2,
                        GFP_KERNEL);
-       if (!(alua_cg->default_groups)) {
-               printk(KERN_ERR "Unable to allocate alua_cg->default_groups\n");
+       if (!alua_cg->default_groups) {
+               pr_err("Unable to allocate alua_cg->default_groups\n");
                goto out_global;
        }
 
@@ -3191,8 +3191,8 @@ static int __init target_core_init_configfs(void)
        lu_gp_cg = &alua_lu_gps_group;
        lu_gp_cg->default_groups = kzalloc(sizeof(struct config_group) * 2,
                        GFP_KERNEL);
-       if (!(lu_gp_cg->default_groups)) {
-               printk(KERN_ERR "Unable to allocate lu_gp_cg->default_groups\n");
+       if (!lu_gp_cg->default_groups) {
+               pr_err("Unable to allocate lu_gp_cg->default_groups\n");
                goto out_global;
        }
 
@@ -3206,11 +3206,11 @@ static int __init target_core_init_configfs(void)
         */
        ret = configfs_register_subsystem(subsys);
        if (ret < 0) {
-               printk(KERN_ERR "Error %d while registering subsystem %s\n",
+               pr_err("Error %d while registering subsystem %s\n",
                        ret, subsys->su_group.cg_item.ci_namebuf);
                goto out_global;
        }
-       printk(KERN_INFO "TARGET_CORE[0]: Initialized ConfigFS Fabric"
+       pr_debug("TARGET_CORE[0]: Initialized ConfigFS Fabric"
                " Infrastructure: "TARGET_CORE_CONFIGFS_VERSION" on %s/%s"
                " on "UTS_RELEASE"\n", utsname()->sysname, utsname()->machine);
        /*
@@ -3290,7 +3290,7 @@ static void __exit target_core_exit_configfs(void)
        core_alua_free_lu_gp(default_lu_gp);
        default_lu_gp = NULL;
 
-       printk(KERN_INFO "TARGET_CORE[0]: Released ConfigFS Fabric"
+       pr_debug("TARGET_CORE[0]: Released ConfigFS Fabric"
                        " Infrastructure\n");
 
        core_dev_release_virtual_lun0();
index 1185c3b..81860dd 100644 (file)
@@ -84,7 +84,7 @@ int transport_lookup_cmd_lun(struct se_cmd *se_cmd, u32 unpacked_lun)
                    (deve->lun_flags & TRANSPORT_LUNFLAGS_READ_ONLY)) {
                        se_cmd->scsi_sense_reason = TCM_WRITE_PROTECTED;
                        se_cmd->se_cmd_flags |= SCF_SCSI_CDB_EXCEPTION;
-                       printk("TARGET_CORE[%s]: Detected WRITE_PROTECTED LUN"
+                       pr_err("TARGET_CORE[%s]: Detected WRITE_PROTECTED LUN"
                                " Access for 0x%08x\n",
                                se_cmd->se_tfo->get_fabric_name(),
                                unpacked_lun);
@@ -117,7 +117,7 @@ int transport_lookup_cmd_lun(struct se_cmd *se_cmd, u32 unpacked_lun)
                if (unpacked_lun != 0) {
                        se_cmd->scsi_sense_reason = TCM_NON_EXISTENT_LUN;
                        se_cmd->se_cmd_flags |= SCF_SCSI_CDB_EXCEPTION;
-                       printk("TARGET_CORE[%s]: Detected NON_EXISTENT_LUN"
+                       pr_err("TARGET_CORE[%s]: Detected NON_EXISTENT_LUN"
                                " Access for 0x%08x\n",
                                se_cmd->se_tfo->get_fabric_name(),
                                unpacked_lun);
@@ -204,7 +204,7 @@ int transport_lookup_tmr_lun(struct se_cmd *se_cmd, u32 unpacked_lun)
        spin_unlock_irqrestore(&se_sess->se_node_acl->device_list_lock, flags);
 
        if (!se_lun) {
-               printk(KERN_INFO "TARGET_CORE[%s]: Detected NON_EXISTENT_LUN"
+               pr_debug("TARGET_CORE[%s]: Detected NON_EXISTENT_LUN"
                        " Access for 0x%08x\n",
                        se_cmd->se_tfo->get_fabric_name(),
                        unpacked_lun);
@@ -255,15 +255,15 @@ struct se_dev_entry *core_get_se_deve_from_rtpi(
                        continue;
 
                lun = deve->se_lun;
-               if (!(lun)) {
-                       printk(KERN_ERR "%s device entries device pointer is"
+               if (!lun) {
+                       pr_err("%s device entries device pointer is"
                                " NULL, but Initiator has access.\n",
                                tpg->se_tpg_tfo->get_fabric_name());
                        continue;
                }
                port = lun->lun_sep;
-               if (!(port)) {
-                       printk(KERN_ERR "%s device entries device pointer is"
+               if (!port) {
+                       pr_err("%s device entries device pointer is"
                                " NULL, but Initiator has access.\n",
                                tpg->se_tpg_tfo->get_fabric_name());
                        continue;
@@ -301,7 +301,7 @@ int core_free_device_list_for_node(
                        continue;
 
                if (!deve->se_lun) {
-                       printk(KERN_ERR "%s device entries device pointer is"
+                       pr_err("%s device entries device pointer is"
                                " NULL, but Initiator has access.\n",
                                tpg->se_tpg_tfo->get_fabric_name());
                        continue;
@@ -372,7 +372,7 @@ int core_update_device_list_for_node(
         * struct se_dev_entry pointers below as logic in
         * core_alua_do_transition_tg_pt() depends on these being present.
         */
-       if (!(enable)) {
+       if (!enable) {
                /*
                 * deve->se_lun_acl will be NULL for demo-mode created LUNs
                 * that have not been explicitly concerted to MappedLUNs ->
@@ -395,14 +395,14 @@ int core_update_device_list_for_node(
                 */
                if (deve->lun_flags & TRANSPORT_LUNFLAGS_INITIATOR_ACCESS) {
                        if (deve->se_lun_acl != NULL) {
-                               printk(KERN_ERR "struct se_dev_entry->se_lun_acl"
+                               pr_err("struct se_dev_entry->se_lun_acl"
                                        " already set for demo mode -> explict"
                                        " LUN ACL transition\n");
                                spin_unlock_irq(&nacl->device_list_lock);
                                return -EINVAL;
                        }
                        if (deve->se_lun != lun) {
-                               printk(KERN_ERR "struct se_dev_entry->se_lun does"
+                               pr_err("struct se_dev_entry->se_lun does"
                                        " match passed struct se_lun for demo mode"
                                        " -> explict LUN ACL transition\n");
                                spin_unlock_irq(&nacl->device_list_lock);
@@ -501,8 +501,8 @@ static struct se_port *core_alloc_port(struct se_device *dev)
        struct se_port *port, *port_tmp;
 
        port = kzalloc(sizeof(struct se_port), GFP_KERNEL);
-       if (!(port)) {
-               printk(KERN_ERR "Unable to allocate struct se_port\n");
+       if (!port) {
+               pr_err("Unable to allocate struct se_port\n");
                return ERR_PTR(-ENOMEM);
        }
        INIT_LIST_HEAD(&port->sep_alua_list);
@@ -513,7 +513,7 @@ static struct se_port *core_alloc_port(struct se_device *dev)
 
        spin_lock(&dev->se_port_lock);
        if (dev->dev_port_count == 0x0000ffff) {
-               printk(KERN_WARNING "Reached dev->dev_port_count =="
+               pr_warn("Reached dev->dev_port_count =="
                                " 0x0000ffff\n");
                spin_unlock(&dev->se_port_lock);
                return ERR_PTR(-ENOSPC);
@@ -532,7 +532,7 @@ again:
         * 3h to FFFFh    Relative port 3 through 65 535
         */
        port->sep_rtpi = dev->dev_rpti_counter++;
-       if (!(port->sep_rtpi))
+       if (!port->sep_rtpi)
                goto again;
 
        list_for_each_entry(port_tmp, &dev->dev_sep_list, sep_list) {
@@ -570,7 +570,7 @@ static void core_export_port(
        if (su_dev->t10_alua.alua_type == SPC3_ALUA_EMULATED) {
                tg_pt_gp_mem = core_alua_allocate_tg_pt_gp_mem(port);
                if (IS_ERR(tg_pt_gp_mem) || !tg_pt_gp_mem) {
-                       printk(KERN_ERR "Unable to allocate t10_alua_tg_pt"
+                       pr_err("Unable to allocate t10_alua_tg_pt"
                                        "_gp_member_t\n");
                        return;
                }
@@ -578,7 +578,7 @@ static void core_export_port(
                __core_alua_attach_tg_pt_gp_mem(tg_pt_gp_mem,
                        su_dev->t10_alua.default_tg_pt_gp);
                spin_unlock(&tg_pt_gp_mem->tg_pt_gp_mem_lock);
-               printk(KERN_INFO "%s/%s: Adding to default ALUA Target Port"
+               pr_debug("%s/%s: Adding to default ALUA Target Port"
                        " Group: alua/default_tg_pt_gp\n",
                        dev->transport->name, tpg->se_tpg_tfo->get_fabric_name());
        }
@@ -663,8 +663,8 @@ int transport_core_report_lun_response(struct se_cmd *se_cmd)
        list_for_each_entry(se_task, &se_cmd->t_task_list, t_list)
                break;
 
-       if (!(se_task)) {
-               printk(KERN_ERR "Unable to locate struct se_task for struct se_cmd\n");
+       if (!se_task) {
+               pr_err("Unable to locate struct se_task for struct se_cmd\n");
                return PYX_TRANSPORT_LU_COMM_FAILURE;
        }
 
@@ -675,7 +675,7 @@ int transport_core_report_lun_response(struct se_cmd *se_cmd)
         * coming via a target_core_mod PASSTHROUGH op, and not through
         * a $FABRIC_MOD.  In that case, report LUN=0 only.
         */
-       if (!(se_sess)) {
+       if (!se_sess) {
                int_to_scsilun(0, (struct scsi_lun *)&buf[offset]);
                lun_count = 1;
                goto done;
@@ -893,12 +893,12 @@ void se_dev_set_default_attribs(
 int se_dev_set_task_timeout(struct se_device *dev, u32 task_timeout)
 {
        if (task_timeout > DA_TASK_TIMEOUT_MAX) {
-               printk(KERN_ERR "dev[%p]: Passed task_timeout: %u larger then"
+               pr_err("dev[%p]: Passed task_timeout: %u larger then"
                        " DA_TASK_TIMEOUT_MAX\n", dev, task_timeout);
                return -EINVAL;
        } else {
                dev->se_sub_dev->se_dev_attrib.task_timeout = task_timeout;
-               printk(KERN_INFO "dev[%p]: Set SE Device task_timeout: %u\n",
+               pr_debug("dev[%p]: Set SE Device task_timeout: %u\n",
                        dev, task_timeout);
        }
 
@@ -910,7 +910,7 @@ int se_dev_set_max_unmap_lba_count(
        u32 max_unmap_lba_count)
 {
        dev->se_sub_dev->se_dev_attrib.max_unmap_lba_count = max_unmap_lba_count;
-       printk(KERN_INFO "dev[%p]: Set max_unmap_lba_count: %u\n",
+       pr_debug("dev[%p]: Set max_unmap_lba_count: %u\n",
                        dev, dev->se_sub_dev->se_dev_attrib.max_unmap_lba_count);
        return 0;
 }
@@ -921,7 +921,7 @@ int se_dev_set_max_unmap_block_desc_count(
 {
        dev->se_sub_dev->se_dev_attrib.max_unmap_block_desc_count =
                max_unmap_block_desc_count;
-       printk(KERN_INFO "dev[%p]: Set max_unmap_block_desc_count: %u\n",
+       pr_debug("dev[%p]: Set max_unmap_block_desc_count: %u\n",
                        dev, dev->se_sub_dev->se_dev_attrib.max_unmap_block_desc_count);
        return 0;
 }
@@ -931,7 +931,7 @@ int se_dev_set_unmap_granularity(
        u32 unmap_granularity)
 {
        dev->se_sub_dev->se_dev_attrib.unmap_granularity = unmap_granularity;
-       printk(KERN_INFO "dev[%p]: Set unmap_granularity: %u\n",
+       pr_debug("dev[%p]: Set unmap_granularity: %u\n",
                        dev, dev->se_sub_dev->se_dev_attrib.unmap_granularity);
        return 0;
 }
@@ -941,7 +941,7 @@ int se_dev_set_unmap_granularity_alignment(
        u32 unmap_granularity_alignment)
 {
        dev->se_sub_dev->se_dev_attrib.unmap_granularity_alignment = unmap_granularity_alignment;
-       printk(KERN_INFO "dev[%p]: Set unmap_granularity_alignment: %u\n",
+       pr_debug("dev[%p]: Set unmap_granularity_alignment: %u\n",
                        dev, dev->se_sub_dev->se_dev_attrib.unmap_granularity_alignment);
        return 0;
 }
@@ -949,19 +949,19 @@ int se_dev_set_unmap_granularity_alignment(
 int se_dev_set_emulate_dpo(struct se_device *dev, int flag)
 {
        if ((flag != 0) && (flag != 1)) {
-               printk(KERN_ERR "Illegal value %d\n", flag);
+               pr_err("Illegal value %d\n", flag);
                return -EINVAL;
        }
        if (dev->transport->dpo_emulated == NULL) {
-               printk(KERN_ERR "dev->transport->dpo_emulated is NULL\n");
+               pr_err("dev->transport->dpo_emulated is NULL\n");
                return -EINVAL;
        }
        if (dev->transport->dpo_emulated(dev) == 0) {
-               printk(KERN_ERR "dev->transport->dpo_emulated not supported\n");
+               pr_err("dev->transport->dpo_emulated not supported\n");
                return -EINVAL;
        }
        dev->se_sub_dev->se_dev_attrib.emulate_dpo = flag;
-       printk(KERN_INFO "dev[%p]: SE Device Page Out (DPO) Emulation"
+       pr_debug("dev[%p]: SE Device Page Out (DPO) Emulation"
                        " bit: %d\n", dev, dev->se_sub_dev->se_dev_attrib.emulate_dpo);
        return 0;
 }
@@ -969,19 +969,19 @@ int se_dev_set_emulate_dpo(struct se_device *dev, int flag)
 int se_dev_set_emulate_fua_write(struct se_device *dev, int flag)
 {
        if ((flag != 0) && (flag != 1)) {
-               printk(KERN_ERR "Illegal value %d\n", flag);
+               pr_err("Illegal value %d\n", flag);
                return -EINVAL;
        }
        if (dev->transport->fua_write_emulated == NULL) {
-               printk(KERN_ERR "dev->transport->fua_write_emulated is NULL\n");
+               pr_err("dev->transport->fua_write_emulated is NULL\n");
                return -EINVAL;
        }
        if (dev->transport->fua_write_emulated(dev) == 0) {
-               printk(KERN_ERR "dev->transport->fua_write_emulated not supported\n");
+               pr_err("dev->transport->fua_write_emulated not supported\n");
                return -EINVAL;
        }
        dev->se_sub_dev->se_dev_attrib.emulate_fua_write = flag;
-       printk(KERN_INFO "dev[%p]: SE Device Forced Unit Access WRITEs: %d\n",
+       pr_debug("dev[%p]: SE Device Forced Unit Access WRITEs: %d\n",
                        dev, dev->se_sub_dev->se_dev_attrib.emulate_fua_write);
        return 0;
 }
@@ -989,19 +989,19 @@ int se_dev_set_emulate_fua_write(struct se_device *dev, int flag)
 int se_dev_set_emulate_fua_read(struct se_device *dev, int flag)
 {
        if ((flag != 0) && (flag != 1)) {
-               printk(KERN_ERR "Illegal value %d\n", flag);
+               pr_err("Illegal value %d\n", flag);
                return -EINVAL;
        }
        if (dev->transport->fua_read_emulated == NULL) {
-               printk(KERN_ERR "dev->transport->fua_read_emulated is NULL\n");
+               pr_err("dev->transport->fua_read_emulated is NULL\n");
                return -EINVAL;
        }
        if (dev->transport->fua_read_emulated(dev) == 0) {
-               printk(KERN_ERR "dev->transport->fua_read_emulated not supported\n");
+               pr_err("dev->transport->fua_read_emulated not supported\n");
                return -EINVAL;
        }
        dev->se_sub_dev->se_dev_attrib.emulate_fua_read = flag;
-       printk(KERN_INFO "dev[%p]: SE Device Forced Unit Access READs: %d\n",
+       pr_debug("dev[%p]: SE Device Forced Unit Access READs: %d\n",
                        dev, dev->se_sub_dev->se_dev_attrib.emulate_fua_read);
        return 0;
 }
@@ -1009,19 +1009,19 @@ int se_dev_set_emulate_fua_read(struct se_device *dev, int flag)
 int se_dev_set_emulate_write_cache(struct se_device *dev, int flag)
 {
        if ((flag != 0) && (flag != 1)) {
-               printk(KERN_ERR "Illegal value %d\n", flag);
+               pr_err("Illegal value %d\n", flag);
                return -EINVAL;
        }
        if (dev->transport->write_cache_emulated == NULL) {
-               printk(KERN_ERR "dev->transport->write_cache_emulated is NULL\n");
+               pr_err("dev->transport->write_cache_emulated is NULL\n");
                return -EINVAL;
        }
        if (dev->transport->write_cache_emulated(dev) == 0) {
-               printk(KERN_ERR "dev->transport->write_cache_emulated not supported\n");
+               pr_err("dev->transport->write_cache_emulated not supported\n");
                return -EINVAL;
        }
        dev->se_sub_dev->se_dev_attrib.emulate_write_cache = flag;
-       printk(KERN_INFO "dev[%p]: SE Device WRITE_CACHE_EMULATION flag: %d\n",
+       pr_debug("dev[%p]: SE Device WRITE_CACHE_EMULATION flag: %d\n",
                        dev, dev->se_sub_dev->se_dev_attrib.emulate_write_cache);
        return 0;
 }
@@ -1029,19 +1029,19 @@ int se_dev_set_emulate_write_cache(struct se_device *dev, int flag)
 int se_dev_set_emulate_ua_intlck_ctrl(struct se_device *dev, int flag)
 {
        if ((flag != 0) && (flag != 1) && (flag != 2)) {
-               printk(KERN_ERR "Illegal value %d\n", flag);
+               pr_err("Illegal value %d\n", flag);
                return -EINVAL;
        }
 
        if (atomic_read(&dev->dev_export_obj.obj_access_count)) {
-               printk(KERN_ERR "dev[%p]: Unable to change SE Device"
+               pr_err("dev[%p]: Unable to change SE Device"
                        " UA_INTRLCK_CTRL while dev_export_obj: %d count"
                        " exists\n", dev,
                        atomic_read(&dev->dev_export_obj.obj_access_count));
                return -EINVAL;
        }
        dev->se_sub_dev->se_dev_attrib.emulate_ua_intlck_ctrl = flag;
-       printk(KERN_INFO "dev[%p]: SE Device UA_INTRLCK_CTRL flag: %d\n",
+       pr_debug("dev[%p]: SE Device UA_INTRLCK_CTRL flag: %d\n",
                dev, dev->se_sub_dev->se_dev_attrib.emulate_ua_intlck_ctrl);
 
        return 0;
@@ -1050,18 +1050,18 @@ int se_dev_set_emulate_ua_intlck_ctrl(struct se_device *dev, int flag)
 int se_dev_set_emulate_tas(struct se_device *dev, int flag)
 {
        if ((flag != 0) && (flag != 1)) {
-               printk(KERN_ERR "Illegal value %d\n", flag);
+               pr_err("Illegal value %d\n", flag);
                return -EINVAL;
        }
 
        if (atomic_read(&dev->dev_export_obj.obj_access_count)) {
-               printk(KERN_ERR "dev[%p]: Unable to change SE Device TAS while"
+               pr_err("dev[%p]: Unable to change SE Device TAS while"
                        " dev_export_obj: %d count exists\n", dev,
                        atomic_read(&dev->dev_export_obj.obj_access_count));
                return -EINVAL;
        }
        dev->se_sub_dev->se_dev_attrib.emulate_tas = flag;
-       printk(KERN_INFO "dev[%p]: SE Device TASK_ABORTED status bit: %s\n",
+       pr_debug("dev[%p]: SE Device TASK_ABORTED status bit: %s\n",
                dev, (dev->se_sub_dev->se_dev_attrib.emulate_tas) ? "Enabled" : "Disabled");
 
        return 0;
@@ -1070,20 +1070,20 @@ int se_dev_set_emulate_tas(struct se_device *dev, int flag)
 int se_dev_set_emulate_tpu(struct se_device *dev, int flag)
 {
        if ((flag != 0) && (flag != 1)) {
-               printk(KERN_ERR "Illegal value %d\n", flag);
+               pr_err("Illegal value %d\n", flag);
                return -EINVAL;
        }
        /*
         * We expect this value to be non-zero when generic Block Layer
         * Discard supported is detected iblock_create_virtdevice().
         */
-       if (!(dev->se_sub_dev->se_dev_attrib.max_unmap_block_desc_count)) {
-               printk(KERN_ERR "Generic Block Discard not supported\n");
+       if (!dev->se_sub_dev->se_dev_attrib.max_unmap_block_desc_count) {
+               pr_err("Generic Block Discard not supported\n");
                return -ENOSYS;
        }
 
        dev->se_sub_dev->se_dev_attrib.emulate_tpu = flag;
-       printk(KERN_INFO "dev[%p]: SE Device Thin Provisioning UNMAP bit: %d\n",
+       pr_debug("dev[%p]: SE Device Thin Provisioning UNMAP bit: %d\n",
                                dev, flag);
        return 0;
 }
@@ -1091,20 +1091,20 @@ int se_dev_set_emulate_tpu(struct se_device *dev, int flag)
 int se_dev_set_emulate_tpws(struct se_device *dev, int flag)
 {
        if ((flag != 0) && (flag != 1)) {
-               printk(KERN_ERR "Illegal value %d\n", flag);
+               pr_err("Illegal value %d\n", flag);
                return -EINVAL;
        }
        /*
         * We expect this value to be non-zero when generic Block Layer
         * Discard supported is detected iblock_create_virtdevice().
         */
-       if (!(dev->se_sub_dev->se_dev_attrib.max_unmap_block_desc_count)) {
-               printk(KERN_ERR "Generic Block Discard not supported\n");
+       if (!dev->se_sub_dev->se_dev_attrib.max_unmap_block_desc_count) {
+               pr_err("Generic Block Discard not supported\n");
                return -ENOSYS;
        }
 
        dev->se_sub_dev->se_dev_attrib.emulate_tpws = flag;
-       printk(KERN_INFO "dev[%p]: SE Device Thin Provisioning WRITE_SAME: %d\n",
+       pr_debug("dev[%p]: SE Device Thin Provisioning WRITE_SAME: %d\n",
                                dev, flag);
        return 0;
 }
@@ -1112,11 +1112,11 @@ int se_dev_set_emulate_tpws(struct se_device *dev, int flag)
 int se_dev_set_enforce_pr_isids(struct se_device *dev, int flag)
 {
        if ((flag != 0) && (flag != 1)) {
-               printk(KERN_ERR "Illegal value %d\n", flag);
+               pr_err("Illegal value %d\n", flag);
                return -EINVAL;
        }
        dev->se_sub_dev->se_dev_attrib.enforce_pr_isids = flag;
-       printk(KERN_INFO "dev[%p]: SE Device enforce_pr_isids bit: %s\n", dev,
+       pr_debug("dev[%p]: SE Device enforce_pr_isids bit: %s\n", dev,
                (dev->se_sub_dev->se_dev_attrib.enforce_pr_isids) ? "Enabled" : "Disabled");
        return 0;
 }
@@ -1141,20 +1141,20 @@ int se_dev_set_queue_depth(struct se_device *dev, u32 queue_depth)
        u32 orig_queue_depth = dev->queue_depth;
 
        if (atomic_read(&dev->dev_export_obj.obj_access_count)) {
-               printk(KERN_ERR "dev[%p]: Unable to change SE Device TCQ while"
+               pr_err("dev[%p]: Unable to change SE Device TCQ while"
                        " dev_export_obj: %d count exists\n", dev,
                        atomic_read(&dev->dev_export_obj.obj_access_count));
                return -EINVAL;
        }
-       if (!(queue_depth)) {
-               printk(KERN_ERR "dev[%p]: Illegal ZERO value for queue"
+       if (!queue_depth) {
+               pr_err("dev[%p]: Illegal ZERO value for queue"
                        "_depth\n", dev);
                return -EINVAL;
        }
 
        if (dev->transport->transport_type == TRANSPORT_PLUGIN_PHBA_PDEV) {
                if (queue_depth > dev->se_sub_dev->se_dev_attrib.hw_queue_depth) {
-                       printk(KERN_ERR "dev[%p]: Passed queue_depth: %u"
+                       pr_err("dev[%p]: Passed queue_depth: %u"
                                " exceeds TCM/SE_Device TCQ: %u\n",
                                dev, queue_depth,
                                dev->se_sub_dev->se_dev_attrib.hw_queue_depth);
@@ -1163,7 +1163,7 @@ int se_dev_set_queue_depth(struct se_device *dev, u32 queue_depth)
        } else {
                if (queue_depth > dev->se_sub_dev->se_dev_attrib.queue_depth) {
                        if (queue_depth > dev->se_sub_dev->se_dev_attrib.hw_queue_depth) {
-                               printk(KERN_ERR "dev[%p]: Passed queue_depth:"
+                               pr_err("dev[%p]: Passed queue_depth:"
                                        " %u exceeds TCM/SE_Device MAX"
                                        " TCQ: %u\n", dev, queue_depth,
                                        dev->se_sub_dev->se_dev_attrib.hw_queue_depth);
@@ -1178,7 +1178,7 @@ int se_dev_set_queue_depth(struct se_device *dev, u32 queue_depth)
        else if (queue_depth < orig_queue_depth)
                atomic_sub(orig_queue_depth - queue_depth, &dev->depth_left);
 
-       printk(KERN_INFO "dev[%p]: SE Device TCQ Depth changed to: %u\n",
+       pr_debug("dev[%p]: SE Device TCQ Depth changed to: %u\n",
                        dev, queue_depth);
        return 0;
 }
@@ -1188,41 +1188,41 @@ int se_dev_set_max_sectors(struct se_device *dev, u32 max_sectors)
        int force = 0; /* Force setting for VDEVS */
 
        if (atomic_read(&dev->dev_export_obj.obj_access_count)) {
-               printk(KERN_ERR "dev[%p]: Unable to change SE Device"
+               pr_err("dev[%p]: Unable to change SE Device"
                        " max_sectors while dev_export_obj: %d count exists\n",
                        dev, atomic_read(&dev->dev_export_obj.obj_access_count));
                return -EINVAL;
        }
-       if (!(max_sectors)) {
-               printk(KERN_ERR "dev[%p]: Illegal ZERO value for"
+       if (!max_sectors) {
+               pr_err("dev[%p]: Illegal ZERO value for"
                        " max_sectors\n", dev);
                return -EINVAL;
        }
        if (max_sectors < DA_STATUS_MAX_SECTORS_MIN) {
-               printk(KERN_ERR "dev[%p]: Passed max_sectors: %u less than"
+               pr_err("dev[%p]: Passed max_sectors: %u less than"
                        " DA_STATUS_MAX_SECTORS_MIN: %u\n", dev, max_sectors,
                                DA_STATUS_MAX_SECTORS_MIN);
                return -EINVAL;
        }
        if (dev->transport->transport_type == TRANSPORT_PLUGIN_PHBA_PDEV) {
                if (max_sectors > dev->se_sub_dev->se_dev_attrib.hw_max_sectors) {
-                       printk(KERN_ERR "dev[%p]: Passed max_sectors: %u"
+                       pr_err("dev[%p]: Passed max_sectors: %u"
                                " greater than TCM/SE_Device max_sectors:"
                                " %u\n", dev, max_sectors,
                                dev->se_sub_dev->se_dev_attrib.hw_max_sectors);
                         return -EINVAL;
                }
        } else {
-               if (!(force) && (max_sectors >
+               if (!force && (max_sectors >
                                 dev->se_sub_dev->se_dev_attrib.hw_max_sectors)) {
-                       printk(KERN_ERR "dev[%p]: Passed max_sectors: %u"
+                       pr_err("dev[%p]: Passed max_sectors: %u"
                                " greater than TCM/SE_Device max_sectors"
                                ": %u, use force=1 to override.\n", dev,
                                max_sectors, dev->se_sub_dev->se_dev_attrib.hw_max_sectors);
                        return -EINVAL;
                }
                if (max_sectors > DA_STATUS_MAX_SECTORS_MAX) {
-                       printk(KERN_ERR "dev[%p]: Passed max_sectors: %u"
+                       pr_err("dev[%p]: Passed max_sectors: %u"
                                " greater than DA_STATUS_MAX_SECTORS_MAX:"
                                " %u\n", dev, max_sectors,
                                DA_STATUS_MAX_SECTORS_MAX);
@@ -1231,7 +1231,7 @@ int se_dev_set_max_sectors(struct se_device *dev, u32 max_sectors)
        }
 
        dev->se_sub_dev->se_dev_attrib.max_sectors = max_sectors;
-       printk("dev[%p]: SE Device max_sectors changed to %u\n",
+       pr_debug("dev[%p]: SE Device max_sectors changed to %u\n",
                        dev, max_sectors);
        return 0;
 }
@@ -1239,25 +1239,25 @@ int se_dev_set_max_sectors(struct se_device *dev, u32 max_sectors)
 int se_dev_set_optimal_sectors(struct se_device *dev, u32 optimal_sectors)
 {
        if (atomic_read(&dev->dev_export_obj.obj_access_count)) {
-               printk(KERN_ERR "dev[%p]: Unable to change SE Device"
+               pr_err("dev[%p]: Unable to change SE Device"
                        " optimal_sectors while dev_export_obj: %d count exists\n",
                        dev, atomic_read(&dev->dev_export_obj.obj_access_count));
                return -EINVAL;
        }
        if (dev->transport->transport_type == TRANSPORT_PLUGIN_PHBA_PDEV) {
-               printk(KERN_ERR "dev[%p]: Passed optimal_sectors cannot be"
+               pr_err("dev[%p]: Passed optimal_sectors cannot be"
                                " changed for TCM/pSCSI\n", dev);
                return -EINVAL;
        }
        if (optimal_sectors > dev->se_sub_dev->se_dev_attrib.max_sectors) {
-               printk(KERN_ERR "dev[%p]: Passed optimal_sectors %u cannot be"
+               pr_err("dev[%p]: Passed optimal_sectors %u cannot be"
                        " greater than max_sectors: %u\n", dev,
                        optimal_sectors, dev->se_sub_dev->se_dev_attrib.max_sectors);
                return -EINVAL;
        }
 
        dev->se_sub_dev->se_dev_attrib.optimal_sectors = optimal_sectors;
-       printk(KERN_INFO "dev[%p]: SE Device optimal_sectors changed to %u\n",
+       pr_debug("dev[%p]: SE Device optimal_sectors changed to %u\n",
                        dev, optimal_sectors);
        return 0;
 }
@@ -1265,7 +1265,7 @@ int se_dev_set_optimal_sectors(struct se_device *dev, u32 optimal_sectors)
 int se_dev_set_block_size(struct se_device *dev, u32 block_size)
 {
        if (atomic_read(&dev->dev_export_obj.obj_access_count)) {
-               printk(KERN_ERR "dev[%p]: Unable to change SE Device block_size"
+               pr_err("dev[%p]: Unable to change SE Device block_size"
                        " while dev_export_obj: %d count exists\n", dev,
                        atomic_read(&dev->dev_export_obj.obj_access_count));
                return -EINVAL;
@@ -1275,21 +1275,21 @@ int se_dev_set_block_size(struct se_device *dev, u32 block_size)
            (block_size != 1024) &&
            (block_size != 2048) &&
            (block_size != 4096)) {
-               printk(KERN_ERR "dev[%p]: Illegal value for block_device: %u"
+               pr_err("dev[%p]: Illegal value for block_device: %u"
                        " for SE device, must be 512, 1024, 2048 or 4096\n",
                        dev, block_size);
                return -EINVAL;
        }
 
        if (dev->transport->transport_type == TRANSPORT_PLUGIN_PHBA_PDEV) {
-               printk(KERN_ERR "dev[%p]: Not allowed to change block_size for"
+               pr_err("dev[%p]: Not allowed to change block_size for"
                        " Physical Device, use for Linux/SCSI to change"
                        " block_size for underlying hardware\n", dev);
                return -EINVAL;
        }
 
        dev->se_sub_dev->se_dev_attrib.block_size = block_size;
-       printk(KERN_INFO "dev[%p]: SE Device block_size changed to %u\n",
+       pr_debug("dev[%p]: SE Device block_size changed to %u\n",
                        dev, block_size);
        return 0;
 }
@@ -1304,13 +1304,13 @@ struct se_lun *core_dev_add_lun(
        u32 lun_access = 0;
 
        if (atomic_read(&dev->dev_access_obj.obj_access_count) != 0) {
-               printk(KERN_ERR "Unable to export struct se_device while dev_access_obj: %d\n",
+               pr_err("Unable to export struct se_device while dev_access_obj: %d\n",
                        atomic_read(&dev->dev_access_obj.obj_access_count));
                return NULL;
        }
 
        lun_p = core_tpg_pre_addlun(tpg, lun);
-       if ((IS_ERR(lun_p)) || !(lun_p))
+       if ((IS_ERR(lun_p)) || !lun_p)
                return NULL;
 
        if (dev->dev_flags & DF_READ_ONLY)
@@ -1321,7 +1321,7 @@ struct se_lun *core_dev_add_lun(
        if (core_tpg_post_addlun(tpg, lun_p, lun_access, dev) < 0)
                return NULL;
 
-       printk(KERN_INFO "%s_TPG[%u]_LUN[%u] - Activated %s Logical Unit from"
+       pr_debug("%s_TPG[%u]_LUN[%u] - Activated %s Logical Unit from"
                " CORE HBA: %u\n", tpg->se_tpg_tfo->get_fabric_name(),
                tpg->se_tpg_tfo->tpg_get_tag(tpg), lun_p->unpacked_lun,
                tpg->se_tpg_tfo->get_fabric_name(), hba->hba_id);
@@ -1357,12 +1357,12 @@ int core_dev_del_lun(
        int ret = 0;
 
        lun = core_tpg_pre_dellun(tpg, unpacked_lun, &ret);
-       if (!(lun))
+       if (!lun)
                return ret;
 
        core_tpg_post_dellun(tpg, lun);
 
-       printk(KERN_INFO "%s_TPG[%u]_LUN[%u] - Deactivated %s Logical Unit from"
+       pr_debug("%s_TPG[%u]_LUN[%u] - Deactivated %s Logical Unit from"
                " device object\n", tpg->se_tpg_tfo->get_fabric_name(),
                tpg->se_tpg_tfo->tpg_get_tag(tpg), unpacked_lun,
                tpg->se_tpg_tfo->get_fabric_name());
@@ -1376,7 +1376,7 @@ struct se_lun *core_get_lun_from_tpg(struct se_portal_group *tpg, u32 unpacked_l
 
        spin_lock(&tpg->tpg_lun_lock);
        if (unpacked_lun > (TRANSPORT_MAX_LUNS_PER_TPG-1)) {
-               printk(KERN_ERR "%s LUN: %u exceeds TRANSPORT_MAX_LUNS"
+               pr_err("%s LUN: %u exceeds TRANSPORT_MAX_LUNS"
                        "_PER_TPG-1: %u for Target Portal Group: %hu\n",
                        tpg->se_tpg_tfo->get_fabric_name(), unpacked_lun,
                        TRANSPORT_MAX_LUNS_PER_TPG-1,
@@ -1387,7 +1387,7 @@ struct se_lun *core_get_lun_from_tpg(struct se_portal_group *tpg, u32 unpacked_l
        lun = &tpg->tpg_lun_list[unpacked_lun];
 
        if (lun->lun_status != TRANSPORT_LUN_STATUS_FREE) {
-               printk(KERN_ERR "%s Logical Unit Number: %u is not free on"
+               pr_err("%s Logical Unit Number: %u is not free on"
                        " Target Portal Group: %hu, ignoring request.\n",
                        tpg->se_tpg_tfo->get_fabric_name(), unpacked_lun,
                        tpg->se_tpg_tfo->tpg_get_tag(tpg));
@@ -1409,7 +1409,7 @@ static struct se_lun *core_dev_get_lun(struct se_portal_group *tpg, u32 unpacked
 
        spin_lock(&tpg->tpg_lun_lock);
        if (unpacked_lun > (TRANSPORT_MAX_LUNS_PER_TPG-1)) {
-               printk(KERN_ERR "%s LUN: %u exceeds TRANSPORT_MAX_LUNS_PER"
+               pr_err("%s LUN: %u exceeds TRANSPORT_MAX_LUNS_PER"
                        "_TPG-1: %u for Target Portal Group: %hu\n",
                        tpg->se_tpg_tfo->get_fabric_name(), unpacked_lun,
                        TRANSPORT_MAX_LUNS_PER_TPG-1,
@@ -1420,7 +1420,7 @@ static struct se_lun *core_dev_get_lun(struct se_portal_group *tpg, u32 unpacked
        lun = &tpg->tpg_lun_list[unpacked_lun];
 
        if (lun->lun_status != TRANSPORT_LUN_STATUS_ACTIVE) {
-               printk(KERN_ERR "%s Logical Unit Number: %u is not active on"
+               pr_err("%s Logical Unit Number: %u is not active on"
                        " Target Portal Group: %hu, ignoring request.\n",
                        tpg->se_tpg_tfo->get_fabric_name(), unpacked_lun,
                        tpg->se_tpg_tfo->tpg_get_tag(tpg));
@@ -1442,19 +1442,19 @@ struct se_lun_acl *core_dev_init_initiator_node_lun_acl(
        struct se_node_acl *nacl;
 
        if (strlen(initiatorname) >= TRANSPORT_IQN_LEN) {
-               printk(KERN_ERR "%s InitiatorName exceeds maximum size.\n",
+               pr_err("%s InitiatorName exceeds maximum size.\n",
                        tpg->se_tpg_tfo->get_fabric_name());
                *ret = -EOVERFLOW;
                return NULL;
        }
        nacl = core_tpg_get_initiator_node_acl(tpg, initiatorname);
-       if (!(nacl)) {
+       if (!nacl) {
                *ret = -EINVAL;
                return NULL;
        }
        lacl = kzalloc(sizeof(struct se_lun_acl), GFP_KERNEL);
-       if (!(lacl)) {
-               printk(KERN_ERR "Unable to allocate memory for struct se_lun_acl.\n");
+       if (!lacl) {
+               pr_err("Unable to allocate memory for struct se_lun_acl.\n");
                *ret = -ENOMEM;
                return NULL;
        }
@@ -1477,8 +1477,8 @@ int core_dev_add_initiator_node_lun_acl(
        struct se_node_acl *nacl;
 
        lun = core_dev_get_lun(tpg, unpacked_lun);
-       if (!(lun)) {
-               printk(KERN_ERR "%s Logical Unit Number: %u is not active on"
+       if (!lun) {
+               pr_err("%s Logical Unit Number: %u is not active on"
                        " Target Portal Group: %hu, ignoring request.\n",
                        tpg->se_tpg_tfo->get_fabric_name(), unpacked_lun,
                        tpg->se_tpg_tfo->tpg_get_tag(tpg));
@@ -1486,7 +1486,7 @@ int core_dev_add_initiator_node_lun_acl(
        }
 
        nacl = lacl->se_lun_nacl;
-       if (!(nacl))
+       if (!nacl)
                return -EINVAL;
 
        if ((lun->lun_access & TRANSPORT_LUNFLAGS_READ_ONLY) &&
@@ -1505,7 +1505,7 @@ int core_dev_add_initiator_node_lun_acl(
        smp_mb__after_atomic_inc();
        spin_unlock(&lun->lun_acl_lock);
 
-       printk(KERN_INFO "%s_TPG[%hu]_LUN[%u->%u] - Added %s ACL for "
+       pr_debug("%s_TPG[%hu]_LUN[%u->%u] - Added %s ACL for "
                " InitiatorNode: %s\n", tpg->se_tpg_tfo->get_fabric_name(),
                tpg->se_tpg_tfo->tpg_get_tag(tpg), unpacked_lun, lacl->mapped_lun,
                (lun_access & TRANSPORT_LUNFLAGS_READ_WRITE) ? "RW" : "RO",
@@ -1530,7 +1530,7 @@ int core_dev_del_initiator_node_lun_acl(
        struct se_node_acl *nacl;
 
        nacl = lacl->se_lun_nacl;
-       if (!(nacl))
+       if (!nacl)
                return -EINVAL;
 
        spin_lock(&lun->lun_acl_lock);
@@ -1544,7 +1544,7 @@ int core_dev_del_initiator_node_lun_acl(
 
        lacl->se_lun = NULL;
 
-       printk(KERN_INFO "%s_TPG[%hu]_LUN[%u] - Removed ACL for"
+       pr_debug("%s_TPG[%hu]_LUN[%u] - Removed ACL for"
                " InitiatorNode: %s Mapped LUN: %u\n",
                tpg->se_tpg_tfo->get_fabric_name(),
                tpg->se_tpg_tfo->tpg_get_tag(tpg), lun->unpacked_lun,
@@ -1557,7 +1557,7 @@ void core_dev_free_initiator_node_lun_acl(
        struct se_portal_group *tpg,
        struct se_lun_acl *lacl)
 {
-       printk("%s_TPG[%hu] - Freeing ACL for %s InitiatorNode: %s"
+       pr_debug("%s_TPG[%hu] - Freeing ACL for %s InitiatorNode: %s"
                " Mapped LUN: %u\n", tpg->se_tpg_tfo->get_fabric_name(),
                tpg->se_tpg_tfo->tpg_get_tag(tpg),
                tpg->se_tpg_tfo->get_fabric_name(),
@@ -1575,7 +1575,7 @@ int core_dev_setup_virtual_lun0(void)
        char buf[16];
        int ret;
 
-       hba = core_alloc_hba("rd_dr", 0, HBA_FLAGS_INTERNAL_USE);
+       hba = core_alloc_hba("rd_mcp", 0, HBA_FLAGS_INTERNAL_USE);
        if (IS_ERR(hba))
                return PTR_ERR(hba);
 
@@ -1583,8 +1583,8 @@ int core_dev_setup_virtual_lun0(void)
        t = hba->transport;
 
        se_dev = kzalloc(sizeof(struct se_subsystem_dev), GFP_KERNEL);
-       if (!(se_dev)) {
-               printk(KERN_ERR "Unable to allocate memory for"
+       if (!se_dev) {
+               pr_err("Unable to allocate memory for"
                                " struct se_subsystem_dev\n");
                ret = -ENOMEM;
                goto out;
@@ -1606,8 +1606,8 @@ int core_dev_setup_virtual_lun0(void)
        se_dev->se_dev_hba = hba;
 
        se_dev->se_dev_su_ptr = t->allocate_virtdevice(hba, "virt_lun0");
-       if (!(se_dev->se_dev_su_ptr)) {
-               printk(KERN_ERR "Unable to locate subsystem dependent pointer"
+       if (!se_dev->se_dev_su_ptr) {
+               pr_err("Unable to locate subsystem dependent pointer"
                        " from allocate_virtdevice()\n");
                ret = -ENOMEM;
                goto out;
@@ -1643,7 +1643,7 @@ void core_dev_release_virtual_lun0(void)
        struct se_hba *hba = lun0_hba;
        struct se_subsystem_dev *su_dev = lun0_su_dev;
 
-       if (!(hba))
+       if (!hba)
                return;
 
        if (g_lun0_dev)
index 0b1659d..f165469 100644 (file)
@@ -60,7 +60,7 @@ static void target_fabric_setup_##_name##_cit(struct target_fabric_configfs *tf)
        cit->ct_group_ops = _group_ops;                                 \
        cit->ct_attrs = _attrs;                                         \
        cit->ct_owner = tf->tf_module;                                  \
-       printk("Setup generic %s\n", __stringify(_name));               \
+       pr_debug("Setup generic %s\n", __stringify(_name));             \
 }
 
 /* Start of tfc_tpg_mappedlun_cit */
@@ -80,8 +80,8 @@ static int target_fabric_mappedlun_link(
        /*
         * Ensure that the source port exists
         */
-       if (!(lun->lun_sep) || !(lun->lun_sep->sep_tpg)) {
-               printk(KERN_ERR "Source se_lun->lun_sep or lun->lun_sep->sep"
+       if (!lun->lun_sep || !lun->lun_sep->sep_tpg) {
+               pr_err("Source se_lun->lun_sep or lun->lun_sep->sep"
                                "_tpg does not exist\n");
                return -EINVAL;
        }
@@ -96,12 +96,12 @@ static int target_fabric_mappedlun_link(
         * Make sure the SymLink is going to the same $FABRIC/$WWN/tpgt_$TPGT
         */
        if (strcmp(config_item_name(wwn_ci), config_item_name(wwn_ci_s))) {
-               printk(KERN_ERR "Illegal Initiator ACL SymLink outside of %s\n",
+               pr_err("Illegal Initiator ACL SymLink outside of %s\n",
                        config_item_name(wwn_ci));
                return -EINVAL;
        }
        if (strcmp(config_item_name(tpg_ci), config_item_name(tpg_ci_s))) {
-               printk(KERN_ERR "Illegal Initiator ACL Symlink outside of %s"
+               pr_err("Illegal Initiator ACL Symlink outside of %s"
                        " TPGT: %s\n", config_item_name(wwn_ci),
                        config_item_name(tpg_ci));
                return -EINVAL;
@@ -147,7 +147,7 @@ static int target_fabric_mappedlun_unlink(
        /*
         * Determine if the underlying MappedLUN has already been released..
         */
-       if (!(deve->se_lun))
+       if (!deve->se_lun)
                return 0;
 
        lun = container_of(to_config_group(lun_ci), struct se_lun, lun_group);
@@ -202,7 +202,7 @@ static ssize_t target_fabric_mappedlun_store_write_protect(
                        TRANSPORT_LUNFLAGS_READ_WRITE,
                        lacl->se_lun_nacl);
 
-       printk(KERN_INFO "%s_ConfigFS: Changed Initiator ACL: %s"
+       pr_debug("%s_ConfigFS: Changed Initiator ACL: %s"
                " Mapped LUN: %u Write Protect bit to %s\n",
                se_tpg->se_tpg_tfo->get_fabric_name(),
                lacl->initiatorname, lacl->mapped_lun, (op) ? "ON" : "OFF");
@@ -327,14 +327,14 @@ static struct config_group *target_fabric_make_mappedlun(
        int ret = 0;
 
        acl_ci = &group->cg_item;
-       if (!(acl_ci)) {
-               printk(KERN_ERR "Unable to locatel acl_ci\n");
+       if (!acl_ci) {
+               pr_err("Unable to locatel acl_ci\n");
                return NULL;
        }
 
        buf = kzalloc(strlen(name) + 1, GFP_KERNEL);
-       if (!(buf)) {
-               printk(KERN_ERR "Unable to allocate memory for name buf\n");
+       if (!buf) {
+               pr_err("Unable to allocate memory for name buf\n");
                return ERR_PTR(-ENOMEM);
        }
        snprintf(buf, strlen(name) + 1, "%s", name);
@@ -342,7 +342,7 @@ static struct config_group *target_fabric_make_mappedlun(
         * Make sure user is creating iscsi/$IQN/$TPGT/acls/$INITIATOR/lun_$ID.
         */
        if (strstr(buf, "lun_") != buf) {
-               printk(KERN_ERR "Unable to locate \"lun_\" from buf: %s"
+               pr_err("Unable to locate \"lun_\" from buf: %s"
                        " name: %s\n", buf, name);
                ret = -EINVAL;
                goto out;
@@ -358,7 +358,7 @@ static struct config_group *target_fabric_make_mappedlun(
 
        lacl = core_dev_init_initiator_node_lun_acl(se_tpg, mapped_lun,
                        config_item_name(acl_ci), &ret);
-       if (!(lacl)) {
+       if (!lacl) {
                ret = -EINVAL;
                goto out;
        }
@@ -367,7 +367,7 @@ static struct config_group *target_fabric_make_mappedlun(
        lacl_cg->default_groups = kzalloc(sizeof(struct config_group) * 2,
                                GFP_KERNEL);
        if (!lacl_cg->default_groups) {
-               printk(KERN_ERR "Unable to allocate lacl_cg->default_groups\n");
+               pr_err("Unable to allocate lacl_cg->default_groups\n");
                ret = -ENOMEM;
                goto out;
        }
@@ -383,7 +383,7 @@ static struct config_group *target_fabric_make_mappedlun(
        ml_stat_grp->default_groups = kzalloc(sizeof(struct config_group) * 3,
                                GFP_KERNEL);
        if (!ml_stat_grp->default_groups) {
-               printk(KERN_ERR "Unable to allocate ml_stat_grp->default_groups\n");
+               pr_err("Unable to allocate ml_stat_grp->default_groups\n");
                ret = -ENOMEM;
                goto out;
        }
@@ -474,8 +474,8 @@ static struct config_group *target_fabric_make_nodeacl(
        struct se_node_acl *se_nacl;
        struct config_group *nacl_cg;
 
-       if (!(tf->tf_ops.fabric_make_nodeacl)) {
-               printk(KERN_ERR "tf->tf_ops.fabric_make_nodeacl is NULL\n");
+       if (!tf->tf_ops.fabric_make_nodeacl) {
+               pr_err("tf->tf_ops.fabric_make_nodeacl is NULL\n");
                return ERR_PTR(-ENOSYS);
        }
 
@@ -572,13 +572,13 @@ static struct config_group *target_fabric_make_np(
        struct target_fabric_configfs *tf = se_tpg->se_tpg_wwn->wwn_tf;
        struct se_tpg_np *se_tpg_np;
 
-       if (!(tf->tf_ops.fabric_make_np)) {
-               printk(KERN_ERR "tf->tf_ops.fabric_make_np is NULL\n");
+       if (!tf->tf_ops.fabric_make_np) {
+               pr_err("tf->tf_ops.fabric_make_np is NULL\n");
                return ERR_PTR(-ENOSYS);
        }
 
        se_tpg_np = tf->tf_ops.fabric_make_np(se_tpg, group, name);
-       if (!(se_tpg_np) || IS_ERR(se_tpg_np))
+       if (!se_tpg_np || IS_ERR(se_tpg_np))
                return ERR_PTR(-EINVAL);
 
        se_tpg_np->tpg_np_parent = se_tpg;
@@ -627,10 +627,7 @@ static ssize_t target_fabric_port_show_attr_alua_tg_pt_gp(
        struct se_lun *lun,
        char *page)
 {
-       if (!(lun))
-               return -ENODEV;
-
-       if (!(lun->lun_sep))
+       if (!lun || !lun->lun_sep)
                return -ENODEV;
 
        return core_alua_show_tg_pt_gp_info(lun->lun_sep, page);
@@ -641,10 +638,7 @@ static ssize_t target_fabric_port_store_attr_alua_tg_pt_gp(
        const char *page,
        size_t count)
 {
-       if (!(lun))
-               return -ENODEV;
-
-       if (!(lun->lun_sep))
+       if (!lun || !lun->lun_sep)
                return -ENODEV;
 
        return core_alua_store_tg_pt_gp_info(lun->lun_sep, page, count);
@@ -659,10 +653,7 @@ static ssize_t target_fabric_port_show_attr_alua_tg_pt_offline(
        struct se_lun *lun,
        char *page)
 {
-       if (!(lun))
-               return -ENODEV;
-
-       if (!(lun->lun_sep))
+       if (!lun || !lun->lun_sep)
                return -ENODEV;
 
        return core_alua_show_offline_bit(lun, page);
@@ -673,10 +664,7 @@ static ssize_t target_fabric_port_store_attr_alua_tg_pt_offline(
        const char *page,
        size_t count)
 {
-       if (!(lun))
-               return -ENODEV;
-
-       if (!(lun->lun_sep))
+       if (!lun || !lun->lun_sep)
                return -ENODEV;
 
        return core_alua_store_offline_bit(lun, page, count);
@@ -691,10 +679,7 @@ static ssize_t target_fabric_port_show_attr_alua_tg_pt_status(
        struct se_lun *lun,
        char *page)
 {
-       if (!(lun))
-               return -ENODEV;
-
-       if (!(lun->lun_sep))
+       if (!lun || !lun->lun_sep)
                return -ENODEV;
 
        return core_alua_show_secondary_status(lun, page);
@@ -705,10 +690,7 @@ static ssize_t target_fabric_port_store_attr_alua_tg_pt_status(
        const char *page,
        size_t count)
 {
-       if (!(lun))
-               return -ENODEV;
-
-       if (!(lun->lun_sep))
+       if (!lun || !lun->lun_sep)
                return -ENODEV;
 
        return core_alua_store_secondary_status(lun, page, count);
@@ -723,10 +705,7 @@ static ssize_t target_fabric_port_show_attr_alua_tg_pt_write_md(
        struct se_lun *lun,
        char *page)
 {
-       if (!(lun))
-               return -ENODEV;
-
-       if (!(lun->lun_sep))
+       if (!lun || !lun->lun_sep)
                return -ENODEV;
 
        return core_alua_show_secondary_write_metadata(lun, page);
@@ -737,10 +716,7 @@ static ssize_t target_fabric_port_store_attr_alua_tg_pt_write_md(
        const char *page,
        size_t count)
 {
-       if (!(lun))
-               return -ENODEV;
-
-       if (!(lun->lun_sep))
+       if (!lun || !lun->lun_sep)
                return -ENODEV;
 
        return core_alua_store_secondary_write_metadata(lun, page, count);
@@ -781,13 +757,13 @@ static int target_fabric_port_link(
        tf = se_tpg->se_tpg_wwn->wwn_tf;
 
        if (lun->lun_se_dev !=  NULL) {
-               printk(KERN_ERR "Port Symlink already exists\n");
+               pr_err("Port Symlink already exists\n");
                return -EEXIST;
        }
 
        dev = se_dev->se_dev_ptr;
-       if (!(dev)) {
-               printk(KERN_ERR "Unable to locate struct se_device pointer from"
+       if (!dev) {
+               pr_err("Unable to locate struct se_device pointer from"
                        " %s\n", config_item_name(se_dev_ci));
                ret = -ENODEV;
                goto out;
@@ -795,8 +771,8 @@ static int target_fabric_port_link(
 
        lun_p = core_dev_add_lun(se_tpg, dev->se_hba, dev,
                                lun->unpacked_lun);
-       if ((IS_ERR(lun_p)) || !(lun_p)) {
-               printk(KERN_ERR "core_dev_add_lun() failed\n");
+       if (IS_ERR(lun_p) || !lun_p) {
+               pr_err("core_dev_add_lun() failed\n");
                ret = -EINVAL;
                goto out;
        }
@@ -888,7 +864,7 @@ static struct config_group *target_fabric_make_lun(
        int errno;
 
        if (strstr(name, "lun_") != name) {
-               printk(KERN_ERR "Unable to locate \'_\" in"
+               pr_err("Unable to locate \'_\" in"
                                " \"lun_$LUN_NUMBER\"\n");
                return ERR_PTR(-EINVAL);
        }
@@ -896,14 +872,14 @@ static struct config_group *target_fabric_make_lun(
                return ERR_PTR(-EINVAL);
 
        lun = core_get_lun_from_tpg(se_tpg, unpacked_lun);
-       if (!(lun))
+       if (!lun)
                return ERR_PTR(-EINVAL);
 
        lun_cg = &lun->lun_group;
        lun_cg->default_groups = kzalloc(sizeof(struct config_group) * 2,
                                GFP_KERNEL);
        if (!lun_cg->default_groups) {
-               printk(KERN_ERR "Unable to allocate lun_cg->default_groups\n");
+               pr_err("Unable to allocate lun_cg->default_groups\n");
                return ERR_PTR(-ENOMEM);
        }
 
@@ -918,7 +894,7 @@ static struct config_group *target_fabric_make_lun(
        port_stat_grp->default_groups =  kzalloc(sizeof(struct config_group) * 3,
                                GFP_KERNEL);
        if (!port_stat_grp->default_groups) {
-               printk(KERN_ERR "Unable to allocate port_stat_grp->default_groups\n");
+               pr_err("Unable to allocate port_stat_grp->default_groups\n");
                errno = -ENOMEM;
                goto out;
        }
@@ -1031,13 +1007,13 @@ static struct config_group *target_fabric_make_tpg(
        struct target_fabric_configfs *tf = wwn->wwn_tf;
        struct se_portal_group *se_tpg;
 
-       if (!(tf->tf_ops.fabric_make_tpg)) {
-               printk(KERN_ERR "tf->tf_ops.fabric_make_tpg is NULL\n");
+       if (!tf->tf_ops.fabric_make_tpg) {
+               pr_err("tf->tf_ops.fabric_make_tpg is NULL\n");
                return ERR_PTR(-ENOSYS);
        }
 
        se_tpg = tf->tf_ops.fabric_make_tpg(wwn, group, name);
-       if (!(se_tpg) || IS_ERR(se_tpg))
+       if (!se_tpg || IS_ERR(se_tpg))
                return ERR_PTR(-EINVAL);
        /*
         * Setup default groups from pre-allocated se_tpg->tpg_default_groups
@@ -1130,13 +1106,13 @@ static struct config_group *target_fabric_make_wwn(
                                struct target_fabric_configfs, tf_group);
        struct se_wwn *wwn;
 
-       if (!(tf->tf_ops.fabric_make_wwn)) {
-               printk(KERN_ERR "tf->tf_ops.fabric_make_wwn is NULL\n");
+       if (!tf->tf_ops.fabric_make_wwn) {
+               pr_err("tf->tf_ops.fabric_make_wwn is NULL\n");
                return ERR_PTR(-ENOSYS);
        }
 
        wwn = tf->tf_ops.fabric_make_wwn(tf, group, name);
-       if (!(wwn) || IS_ERR(wwn))
+       if (!wwn || IS_ERR(wwn))
                return ERR_PTR(-EINVAL);
 
        wwn->wwn_tf = tf;
index 1e193f3..a299688 100644 (file)
@@ -172,7 +172,7 @@ u32 fc_get_pr_transport_id(
        ptr = &se_nacl->initiatorname[0];
 
        for (i = 0; i < 24; ) {
-               if (!(strncmp(&ptr[i], ":", 1))) {
+               if (!strncmp(&ptr[i], ":", 1)) {
                        i++;
                        continue;
                }
@@ -386,7 +386,7 @@ char *iscsi_parse_pr_out_transport_id(
         *            Reserved
         */
        if ((format_code != 0x00) && (format_code != 0x40)) {
-               printk(KERN_ERR "Illegal format code: 0x%02x for iSCSI"
+               pr_err("Illegal format code: 0x%02x for iSCSI"
                        " Initiator Transport ID\n", format_code);
                return NULL;
        }
@@ -406,7 +406,7 @@ char *iscsi_parse_pr_out_transport_id(
                        tid_len += padding;
 
                if ((add_len + 4) != tid_len) {
-                       printk(KERN_INFO "LIO-Target Extracted add_len: %hu "
+                       pr_debug("LIO-Target Extracted add_len: %hu "
                                "does not match calculated tid_len: %u,"
                                " using tid_len instead\n", add_len+4, tid_len);
                        *out_tid_len = tid_len;
@@ -420,8 +420,8 @@ char *iscsi_parse_pr_out_transport_id(
         */
        if (format_code == 0x40) {
                p = strstr((char *)&buf[4], ",i,0x");
-               if (!(p)) {
-                       printk(KERN_ERR "Unable to locate \",i,0x\" seperator"
+               if (!p) {
+                       pr_err("Unable to locate \",i,0x\" seperator"
                                " for Initiator port identifier: %s\n",
                                (char *)&buf[4]);
                        return NULL;
index 5c47f42..bc1b336 100644 (file)
 
 #include "target_core_file.h"
 
-#if 1
-#define DEBUG_FD_CACHE(x...) printk(x)
-#else
-#define DEBUG_FD_CACHE(x...)
-#endif
-
-#if 1
-#define DEBUG_FD_FUA(x...) printk(x)
-#else
-#define DEBUG_FD_FUA(x...)
-#endif
-
 static struct se_subsystem_api fileio_template;
 
 /*     fd_attach_hba(): (Part of se_subsystem_api_t template)
@@ -65,8 +53,8 @@ static int fd_attach_hba(struct se_hba *hba, u32 host_id)
        struct fd_host *fd_host;
 
        fd_host = kzalloc(sizeof(struct fd_host), GFP_KERNEL);
-       if (!(fd_host)) {
-               printk(KERN_ERR "Unable to allocate memory for struct fd_host\n");
+       if (!fd_host) {
+               pr_err("Unable to allocate memory for struct fd_host\n");
                return -ENOMEM;
        }
 
@@ -74,10 +62,10 @@ static int fd_attach_hba(struct se_hba *hba, u32 host_id)
 
        hba->hba_ptr = fd_host;
 
-       printk(KERN_INFO "CORE_HBA[%d] - TCM FILEIO HBA Driver %s on Generic"
+       pr_debug("CORE_HBA[%d] - TCM FILEIO HBA Driver %s on Generic"
                " Target Core Stack %s\n", hba->hba_id, FD_VERSION,
                TARGET_CORE_MOD_VERSION);
-       printk(KERN_INFO "CORE_HBA[%d] - Attached FILEIO HBA: %u to Generic"
+       pr_debug("CORE_HBA[%d] - Attached FILEIO HBA: %u to Generic"
                " MaxSectors: %u\n",
                hba->hba_id, fd_host->fd_host_id, FD_MAX_SECTORS);
 
@@ -88,7 +76,7 @@ static void fd_detach_hba(struct se_hba *hba)
 {
        struct fd_host *fd_host = hba->hba_ptr;
 
-       printk(KERN_INFO "CORE_HBA[%d] - Detached FILEIO HBA: %u from Generic"
+       pr_debug("CORE_HBA[%d] - Detached FILEIO HBA: %u from Generic"
                " Target Core\n", hba->hba_id, fd_host->fd_host_id);
 
        kfree(fd_host);
@@ -101,14 +89,14 @@ static void *fd_allocate_virtdevice(struct se_hba *hba, const char *name)
        struct fd_host *fd_host = (struct fd_host *) hba->hba_ptr;
 
        fd_dev = kzalloc(sizeof(struct fd_dev), GFP_KERNEL);
-       if (!(fd_dev)) {
-               printk(KERN_ERR "Unable to allocate memory for struct fd_dev\n");
+       if (!fd_dev) {
+               pr_err("Unable to allocate memory for struct fd_dev\n");
                return NULL;
        }
 
        fd_dev->fd_host = fd_host;
 
-       printk(KERN_INFO "FILEIO: Allocated fd_dev for %p\n", name);
+       pr_debug("FILEIO: Allocated fd_dev for %p\n", name);
 
        return fd_dev;
 }
@@ -141,7 +129,7 @@ static struct se_device *fd_create_virtdevice(
        set_fs(old_fs);
 
        if (IS_ERR(dev_p)) {
-               printk(KERN_ERR "getname(%s) failed: %lu\n",
+               pr_err("getname(%s) failed: %lu\n",
                        fd_dev->fd_dev_name, IS_ERR(dev_p));
                ret = PTR_ERR(dev_p);
                goto fail;
@@ -164,12 +152,12 @@ static struct se_device *fd_create_virtdevice(
 
        file = filp_open(dev_p, flags, 0600);
        if (IS_ERR(file)) {
-               printk(KERN_ERR "filp_open(%s) failed\n", dev_p);
+               pr_err("filp_open(%s) failed\n", dev_p);
                ret = PTR_ERR(file);
                goto fail;
        }
        if (!file || !file->f_dentry) {
-               printk(KERN_ERR "filp_open(%s) failed\n", dev_p);
+               pr_err("filp_open(%s) failed\n", dev_p);
                goto fail;
        }
        fd_dev->fd_file = file;
@@ -199,14 +187,14 @@ static struct se_device *fd_create_virtdevice(
                fd_dev->fd_dev_size = (i_size_read(file->f_mapping->host) -
                                       fd_dev->fd_block_size);
 
-               printk(KERN_INFO "FILEIO: Using size: %llu bytes from struct"
+               pr_debug("FILEIO: Using size: %llu bytes from struct"
                        " block_device blocks: %llu logical_block_size: %d\n",
                        fd_dev->fd_dev_size,
                        div_u64(fd_dev->fd_dev_size, fd_dev->fd_block_size),
                        fd_dev->fd_block_size);
        } else {
                if (!(fd_dev->fbd_flags & FBDF_HAS_SIZE)) {
-                       printk(KERN_ERR "FILEIO: Missing fd_dev_size="
+                       pr_err("FILEIO: Missing fd_dev_size="
                                " parameter, and no backing struct"
                                " block_device\n");
                        goto fail;
@@ -225,13 +213,13 @@ static struct se_device *fd_create_virtdevice(
        dev = transport_add_device_to_core_hba(hba, &fileio_template,
                                se_dev, dev_flags, fd_dev,
                                &dev_limits, "FILEIO", FD_VERSION);
-       if (!(dev))
+       if (!dev)
                goto fail;
 
        fd_dev->fd_dev_id = fd_host->fd_host_dev_id_count++;
        fd_dev->fd_queue_depth = dev->queue_depth;
 
-       printk(KERN_INFO "CORE_FILE[%u] - Added TCM FILEIO Device ID: %u at %s,"
+       pr_debug("CORE_FILE[%u] - Added TCM FILEIO Device ID: %u at %s,"
                " %llu total bytes\n", fd_host->fd_host_id, fd_dev->fd_dev_id,
                        fd_dev->fd_dev_name, fd_dev->fd_dev_size);
 
@@ -269,25 +257,24 @@ static inline struct fd_request *FILE_REQ(struct se_task *task)
 
 
 static struct se_task *
-fd_alloc_task(struct se_cmd *cmd)
+fd_alloc_task(unsigned char *cdb)
 {
        struct fd_request *fd_req;
 
        fd_req = kzalloc(sizeof(struct fd_request), GFP_KERNEL);
-       if (!(fd_req)) {
-               printk(KERN_ERR "Unable to allocate struct fd_request\n");
+       if (!fd_req) {
+               pr_err("Unable to allocate struct fd_request\n");
                return NULL;
        }
 
-       fd_req->fd_dev = cmd->se_dev->dev_ptr;
-
        return &fd_req->fd_task;
 }
 
 static int fd_do_readv(struct se_task *task)
 {
        struct fd_request *req = FILE_REQ(task);
-       struct file *fd = req->fd_dev->fd_file;
+       struct fd_dev *dev = req->fd_task.se_dev->dev_ptr;
+       struct file *fd = dev->fd_file;
        struct scatterlist *sg = task->task_sg;
        struct iovec *iov;
        mm_segment_t old_fs;
@@ -295,20 +282,20 @@ static int fd_do_readv(struct se_task *task)
                      task->se_dev->se_sub_dev->se_dev_attrib.block_size);
        int ret = 0, i;
 
-       iov = kzalloc(sizeof(struct iovec) * task->task_sg_num, GFP_KERNEL);
-       if (!(iov)) {
-               printk(KERN_ERR "Unable to allocate fd_do_readv iov[]\n");
+       iov = kzalloc(sizeof(struct iovec) * task->task_sg_nents, GFP_KERNEL);
+       if (!iov) {
+               pr_err("Unable to allocate fd_do_readv iov[]\n");
                return -ENOMEM;
        }
 
-       for (i = 0; i < task->task_sg_num; i++) {
+       for (i = 0; i < task->task_sg_nents; i++) {
                iov[i].iov_len = sg[i].length;
                iov[i].iov_base = sg_virt(&sg[i]);
        }
 
        old_fs = get_fs();
        set_fs(get_ds());
-       ret = vfs_readv(fd, &iov[0], task->task_sg_num, &pos);
+       ret = vfs_readv(fd, &iov[0], task->task_sg_nents, &pos);
        set_fs(old_fs);
 
        kfree(iov);
@@ -319,14 +306,14 @@ static int fd_do_readv(struct se_task *task)
         */
        if (S_ISBLK(fd->f_dentry->d_inode->i_mode)) {
                if (ret < 0 || ret != task->task_size) {
-                       printk(KERN_ERR "vfs_readv() returned %d,"
+                       pr_err("vfs_readv() returned %d,"
                                " expecting %d for S_ISBLK\n", ret,
                                (int)task->task_size);
                        return (ret < 0 ? ret : -EINVAL);
                }
        } else {
                if (ret < 0) {
-                       printk(KERN_ERR "vfs_readv() returned %d for non"
+                       pr_err("vfs_readv() returned %d for non"
                                " S_ISBLK\n", ret);
                        return ret;
                }
@@ -338,7 +325,8 @@ static int fd_do_readv(struct se_task *task)
 static int fd_do_writev(struct se_task *task)
 {
        struct fd_request *req = FILE_REQ(task);
-       struct file *fd = req->fd_dev->fd_file;
+       struct fd_dev *dev = req->fd_task.se_dev->dev_ptr;
+       struct file *fd = dev->fd_file;
        struct scatterlist *sg = task->task_sg;
        struct iovec *iov;
        mm_segment_t old_fs;
@@ -346,26 +334,26 @@ static int fd_do_writev(struct se_task *task)
                      task->se_dev->se_sub_dev->se_dev_attrib.block_size);
        int ret, i = 0;
 
-       iov = kzalloc(sizeof(struct iovec) * task->task_sg_num, GFP_KERNEL);
-       if (!(iov)) {
-               printk(KERN_ERR "Unable to allocate fd_do_writev iov[]\n");
+       iov = kzalloc(sizeof(struct iovec) * task->task_sg_nents, GFP_KERNEL);
+       if (!iov) {
+               pr_err("Unable to allocate fd_do_writev iov[]\n");
                return -ENOMEM;
        }
 
-       for (i = 0; i < task->task_sg_num; i++) {
+       for (i = 0; i < task->task_sg_nents; i++) {
                iov[i].iov_len = sg[i].length;
                iov[i].iov_base = sg_virt(&sg[i]);
        }
 
        old_fs = get_fs();
        set_fs(get_ds());
-       ret = vfs_writev(fd, &iov[0], task->task_sg_num, &pos);
+       ret = vfs_writev(fd, &iov[0], task->task_sg_nents, &pos);
        set_fs(old_fs);
 
        kfree(iov);
 
        if (ret < 0 || ret != task->task_size) {
-               printk(KERN_ERR "vfs_writev() returned %d\n", ret);
+               pr_err("vfs_writev() returned %d\n", ret);
                return (ret < 0 ? ret : -EINVAL);
        }
 
@@ -404,7 +392,7 @@ static void fd_emulate_sync_cache(struct se_task *task)
 
        ret = vfs_fsync_range(fd_dev->fd_file, start, end, 1);
        if (ret != 0)
-               printk(KERN_ERR "FILEIO: vfs_fsync_range() failed: %d\n", ret);
+               pr_err("FILEIO: vfs_fsync_range() failed: %d\n", ret);
 
        if (!immed)
                transport_complete_sync_cache(cmd, ret == 0);
@@ -449,12 +437,12 @@ static void fd_emulate_write_fua(struct se_cmd *cmd, struct se_task *task)
        loff_t end = start + task->task_size;
        int ret;
 
-       DEBUG_FD_CACHE("FILEIO: FUA WRITE LBA: %llu, bytes: %u\n",
+       pr_debug("FILEIO: FUA WRITE LBA: %llu, bytes: %u\n",
                        task->task_lba, task->task_size);
 
        ret = vfs_fsync_range(fd_dev->fd_file, start, end, 1);
        if (ret != 0)
-               printk(KERN_ERR "FILEIO: vfs_fsync_range() failed: %d\n", ret);
+               pr_err("FILEIO: vfs_fsync_range() failed: %d\n", ret);
 }
 
 static int fd_do_task(struct se_task *task)
@@ -548,7 +536,7 @@ static ssize_t fd_set_configfs_dev_params(
                        snprintf(fd_dev->fd_dev_name, FD_MAX_DEV_NAME,
                                        "%s", arg_p);
                        kfree(arg_p);
-                       printk(KERN_INFO "FILEIO: Referencing Path: %s\n",
+                       pr_debug("FILEIO: Referencing Path: %s\n",
                                        fd_dev->fd_dev_name);
                        fd_dev->fbd_flags |= FBDF_HAS_PATH;
                        break;
@@ -561,23 +549,23 @@ static ssize_t fd_set_configfs_dev_params(
                        ret = strict_strtoull(arg_p, 0, &fd_dev->fd_dev_size);
                        kfree(arg_p);
                        if (ret < 0) {
-                               printk(KERN_ERR "strict_strtoull() failed for"
+                               pr_err("strict_strtoull() failed for"
                                                " fd_dev_size=\n");
                                goto out;
                        }
-                       printk(KERN_INFO "FILEIO: Referencing Size: %llu"
+                       pr_debug("FILEIO: Referencing Size: %llu"
                                        " bytes\n", fd_dev->fd_dev_size);
                        fd_dev->fbd_flags |= FBDF_HAS_SIZE;
                        break;
                case Opt_fd_buffered_io:
                        match_int(args, &arg);
                        if (arg != 1) {
-                               printk(KERN_ERR "bogus fd_buffered_io=%d value\n", arg);
+                               pr_err("bogus fd_buffered_io=%d value\n", arg);
                                ret = -EINVAL;
                                goto out;
                        }
 
-                       printk(KERN_INFO "FILEIO: Using buffered I/O"
+                       pr_debug("FILEIO: Using buffered I/O"
                                " operations for struct fd_dev\n");
 
                        fd_dev->fbd_flags |= FDBD_USE_BUFFERED_IO;
@@ -597,7 +585,7 @@ static ssize_t fd_check_configfs_dev_params(struct se_hba *hba, struct se_subsys
        struct fd_dev *fd_dev = (struct fd_dev *) se_dev->se_dev_su_ptr;
 
        if (!(fd_dev->fbd_flags & FBDF_HAS_PATH)) {
-               printk(KERN_ERR "Missing fd_dev_name=\n");
+               pr_err("Missing fd_dev_name=\n");
                return -EINVAL;
        }
 
index 6386d3f..daebd71 100644 (file)
@@ -16,8 +16,6 @@ struct fd_request {
        struct se_task  fd_task;
        /* SCSI CDB from iSCSI Command PDU */
        unsigned char   fd_scsi_cdb[TCM_MAX_COMMAND_SIZE];
-       /* FILEIO device */
-       struct fd_dev   *fd_dev;
 } ____cacheline_aligned;
 
 #define FBDF_HAS_PATH          0x01
index bd9da25..0639b97 100644 (file)
@@ -58,8 +58,8 @@ int transport_subsystem_register(struct se_subsystem_api *sub_api)
 
        mutex_lock(&subsystem_mutex);
        list_for_each_entry(s, &subsystem_list, sub_api_list) {
-               if (!(strcmp(s->name, sub_api->name))) {
-                       printk(KERN_ERR "%p is already registered with"
+               if (!strcmp(s->name, sub_api->name)) {
+                       pr_err("%p is already registered with"
                                " duplicate name %s, unable to process"
                                " request\n", s, s->name);
                        mutex_unlock(&subsystem_mutex);
@@ -69,7 +69,7 @@ int transport_subsystem_register(struct se_subsystem_api *sub_api)
        list_add_tail(&sub_api->sub_api_list, &subsystem_list);
        mutex_unlock(&subsystem_mutex);
 
-       printk(KERN_INFO "TCM: Registered subsystem plugin: %s struct module:"
+       pr_debug("TCM: Registered subsystem plugin: %s struct module:"
                        " %p\n", sub_api->name, sub_api->owner);
        return 0;
 }
@@ -109,7 +109,7 @@ core_alloc_hba(const char *plugin_name, u32 plugin_dep_id, u32 hba_flags)
 
        hba = kzalloc(sizeof(*hba), GFP_KERNEL);
        if (!hba) {
-               printk(KERN_ERR "Unable to allocate struct se_hba\n");
+               pr_err("Unable to allocate struct se_hba\n");
                return ERR_PTR(-ENOMEM);
        }
 
@@ -135,7 +135,7 @@ core_alloc_hba(const char *plugin_name, u32 plugin_dep_id, u32 hba_flags)
        list_add_tail(&hba->hba_node, &hba_list);
        spin_unlock(&hba_lock);
 
-       printk(KERN_INFO "CORE_HBA[%d] - Attached HBA to Generic Target"
+       pr_debug("CORE_HBA[%d] - Attached HBA to Generic Target"
                        " Core\n", hba->hba_id);
 
        return hba;
@@ -161,7 +161,7 @@ core_delete_hba(struct se_hba *hba)
        list_del(&hba->hba_node);
        spin_unlock(&hba_lock);
 
-       printk(KERN_INFO "CORE_HBA[%d] - Detached HBA from Generic Target"
+       pr_debug("CORE_HBA[%d] - Detached HBA from Generic Target"
                        " Core\n", hba->hba_id);
 
        if (hba->transport->owner)
index 164b721..251fc66 100644 (file)
 
 #include "target_core_iblock.h"
 
-#if 0
-#define DEBUG_IBLOCK(x...) printk(x)
-#else
-#define DEBUG_IBLOCK(x...)
-#endif
-
 static struct se_subsystem_api iblock_template;
 
 static void iblock_bio_done(struct bio *, int);
@@ -66,8 +60,8 @@ static int iblock_attach_hba(struct se_hba *hba, u32 host_id)
        struct iblock_hba *ib_host;
 
        ib_host = kzalloc(sizeof(struct iblock_hba), GFP_KERNEL);
-       if (!(ib_host)) {
-               printk(KERN_ERR "Unable to allocate memory for"
+       if (!ib_host) {
+               pr_err("Unable to allocate memory for"
                                " struct iblock_hba\n");
                return -ENOMEM;
        }
@@ -76,11 +70,11 @@ static int iblock_attach_hba(struct se_hba *hba, u32 host_id)
 
        hba->hba_ptr = ib_host;
 
-       printk(KERN_INFO "CORE_HBA[%d] - TCM iBlock HBA Driver %s on"
+       pr_debug("CORE_HBA[%d] - TCM iBlock HBA Driver %s on"
                " Generic Target Core Stack %s\n", hba->hba_id,
                IBLOCK_VERSION, TARGET_CORE_MOD_VERSION);
 
-       printk(KERN_INFO "CORE_HBA[%d] - Attached iBlock HBA: %u to Generic\n",
+       pr_debug("CORE_HBA[%d] - Attached iBlock HBA: %u to Generic\n",
                hba->hba_id, ib_host->iblock_host_id);
 
        return 0;
@@ -90,7 +84,7 @@ static void iblock_detach_hba(struct se_hba *hba)
 {
        struct iblock_hba *ib_host = hba->hba_ptr;
 
-       printk(KERN_INFO "CORE_HBA[%d] - Detached iBlock HBA: %u from Generic"
+       pr_debug("CORE_HBA[%d] - Detached iBlock HBA: %u from Generic"
                " Target Core\n", hba->hba_id, ib_host->iblock_host_id);
 
        kfree(ib_host);
@@ -103,13 +97,13 @@ static void *iblock_allocate_virtdevice(struct se_hba *hba, const char *name)
        struct iblock_hba *ib_host = hba->hba_ptr;
 
        ib_dev = kzalloc(sizeof(struct iblock_dev), GFP_KERNEL);
-       if (!(ib_dev)) {
-               printk(KERN_ERR "Unable to allocate struct iblock_dev\n");
+       if (!ib_dev) {
+               pr_err("Unable to allocate struct iblock_dev\n");
                return NULL;
        }
        ib_dev->ibd_host = ib_host;
 
-       printk(KERN_INFO  "IBLOCK: Allocated ib_dev for %s\n", name);
+       pr_debug( "IBLOCK: Allocated ib_dev for %s\n", name);
 
        return ib_dev;
 }
@@ -128,8 +122,8 @@ static struct se_device *iblock_create_virtdevice(
        u32 dev_flags = 0;
        int ret = -EINVAL;
 
-       if (!(ib_dev)) {
-               printk(KERN_ERR "Unable to locate struct iblock_dev parameter\n");
+       if (!ib_dev) {
+               pr_err("Unable to locate struct iblock_dev parameter\n");
                return ERR_PTR(ret);
        }
        memset(&dev_limits, 0, sizeof(struct se_dev_limits));
@@ -137,16 +131,16 @@ static struct se_device *iblock_create_virtdevice(
         * These settings need to be made tunable..
         */
        ib_dev->ibd_bio_set = bioset_create(32, 64);
-       if (!(ib_dev->ibd_bio_set)) {
-               printk(KERN_ERR "IBLOCK: Unable to create bioset()\n");
+       if (!ib_dev->ibd_bio_set) {
+               pr_err("IBLOCK: Unable to create bioset()\n");
                return ERR_PTR(-ENOMEM);
        }
-       printk(KERN_INFO "IBLOCK: Created bio_set()\n");
+       pr_debug("IBLOCK: Created bio_set()\n");
        /*
         * iblock_check_configfs_dev_params() ensures that ib_dev->ibd_udev_path
         * must already have been set in order for echo 1 > $HBA/$DEV/enable to run.
         */
-       printk(KERN_INFO  "IBLOCK: Claiming struct block_device: %s\n",
+       pr_debug( "IBLOCK: Claiming struct block_device: %s\n",
                        ib_dev->ibd_udev_path);
 
        bd = blkdev_get_by_path(ib_dev->ibd_udev_path,
@@ -172,7 +166,7 @@ static struct se_device *iblock_create_virtdevice(
        dev = transport_add_device_to_core_hba(hba,
                        &iblock_template, se_dev, dev_flags, ib_dev,
                        &dev_limits, "IBLOCK", IBLOCK_VERSION);
-       if (!(dev))
+       if (!dev)
                goto failed;
 
        /*
@@ -192,7 +186,7 @@ static struct se_device *iblock_create_virtdevice(
                dev->se_sub_dev->se_dev_attrib.unmap_granularity_alignment =
                                q->limits.discard_alignment;
 
-               printk(KERN_INFO "IBLOCK: BLOCK Discard support available,"
+               pr_debug("IBLOCK: BLOCK Discard support available,"
                                " disabled by default\n");
        }
 
@@ -227,17 +221,16 @@ static inline struct iblock_req *IBLOCK_REQ(struct se_task *task)
 }
 
 static struct se_task *
-iblock_alloc_task(struct se_cmd *cmd)
+iblock_alloc_task(unsigned char *cdb)
 {
        struct iblock_req *ib_req;
 
        ib_req = kzalloc(sizeof(struct iblock_req), GFP_KERNEL);
-       if (!(ib_req)) {
-               printk(KERN_ERR "Unable to allocate memory for struct iblock_req\n");
+       if (!ib_req) {
+               pr_err("Unable to allocate memory for struct iblock_req\n");
                return NULL;
        }
 
-       ib_req->ib_dev = cmd->se_dev->dev_ptr;
        atomic_set(&ib_req->ib_bio_cnt, 0);
        return &ib_req->ib_task;
 }
@@ -345,7 +338,7 @@ static void iblock_emulate_sync_cache(struct se_task *task)
         */
        ret = blkdev_issue_flush(ib_dev->ibd_bd, GFP_KERNEL, &error_sector);
        if (ret != 0) {
-               printk(KERN_ERR "IBLOCK: block_issue_flush() failed: %d "
+               pr_err("IBLOCK: block_issue_flush() failed: %d "
                        " error_sector: %llu\n", ret,
                        (unsigned long long)error_sector);
        }
@@ -409,8 +402,9 @@ static int iblock_do_task(struct se_task *task)
        while (bio) {
                nbio = bio->bi_next;
                bio->bi_next = NULL;
-               DEBUG_IBLOCK("Calling submit_bio() task: %p bio: %p"
-                       " bio->bi_sector: %llu\n", task, bio, bio->bi_sector);
+               pr_debug("Calling submit_bio() task: %p bio: %p"
+                       " bio->bi_sector: %llu\n", task, bio,
+                        (unsigned long long)bio->bi_sector);
 
                submit_bio(rw, bio);
                bio = nbio;
@@ -480,7 +474,7 @@ static ssize_t iblock_set_configfs_dev_params(struct se_hba *hba,
                switch (token) {
                case Opt_udev_path:
                        if (ib_dev->ibd_bd) {
-                               printk(KERN_ERR "Unable to set udev_path= while"
+                               pr_err("Unable to set udev_path= while"
                                        " ib_dev->ibd_bd exists\n");
                                ret = -EEXIST;
                                goto out;
@@ -493,7 +487,7 @@ static ssize_t iblock_set_configfs_dev_params(struct se_hba *hba,
                        snprintf(ib_dev->ibd_udev_path, SE_UDEV_PATH_LEN,
                                        "%s", arg_p);
                        kfree(arg_p);
-                       printk(KERN_INFO "IBLOCK: Referencing UDEV path: %s\n",
+                       pr_debug("IBLOCK: Referencing UDEV path: %s\n",
                                        ib_dev->ibd_udev_path);
                        ib_dev->ibd_flags |= IBDF_HAS_UDEV_PATH;
                        break;
@@ -516,7 +510,7 @@ static ssize_t iblock_check_configfs_dev_params(
        struct iblock_dev *ibd = se_dev->se_dev_su_ptr;
 
        if (!(ibd->ibd_flags & IBDF_HAS_UDEV_PATH)) {
-               printk(KERN_ERR "Missing udev_path= parameters for IBLOCK\n");
+               pr_err("Missing udev_path= parameters for IBLOCK\n");
                return -EINVAL;
        }
 
@@ -574,15 +568,15 @@ static struct bio *iblock_get_bio(
        struct bio *bio;
 
        bio = bio_alloc_bioset(GFP_NOIO, sg_num, ib_dev->ibd_bio_set);
-       if (!(bio)) {
-               printk(KERN_ERR "Unable to allocate memory for bio\n");
+       if (!bio) {
+               pr_err("Unable to allocate memory for bio\n");
                *ret = PYX_TRANSPORT_OUT_OF_MEMORY_RESOURCES;
                return NULL;
        }
 
-       DEBUG_IBLOCK("Allocated bio: %p task_sg_num: %u using ibd_bio_set:"
-               " %p\n", bio, task->task_sg_num, ib_dev->ibd_bio_set);
-       DEBUG_IBLOCK("Allocated bio: %p task_size: %u\n", bio, task->task_size);
+       pr_debug("Allocated bio: %p task_sg_nents: %u using ibd_bio_set:"
+               " %p\n", bio, task->task_sg_nents, ib_dev->ibd_bio_set);
+       pr_debug("Allocated bio: %p task_size: %u\n", bio, task->task_size);
 
        bio->bi_bdev = ib_dev->ibd_bd;
        bio->bi_private = task;
@@ -591,8 +585,8 @@ static struct bio *iblock_get_bio(
        bio->bi_sector = lba;
        atomic_inc(&ib_req->ib_bio_cnt);
 
-       DEBUG_IBLOCK("Set bio->bi_sector: %llu\n", bio->bi_sector);
-       DEBUG_IBLOCK("Set ib_req->ib_bio_cnt: %d\n",
+       pr_debug("Set bio->bi_sector: %llu\n", (unsigned long long)bio->bi_sector);
+       pr_debug("Set ib_req->ib_bio_cnt: %d\n",
                        atomic_read(&ib_req->ib_bio_cnt));
        return bio;
 }
@@ -606,7 +600,7 @@ static int iblock_map_task_SG(struct se_task *task)
        struct bio *bio = NULL, *hbio = NULL, *tbio = NULL;
        struct scatterlist *sg;
        int ret = 0;
-       u32 i, sg_num = task->task_sg_num;
+       u32 i, sg_num = task->task_sg_nents;
        sector_t block_lba;
        /*
         * Do starting conversion up from non 512-byte blocksize with
@@ -621,13 +615,13 @@ static int iblock_map_task_SG(struct se_task *task)
        else if (dev->se_sub_dev->se_dev_attrib.block_size == 512)
                block_lba = task->task_lba;
        else {
-               printk(KERN_ERR "Unsupported SCSI -> BLOCK LBA conversion:"
+               pr_err("Unsupported SCSI -> BLOCK LBA conversion:"
                                " %u\n", dev->se_sub_dev->se_dev_attrib.block_size);
                return PYX_TRANSPORT_LU_COMM_FAILURE;
        }
 
        bio = iblock_get_bio(task, ib_req, ib_dev, &ret, block_lba, sg_num);
-       if (!(bio))
+       if (!bio)
                return ret;
 
        ib_req->ib_bio = bio;
@@ -636,41 +630,41 @@ static int iblock_map_task_SG(struct se_task *task)
         * Use fs/bio.c:bio_add_pages() to setup the bio_vec maplist
         * from task->task_sg -> struct scatterlist memory.
         */
-       for_each_sg(task->task_sg, sg, task->task_sg_num, i) {
-               DEBUG_IBLOCK("task: %p bio: %p Calling bio_add_page(): page:"
+       for_each_sg(task->task_sg, sg, task->task_sg_nents, i) {
+               pr_debug("task: %p bio: %p Calling bio_add_page(): page:"
                        " %p len: %u offset: %u\n", task, bio, sg_page(sg),
                                sg->length, sg->offset);
 again:
                ret = bio_add_page(bio, sg_page(sg), sg->length, sg->offset);
                if (ret != sg->length) {
 
-                       DEBUG_IBLOCK("*** Set bio->bi_sector: %llu\n",
-                                       bio->bi_sector);
-                       DEBUG_IBLOCK("** task->task_size: %u\n",
+                       pr_debug("*** Set bio->bi_sector: %llu\n",
+                                (unsigned long long)bio->bi_sector);
+                       pr_debug("** task->task_size: %u\n",
                                        task->task_size);
-                       DEBUG_IBLOCK("*** bio->bi_max_vecs: %u\n",
+                       pr_debug("*** bio->bi_max_vecs: %u\n",
                                        bio->bi_max_vecs);
-                       DEBUG_IBLOCK("*** bio->bi_vcnt: %u\n",
+                       pr_debug("*** bio->bi_vcnt: %u\n",
                                        bio->bi_vcnt);
 
                        bio = iblock_get_bio(task, ib_req, ib_dev, &ret,
                                                block_lba, sg_num);
-                       if (!(bio))
+                       if (!bio)
                                goto fail;
 
                        tbio = tbio->bi_next = bio;
-                       DEBUG_IBLOCK("-----------------> Added +1 bio: %p to"
+                       pr_debug("-----------------> Added +1 bio: %p to"
                                " list, Going to again\n", bio);
                        goto again;
                }
                /* Always in 512 byte units for Linux/Block */
                block_lba += sg->length >> IBLOCK_LBA_SHIFT;
                sg_num--;
-               DEBUG_IBLOCK("task: %p bio-add_page() passed!, decremented"
+               pr_debug("task: %p bio-add_page() passed!, decremented"
                        " sg_num to %u\n", task, sg_num);
-               DEBUG_IBLOCK("task: %p bio_add_page() passed!, increased lba"
-                               " to %llu\n", task, block_lba);
-               DEBUG_IBLOCK("task: %p bio_add_page() passed!, bio->bi_vcnt:"
+               pr_debug("task: %p bio_add_page() passed!, increased lba"
+                        " to %llu\n", task, (unsigned long long)block_lba);
+               pr_debug("task: %p bio_add_page() passed!, bio->bi_vcnt:"
                                " %u\n", task, bio->bi_vcnt);
        }
 
@@ -716,11 +710,11 @@ static void iblock_bio_done(struct bio *bio, int err)
        /*
         * Set -EIO if !BIO_UPTODATE and the passed is still err=0
         */
-       if (!(test_bit(BIO_UPTODATE, &bio->bi_flags)) && !(err))
+       if (!test_bit(BIO_UPTODATE, &bio->bi_flags) && !err)
                err = -EIO;
 
        if (err != 0) {
-               printk(KERN_ERR "test_bit(BIO_UPTODATE) failed for bio: %p,"
+               pr_err("test_bit(BIO_UPTODATE) failed for bio: %p,"
                        " err: %d\n", bio, err);
                /*
                 * Bump the ib_bio_err_cnt and release bio.
@@ -731,15 +725,15 @@ static void iblock_bio_done(struct bio *bio, int err)
                /*
                 * Wait to complete the task until the last bio as completed.
                 */
-               if (!(atomic_dec_and_test(&ibr->ib_bio_cnt)))
+               if (!atomic_dec_and_test(&ibr->ib_bio_cnt))
                        return;
 
                ibr->ib_bio = NULL;
                transport_complete_task(task, 0);
                return;
        }
-       DEBUG_IBLOCK("done[%p] bio: %p task_lba: %llu bio_lba: %llu err=%d\n",
-               task, bio, task->task_lba, bio->bi_sector, err);
+       pr_debug("done[%p] bio: %p task_lba: %llu bio_lba: %llu err=%d\n",
+                task, bio, task->task_lba, (unsigned long long)bio->bi_sector, err);
        /*
         * bio_put() will call iblock_bio_destructor() to release the bio back
         * to ibr->ib_bio_set.
@@ -748,7 +742,7 @@ static void iblock_bio_done(struct bio *bio, int err)
        /*
         * Wait to complete the task until the last bio as completed.
         */
-       if (!(atomic_dec_and_test(&ibr->ib_bio_cnt)))
+       if (!atomic_dec_and_test(&ibr->ib_bio_cnt))
                return;
        /*
         * Return GOOD status for task if zero ib_bio_err_cnt exists.
index 2aa1d27..a121cd1 100644 (file)
@@ -12,7 +12,6 @@ struct iblock_req {
        atomic_t ib_bio_cnt;
        atomic_t ib_bio_err_cnt;
        struct bio *ib_bio;
-       struct iblock_dev *ib_dev;
 } ____cacheline_aligned;
 
 #define IBDF_HAS_UDEV_PATH             0x01
index 3342843..1c1b849 100644 (file)
@@ -62,7 +62,7 @@ int core_pr_dump_initiator_port(
        char *buf,
        u32 size)
 {
-       if (!(pr_reg->isid_present_at_reg))
+       if (!pr_reg->isid_present_at_reg)
                return 0;
 
        snprintf(buf, size, ",i,0x%s", &pr_reg->pr_reg_isid[0]);
@@ -95,7 +95,7 @@ static int core_scsi2_reservation_check(struct se_cmd *cmd, u32 *pr_reg_type)
        struct se_session *sess = cmd->se_sess;
        int ret;
 
-       if (!(sess))
+       if (!sess)
                return 0;
 
        spin_lock(&dev->dev_reservation_lock);
@@ -123,7 +123,7 @@ static int core_scsi2_reservation_release(struct se_cmd *cmd)
        struct se_session *sess = cmd->se_sess;
        struct se_portal_group *tpg = sess->se_tpg;
 
-       if (!(sess) || !(tpg))
+       if (!sess || !tpg)
                return 0;
 
        spin_lock(&dev->dev_reservation_lock);
@@ -142,7 +142,7 @@ static int core_scsi2_reservation_release(struct se_cmd *cmd)
                dev->dev_res_bin_isid = 0;
                dev->dev_flags &= ~DF_SPC2_RESERVATIONS_WITH_ISID;
        }
-       printk(KERN_INFO "SCSI-2 Released reservation for %s LUN: %u ->"
+       pr_debug("SCSI-2 Released reservation for %s LUN: %u ->"
                " MAPPED LUN: %u for %s\n", tpg->se_tpg_tfo->get_fabric_name(),
                cmd->se_lun->unpacked_lun, cmd->se_deve->mapped_lun,
                sess->se_node_acl->initiatorname);
@@ -159,7 +159,7 @@ static int core_scsi2_reservation_reserve(struct se_cmd *cmd)
 
        if ((cmd->t_task_cdb[1] & 0x01) &&
            (cmd->t_task_cdb[1] & 0x02)) {
-               printk(KERN_ERR "LongIO and Obselete Bits set, returning"
+               pr_err("LongIO and Obselete Bits set, returning"
                                " ILLEGAL_REQUEST\n");
                return PYX_TRANSPORT_ILLEGAL_REQUEST;
        }
@@ -167,18 +167,18 @@ static int core_scsi2_reservation_reserve(struct se_cmd *cmd)
         * This is currently the case for target_core_mod passthrough struct se_cmd
         * ops
         */
-       if (!(sess) || !(tpg))
+       if (!sess || !tpg)
                return 0;
 
        spin_lock(&dev->dev_reservation_lock);
        if (dev->dev_reserved_node_acl &&
           (dev->dev_reserved_node_acl != sess->se_node_acl)) {
-               printk(KERN_ERR "SCSI-2 RESERVATION CONFLIFT for %s fabric\n",
+               pr_err("SCSI-2 RESERVATION CONFLIFT for %s fabric\n",
                        tpg->se_tpg_tfo->get_fabric_name());
-               printk(KERN_ERR "Original reserver LUN: %u %s\n",
+               pr_err("Original reserver LUN: %u %s\n",
                        cmd->se_lun->unpacked_lun,
                        dev->dev_reserved_node_acl->initiatorname);
-               printk(KERN_ERR "Current attempt - LUN: %u -> MAPPED LUN: %u"
+               pr_err("Current attempt - LUN: %u -> MAPPED LUN: %u"
                        " from %s \n", cmd->se_lun->unpacked_lun,
                        cmd->se_deve->mapped_lun,
                        sess->se_node_acl->initiatorname);
@@ -192,7 +192,7 @@ static int core_scsi2_reservation_reserve(struct se_cmd *cmd)
                dev->dev_res_bin_isid = sess->sess_bin_isid;
                dev->dev_flags |= DF_SPC2_RESERVATIONS_WITH_ISID;
        }
-       printk(KERN_INFO "SCSI-2 Reserved %s LUN: %u -> MAPPED LUN: %u"
+       pr_debug("SCSI-2 Reserved %s LUN: %u -> MAPPED LUN: %u"
                " for %s\n", tpg->se_tpg_tfo->get_fabric_name(),
                cmd->se_lun->unpacked_lun, cmd->se_deve->mapped_lun,
                sess->se_node_acl->initiatorname);
@@ -220,10 +220,10 @@ int core_scsi2_emulate_crh(struct se_cmd *cmd)
        int crh = (su_dev->t10_pr.res_type == SPC3_PERSISTENT_RESERVATIONS);
        int conflict = 0;
 
-       if (!(se_sess))
+       if (!se_sess)
                return 0;
 
-       if (!(crh))
+       if (!crh)
                goto after_crh;
 
        pr_reg = core_scsi3_locate_pr_reg(cmd->se_dev, se_sess->se_node_acl,
@@ -280,7 +280,7 @@ int core_scsi2_emulate_crh(struct se_cmd *cmd)
        }
 
        if (conflict) {
-               printk(KERN_ERR "Received legacy SPC-2 RESERVE/RELEASE"
+               pr_err("Received legacy SPC-2 RESERVE/RELEASE"
                        " while active SPC-3 registrations exist,"
                        " returning RESERVATION_CONFLICT\n");
                return PYX_TRANSPORT_RESERVATION_CONFLICT;
@@ -412,7 +412,7 @@ static int core_scsi3_pr_seq_non_holder(
                        ret = (registered_nexus) ? 0 : 1;
                        break;
                default:
-                       printk(KERN_ERR "Unknown PERSISTENT_RESERVE_OUT service"
+                       pr_err("Unknown PERSISTENT_RESERVE_OUT service"
                                " action: 0x%02x\n", cdb[1] & 0x1f);
                        return -EINVAL;
                }
@@ -459,7 +459,7 @@ static int core_scsi3_pr_seq_non_holder(
                        ret = 0; /* Allowed */
                        break;
                default:
-                       printk(KERN_ERR "Unknown MI Service Action: 0x%02x\n",
+                       pr_err("Unknown MI Service Action: 0x%02x\n",
                                (cdb[1] & 0x1f));
                        return -EINVAL;
                }
@@ -481,9 +481,9 @@ static int core_scsi3_pr_seq_non_holder(
         * Case where the CDB is explicitly allowed in the above switch
         * statement.
         */
-       if (!(ret) && !(other_cdb)) {
+       if (!ret && !other_cdb) {
 #if 0
-               printk(KERN_INFO "Allowing explict CDB: 0x%02x for %s"
+               pr_debug("Allowing explict CDB: 0x%02x for %s"
                        " reservation holder\n", cdb[0],
                        core_scsi3_pr_dump_type(pr_reg_type));
 #endif
@@ -498,7 +498,7 @@ static int core_scsi3_pr_seq_non_holder(
                        /*
                         * Conflict for write exclusive
                         */
-                       printk(KERN_INFO "%s Conflict for unregistered nexus"
+                       pr_debug("%s Conflict for unregistered nexus"
                                " %s CDB: 0x%02x to %s reservation\n",
                                transport_dump_cmd_direction(cmd),
                                se_sess->se_node_acl->initiatorname, cdb[0],
@@ -515,8 +515,8 @@ static int core_scsi3_pr_seq_non_holder(
                         * nexuses to issue CDBs.
                         */
 #if 0
-                       if (!(registered_nexus)) {
-                               printk(KERN_INFO "Allowing implict CDB: 0x%02x"
+                       if (!registered_nexus) {
+                               pr_debug("Allowing implict CDB: 0x%02x"
                                        " for %s reservation on unregistered"
                                        " nexus\n", cdb[0],
                                        core_scsi3_pr_dump_type(pr_reg_type));
@@ -531,14 +531,14 @@ static int core_scsi3_pr_seq_non_holder(
                         * allow commands from registered nexuses.
                         */
 #if 0
-                       printk(KERN_INFO "Allowing implict CDB: 0x%02x for %s"
+                       pr_debug("Allowing implict CDB: 0x%02x for %s"
                                " reservation\n", cdb[0],
                                core_scsi3_pr_dump_type(pr_reg_type));
 #endif
                        return 0;
                }
        }
-       printk(KERN_INFO "%s Conflict for %sregistered nexus %s CDB: 0x%2x"
+       pr_debug("%s Conflict for %sregistered nexus %s CDB: 0x%2x"
                " for %s reservation\n", transport_dump_cmd_direction(cmd),
                (registered_nexus) ? "" : "un",
                se_sess->se_node_acl->initiatorname, cdb[0],
@@ -575,7 +575,7 @@ static int core_scsi3_pr_reservation_check(
        struct se_session *sess = cmd->se_sess;
        int ret;
 
-       if (!(sess))
+       if (!sess)
                return 0;
        /*
         * A legacy SPC-2 reservation is being held.
@@ -584,7 +584,7 @@ static int core_scsi3_pr_reservation_check(
                return core_scsi2_reservation_check(cmd, pr_reg_type);
 
        spin_lock(&dev->dev_reservation_lock);
-       if (!(dev->dev_pr_res_holder)) {
+       if (!dev->dev_pr_res_holder) {
                spin_unlock(&dev->dev_reservation_lock);
                return 0;
        }
@@ -594,7 +594,7 @@ static int core_scsi3_pr_reservation_check(
                spin_unlock(&dev->dev_reservation_lock);
                return -EINVAL;
        }
-       if (!(dev->dev_pr_res_holder->isid_present_at_reg)) {
+       if (!dev->dev_pr_res_holder->isid_present_at_reg) {
                spin_unlock(&dev->dev_reservation_lock);
                return 0;
        }
@@ -624,15 +624,15 @@ static struct t10_pr_registration *__core_scsi3_do_alloc_registration(
        struct t10_pr_registration *pr_reg;
 
        pr_reg = kmem_cache_zalloc(t10_pr_reg_cache, GFP_ATOMIC);
-       if (!(pr_reg)) {
-               printk(KERN_ERR "Unable to allocate struct t10_pr_registration\n");
+       if (!pr_reg) {
+               pr_err("Unable to allocate struct t10_pr_registration\n");
                return NULL;
        }
 
        pr_reg->pr_aptpl_buf = kzalloc(su_dev->t10_pr.pr_aptpl_buf_len,
                                        GFP_ATOMIC);
-       if (!(pr_reg->pr_aptpl_buf)) {
-               printk(KERN_ERR "Unable to allocate pr_reg->pr_aptpl_buf\n");
+       if (!pr_reg->pr_aptpl_buf) {
+               pr_err("Unable to allocate pr_reg->pr_aptpl_buf\n");
                kmem_cache_free(t10_pr_reg_cache, pr_reg);
                return NULL;
        }
@@ -692,12 +692,12 @@ static struct t10_pr_registration *__core_scsi3_alloc_registration(
         */
        pr_reg = __core_scsi3_do_alloc_registration(dev, nacl, deve, isid,
                        sa_res_key, all_tg_pt, aptpl);
-       if (!(pr_reg))
+       if (!pr_reg)
                return NULL;
        /*
         * Return pointer to pr_reg for ALL_TG_PT=0
         */
-       if (!(all_tg_pt))
+       if (!all_tg_pt)
                return pr_reg;
        /*
         * Create list of matching SCSI Initiator Port registrations
@@ -717,7 +717,7 @@ static struct t10_pr_registration *__core_scsi3_alloc_registration(
                         * that have not been make explict via a ConfigFS
                         * MappedLUN group for the SCSI Initiator Node ACL.
                         */
-                       if (!(deve_tmp->se_lun_acl))
+                       if (!deve_tmp->se_lun_acl)
                                continue;
 
                        nacl_tmp = deve_tmp->se_lun_acl->se_lun_nacl;
@@ -751,7 +751,7 @@ static struct t10_pr_registration *__core_scsi3_alloc_registration(
                         */
                        ret = core_scsi3_lunacl_depend_item(deve_tmp);
                        if (ret < 0) {
-                               printk(KERN_ERR "core_scsi3_lunacl_depend"
+                               pr_err("core_scsi3_lunacl_depend"
                                                "_item() failed\n");
                                atomic_dec(&port->sep_tg_pt_ref_cnt);
                                smp_mb__after_atomic_dec();
@@ -769,7 +769,7 @@ static struct t10_pr_registration *__core_scsi3_alloc_registration(
                        pr_reg_atp = __core_scsi3_do_alloc_registration(dev,
                                                nacl_tmp, deve_tmp, NULL,
                                                sa_res_key, all_tg_pt, aptpl);
-                       if (!(pr_reg_atp)) {
+                       if (!pr_reg_atp) {
                                atomic_dec(&port->sep_tg_pt_ref_cnt);
                                smp_mb__after_atomic_dec();
                                atomic_dec(&deve_tmp->pr_ref_count);
@@ -817,14 +817,14 @@ int core_scsi3_alloc_aptpl_registration(
 {
        struct t10_pr_registration *pr_reg;
 
-       if (!(i_port) || !(t_port) || !(sa_res_key)) {
-               printk(KERN_ERR "Illegal parameters for APTPL registration\n");
+       if (!i_port || !t_port || !sa_res_key) {
+               pr_err("Illegal parameters for APTPL registration\n");
                return -EINVAL;
        }
 
        pr_reg = kmem_cache_zalloc(t10_pr_reg_cache, GFP_KERNEL);
-       if (!(pr_reg)) {
-               printk(KERN_ERR "Unable to allocate struct t10_pr_registration\n");
+       if (!pr_reg) {
+               pr_err("Unable to allocate struct t10_pr_registration\n");
                return -ENOMEM;
        }
        pr_reg->pr_aptpl_buf = kzalloc(pr_tmpl->pr_aptpl_buf_len, GFP_KERNEL);
@@ -869,7 +869,7 @@ int core_scsi3_alloc_aptpl_registration(
        pr_reg->pr_res_holder = res_holder;
 
        list_add_tail(&pr_reg->pr_reg_aptpl_list, &pr_tmpl->aptpl_reg_list);
-       printk(KERN_INFO "SPC-3 PR APTPL Successfully added registration%s from"
+       pr_debug("SPC-3 PR APTPL Successfully added registration%s from"
                        " metadata\n", (res_holder) ? "+reservation" : "");
        return 0;
 }
@@ -891,12 +891,12 @@ static void core_scsi3_aptpl_reserve(
        dev->dev_pr_res_holder = pr_reg;
        spin_unlock(&dev->dev_reservation_lock);
 
-       printk(KERN_INFO "SPC-3 PR [%s] Service Action: APTPL RESERVE created"
+       pr_debug("SPC-3 PR [%s] Service Action: APTPL RESERVE created"
                " new reservation holder TYPE: %s ALL_TG_PT: %d\n",
                tpg->se_tpg_tfo->get_fabric_name(),
                core_scsi3_pr_dump_type(pr_reg->pr_res_type),
                (pr_reg->pr_reg_all_tg_pt) ? 1 : 0);
-       printk(KERN_INFO "SPC-3 PR [%s] RESERVE Node: %s%s\n",
+       pr_debug("SPC-3 PR [%s] RESERVE Node: %s%s\n",
                tpg->se_tpg_tfo->get_fabric_name(), node_acl->initiatorname,
                (prf_isid) ? &i_buf[0] : "");
 }
@@ -936,7 +936,7 @@ static int __core_scsi3_check_aptpl_registration(
        spin_lock(&pr_tmpl->aptpl_reg_lock);
        list_for_each_entry_safe(pr_reg, pr_reg_tmp, &pr_tmpl->aptpl_reg_list,
                                pr_reg_aptpl_list) {
-               if (!(strcmp(pr_reg->pr_iport, i_port)) &&
+               if (!strcmp(pr_reg->pr_iport, i_port) &&
                     (pr_reg->pr_res_mapped_lun == deve->mapped_lun) &&
                    !(strcmp(pr_reg->pr_tport, t_port)) &&
                     (pr_reg->pr_reg_tpgt == tpgt) &&
@@ -1006,19 +1006,19 @@ static void __core_scsi3_dump_registration(
        prf_isid = core_pr_dump_initiator_port(pr_reg, &i_buf[0],
                                PR_REG_ISID_ID_LEN);
 
-       printk(KERN_INFO "SPC-3 PR [%s] Service Action: REGISTER%s Initiator"
+       pr_debug("SPC-3 PR [%s] Service Action: REGISTER%s Initiator"
                " Node: %s%s\n", tfo->get_fabric_name(), (register_type == 2) ?
                "_AND_MOVE" : (register_type == 1) ?
                "_AND_IGNORE_EXISTING_KEY" : "", nacl->initiatorname,
                (prf_isid) ? i_buf : "");
-       printk(KERN_INFO "SPC-3 PR [%s] registration on Target Port: %s,0x%04x\n",
+       pr_debug("SPC-3 PR [%s] registration on Target Port: %s,0x%04x\n",
                 tfo->get_fabric_name(), tfo->tpg_get_wwn(se_tpg),
                tfo->tpg_get_tag(se_tpg));
-       printk(KERN_INFO "SPC-3 PR [%s] for %s TCM Subsystem %s Object Target"
+       pr_debug("SPC-3 PR [%s] for %s TCM Subsystem %s Object Target"
                " Port(s)\n",  tfo->get_fabric_name(),
                (pr_reg->pr_reg_all_tg_pt) ? "ALL" : "SINGLE",
                dev->transport->name);
-       printk(KERN_INFO "SPC-3 PR [%s] SA Res Key: 0x%016Lx PRgeneration:"
+       pr_debug("SPC-3 PR [%s] SA Res Key: 0x%016Lx PRgeneration:"
                " 0x%08x  APTPL: %d\n", tfo->get_fabric_name(),
                pr_reg->pr_res_key, pr_reg->pr_res_generation,
                pr_reg->pr_reg_aptpl);
@@ -1062,7 +1062,7 @@ static void __core_scsi3_add_registration(
        /*
         * Skip extra processing for ALL_TG_PT=0 or REGISTER_AND_MOVE.
         */
-       if (!(pr_reg->pr_reg_all_tg_pt) || (register_move))
+       if (!pr_reg->pr_reg_all_tg_pt || register_move)
                return;
        /*
         * Walk pr_reg->pr_reg_atp_list and add registrations for ALL_TG_PT=1
@@ -1106,7 +1106,7 @@ static int core_scsi3_alloc_registration(
 
        pr_reg = __core_scsi3_alloc_registration(dev, nacl, deve, isid,
                        sa_res_key, all_tg_pt, aptpl);
-       if (!(pr_reg))
+       if (!pr_reg)
                return -EPERM;
 
        __core_scsi3_add_registration(dev, nacl, pr_reg,
@@ -1137,7 +1137,7 @@ static struct t10_pr_registration *__core_scsi3_locate_pr_reg(
                 * If this registration does NOT contain a fabric provided
                 * ISID, then we have found a match.
                 */
-               if (!(pr_reg->isid_present_at_reg)) {
+               if (!pr_reg->isid_present_at_reg) {
                        /*
                         * Determine if this SCSI device server requires that
                         * SCSI Intiatior TransportID w/ ISIDs is enforced
@@ -1157,7 +1157,7 @@ static struct t10_pr_registration *__core_scsi3_locate_pr_reg(
                 * SCSI Initiator Port TransportIDs, then we expect a valid
                 * matching ISID to be provided by the local SCSI Initiator Port.
                 */
-               if (!(isid))
+               if (!isid)
                        continue;
                if (strcmp(isid, pr_reg->pr_reg_isid))
                        continue;
@@ -1206,7 +1206,7 @@ static int core_scsi3_check_implict_release(
 
        spin_lock(&dev->dev_reservation_lock);
        pr_res_holder = dev->dev_pr_res_holder;
-       if (!(pr_res_holder)) {
+       if (!pr_res_holder) {
                spin_unlock(&dev->dev_reservation_lock);
                return ret;
        }
@@ -1236,7 +1236,7 @@ static int core_scsi3_check_implict_release(
                  (!strcmp(pr_res_holder->pr_reg_nacl->initiatorname,
                          pr_reg->pr_reg_nacl->initiatorname)) &&
                  (pr_res_holder->pr_res_key == pr_reg->pr_res_key)) {
-               printk(KERN_ERR "SPC-3 PR: Unable to perform ALL_TG_PT=1"
+               pr_err("SPC-3 PR: Unable to perform ALL_TG_PT=1"
                        " UNREGISTER while existing reservation with matching"
                        " key 0x%016Lx is present from another SCSI Initiator"
                        " Port\n", pr_reg->pr_res_key);
@@ -1283,25 +1283,25 @@ static void __core_scsi3_free_registration(
         */
        while (atomic_read(&pr_reg->pr_res_holders) != 0) {
                spin_unlock(&pr_tmpl->registration_lock);
-               printk("SPC-3 PR [%s] waiting for pr_res_holders\n",
+               pr_debug("SPC-3 PR [%s] waiting for pr_res_holders\n",
                                tfo->get_fabric_name());
                cpu_relax();
                spin_lock(&pr_tmpl->registration_lock);
        }
 
-       printk(KERN_INFO "SPC-3 PR [%s] Service Action: UNREGISTER Initiator"
+       pr_debug("SPC-3 PR [%s] Service Action: UNREGISTER Initiator"
                " Node: %s%s\n", tfo->get_fabric_name(),
                pr_reg->pr_reg_nacl->initiatorname,
                (prf_isid) ? &i_buf[0] : "");
-       printk(KERN_INFO "SPC-3 PR [%s] for %s TCM Subsystem %s Object Target"
+       pr_debug("SPC-3 PR [%s] for %s TCM Subsystem %s Object Target"
                " Port(s)\n", tfo->get_fabric_name(),
                (pr_reg->pr_reg_all_tg_pt) ? "ALL" : "SINGLE",
                dev->transport->name);
-       printk(KERN_INFO "SPC-3 PR [%s] SA Res Key: 0x%016Lx PRgeneration:"
+       pr_debug("SPC-3 PR [%s] SA Res Key: 0x%016Lx PRgeneration:"
                " 0x%08x\n", tfo->get_fabric_name(), pr_reg->pr_res_key,
                pr_reg->pr_res_generation);
 
-       if (!(preempt_and_abort_list)) {
+       if (!preempt_and_abort_list) {
                pr_reg->pr_reg_deve = NULL;
                pr_reg->pr_reg_nacl = NULL;
                kfree(pr_reg->pr_aptpl_buf);
@@ -1430,7 +1430,7 @@ static int core_scsi3_lunacl_depend_item(struct se_dev_entry *se_deve)
        /*
         * For nacl->dynamic_node_acl=1
         */
-       if (!(lun_acl))
+       if (!lun_acl)
                return 0;
 
        nacl = lun_acl->se_lun_nacl;
@@ -1448,7 +1448,7 @@ static void core_scsi3_lunacl_undepend_item(struct se_dev_entry *se_deve)
        /*
         * For nacl->dynamic_node_acl=1
         */
-       if (!(lun_acl)) {
+       if (!lun_acl) {
                atomic_dec(&se_deve->pr_ref_count);
                smp_mb__after_atomic_dec();
                return;
@@ -1500,8 +1500,8 @@ static int core_scsi3_decode_spec_i_port(
         * processing in the loop of tid_dest_list below.
         */
        tidh_new = kzalloc(sizeof(struct pr_transport_id_holder), GFP_KERNEL);
-       if (!(tidh_new)) {
-               printk(KERN_ERR "Unable to allocate tidh_new\n");
+       if (!tidh_new) {
+               pr_err("Unable to allocate tidh_new\n");
                return PYX_TRANSPORT_LU_COMM_FAILURE;
        }
        INIT_LIST_HEAD(&tidh_new->dest_list);
@@ -1512,7 +1512,7 @@ static int core_scsi3_decode_spec_i_port(
        local_pr_reg = __core_scsi3_alloc_registration(cmd->se_dev,
                                se_sess->se_node_acl, local_se_deve, l_isid,
                                sa_res_key, all_tg_pt, aptpl);
-       if (!(local_pr_reg)) {
+       if (!local_pr_reg) {
                kfree(tidh_new);
                return PYX_TRANSPORT_LU_COMM_FAILURE;
        }
@@ -1537,7 +1537,7 @@ static int core_scsi3_decode_spec_i_port(
        tpdl |= buf[27] & 0xff;
 
        if ((tpdl + 28) != cmd->data_length) {
-               printk(KERN_ERR "SPC-3 PR: Illegal tpdl: %u + 28 byte header"
+               pr_err("SPC-3 PR: Illegal tpdl: %u + 28 byte header"
                        " does not equal CDB data_length: %u\n", tpdl,
                        cmd->data_length);
                ret = PYX_TRANSPORT_INVALID_PARAMETER_LIST;
@@ -1557,13 +1557,13 @@ static int core_scsi3_decode_spec_i_port(
                spin_lock(&dev->se_port_lock);
                list_for_each_entry(tmp_port, &dev->dev_sep_list, sep_list) {
                        tmp_tpg = tmp_port->sep_tpg;
-                       if (!(tmp_tpg))
+                       if (!tmp_tpg)
                                continue;
                        tmp_tf_ops = tmp_tpg->se_tpg_tfo;
-                       if (!(tmp_tf_ops))
+                       if (!tmp_tf_ops)
                                continue;
-                       if (!(tmp_tf_ops->get_fabric_proto_ident) ||
-                           !(tmp_tf_ops->tpg_parse_pr_out_transport_id))
+                       if (!tmp_tf_ops->get_fabric_proto_ident ||
+                           !tmp_tf_ops->tpg_parse_pr_out_transport_id)
                                continue;
                        /*
                         * Look for the matching proto_ident provided by
@@ -1577,7 +1577,7 @@ static int core_scsi3_decode_spec_i_port(
                        i_str = tmp_tf_ops->tpg_parse_pr_out_transport_id(
                                        tmp_tpg, (const char *)ptr, &tid_len,
                                        &iport_ptr);
-                       if (!(i_str))
+                       if (!i_str)
                                continue;
 
                        atomic_inc(&tmp_tpg->tpg_pr_ref_count);
@@ -1586,7 +1586,7 @@ static int core_scsi3_decode_spec_i_port(
 
                        ret = core_scsi3_tpg_depend_item(tmp_tpg);
                        if (ret != 0) {
-                               printk(KERN_ERR " core_scsi3_tpg_depend_item()"
+                               pr_err(" core_scsi3_tpg_depend_item()"
                                        " for tmp_tpg\n");
                                atomic_dec(&tmp_tpg->tpg_pr_ref_count);
                                smp_mb__after_atomic_dec();
@@ -1607,7 +1607,7 @@ static int core_scsi3_decode_spec_i_port(
                        }
                        spin_unlock_bh(&tmp_tpg->acl_node_lock);
 
-                       if (!(dest_node_acl)) {
+                       if (!dest_node_acl) {
                                core_scsi3_tpg_undepend_item(tmp_tpg);
                                spin_lock(&dev->se_port_lock);
                                continue;
@@ -1615,7 +1615,7 @@ static int core_scsi3_decode_spec_i_port(
 
                        ret = core_scsi3_nodeacl_depend_item(dest_node_acl);
                        if (ret != 0) {
-                               printk(KERN_ERR "configfs_depend_item() failed"
+                               pr_err("configfs_depend_item() failed"
                                        " for dest_node_acl->acl_group\n");
                                atomic_dec(&dest_node_acl->acl_pr_ref_count);
                                smp_mb__after_atomic_dec();
@@ -1625,7 +1625,7 @@ static int core_scsi3_decode_spec_i_port(
                        }
 
                        dest_tpg = tmp_tpg;
-                       printk(KERN_INFO "SPC-3 PR SPEC_I_PT: Located %s Node:"
+                       pr_debug("SPC-3 PR SPEC_I_PT: Located %s Node:"
                                " %s Port RTPI: %hu\n",
                                dest_tpg->se_tpg_tfo->get_fabric_name(),
                                dest_node_acl->initiatorname, dest_rtpi);
@@ -1635,20 +1635,20 @@ static int core_scsi3_decode_spec_i_port(
                }
                spin_unlock(&dev->se_port_lock);
 
-               if (!(dest_tpg)) {
-                       printk(KERN_ERR "SPC-3 PR SPEC_I_PT: Unable to locate"
+               if (!dest_tpg) {
+                       pr_err("SPC-3 PR SPEC_I_PT: Unable to locate"
                                        " dest_tpg\n");
                        ret = PYX_TRANSPORT_INVALID_PARAMETER_LIST;
                        goto out;
                }
 #if 0
-               printk("SPC-3 PR SPEC_I_PT: Got %s data_length: %u tpdl: %u"
+               pr_debug("SPC-3 PR SPEC_I_PT: Got %s data_length: %u tpdl: %u"
                        " tid_len: %d for %s + %s\n",
                        dest_tpg->se_tpg_tfo->get_fabric_name(), cmd->data_length,
                        tpdl, tid_len, i_str, iport_ptr);
 #endif
                if (tid_len > tpdl) {
-                       printk(KERN_ERR "SPC-3 PR SPEC_I_PT: Illegal tid_len:"
+                       pr_err("SPC-3 PR SPEC_I_PT: Illegal tid_len:"
                                " %u for Transport ID: %s\n", tid_len, ptr);
                        core_scsi3_nodeacl_undepend_item(dest_node_acl);
                        core_scsi3_tpg_undepend_item(dest_tpg);
@@ -1662,8 +1662,8 @@ static int core_scsi3_decode_spec_i_port(
                 */
                dest_se_deve = core_get_se_deve_from_rtpi(dest_node_acl,
                                        dest_rtpi);
-               if (!(dest_se_deve)) {
-                       printk(KERN_ERR "Unable to locate %s dest_se_deve"
+               if (!dest_se_deve) {
+                       pr_err("Unable to locate %s dest_se_deve"
                                " from destination RTPI: %hu\n",
                                dest_tpg->se_tpg_tfo->get_fabric_name(),
                                dest_rtpi);
@@ -1676,7 +1676,7 @@ static int core_scsi3_decode_spec_i_port(
 
                ret = core_scsi3_lunacl_depend_item(dest_se_deve);
                if (ret < 0) {
-                       printk(KERN_ERR "core_scsi3_lunacl_depend_item()"
+                       pr_err("core_scsi3_lunacl_depend_item()"
                                        " failed\n");
                        atomic_dec(&dest_se_deve->pr_ref_count);
                        smp_mb__after_atomic_dec();
@@ -1686,7 +1686,7 @@ static int core_scsi3_decode_spec_i_port(
                        goto out;
                }
 #if 0
-               printk(KERN_INFO "SPC-3 PR SPEC_I_PT: Located %s Node: %s"
+               pr_debug("SPC-3 PR SPEC_I_PT: Located %s Node: %s"
                        " dest_se_deve mapped_lun: %u\n",
                        dest_tpg->se_tpg_tfo->get_fabric_name(),
                        dest_node_acl->initiatorname, dest_se_deve->mapped_lun);
@@ -1714,8 +1714,8 @@ static int core_scsi3_decode_spec_i_port(
                 */
                tidh_new = kzalloc(sizeof(struct pr_transport_id_holder),
                                GFP_KERNEL);
-               if (!(tidh_new)) {
-                       printk(KERN_ERR "Unable to allocate tidh_new\n");
+               if (!tidh_new) {
+                       pr_err("Unable to allocate tidh_new\n");
                        core_scsi3_lunacl_undepend_item(dest_se_deve);
                        core_scsi3_nodeacl_undepend_item(dest_node_acl);
                        core_scsi3_tpg_undepend_item(dest_tpg);
@@ -1746,7 +1746,7 @@ static int core_scsi3_decode_spec_i_port(
                dest_pr_reg = __core_scsi3_alloc_registration(cmd->se_dev,
                                dest_node_acl, dest_se_deve, iport_ptr,
                                sa_res_key, all_tg_pt, aptpl);
-               if (!(dest_pr_reg)) {
+               if (!dest_pr_reg) {
                        core_scsi3_lunacl_undepend_item(dest_se_deve);
                        core_scsi3_nodeacl_undepend_item(dest_node_acl);
                        core_scsi3_tpg_undepend_item(dest_tpg);
@@ -1795,7 +1795,7 @@ static int core_scsi3_decode_spec_i_port(
                __core_scsi3_add_registration(cmd->se_dev, dest_node_acl,
                                        dest_pr_reg, 0, 0);
 
-               printk(KERN_INFO "SPC-3 PR [%s] SPEC_I_PT: Successfully"
+               pr_debug("SPC-3 PR [%s] SPEC_I_PT: Successfully"
                        " registered Transport ID for Node: %s%s Mapped LUN:"
                        " %u\n", dest_tpg->se_tpg_tfo->get_fabric_name(),
                        dest_node_acl->initiatorname, (prf_isid) ?
@@ -1923,7 +1923,7 @@ static int __core_scsi3_update_aptpl_buf(
                }
 
                if ((len + strlen(tmp) >= pr_aptpl_buf_len)) {
-                       printk(KERN_ERR "Unable to update renaming"
+                       pr_err("Unable to update renaming"
                                " APTPL metadata\n");
                        spin_unlock(&su_dev->t10_pr.registration_lock);
                        return -EMSGSIZE;
@@ -1941,7 +1941,7 @@ static int __core_scsi3_update_aptpl_buf(
                        lun->lun_sep->sep_rtpi, lun->unpacked_lun, reg_count);
 
                if ((len + strlen(tmp) >= pr_aptpl_buf_len)) {
-                       printk(KERN_ERR "Unable to update renaming"
+                       pr_err("Unable to update renaming"
                                " APTPL metadata\n");
                        spin_unlock(&su_dev->t10_pr.registration_lock);
                        return -EMSGSIZE;
@@ -1951,7 +1951,7 @@ static int __core_scsi3_update_aptpl_buf(
        }
        spin_unlock(&su_dev->t10_pr.registration_lock);
 
-       if (!(reg_count))
+       if (!reg_count)
                len += sprintf(buf+len, "No Registrations or Reservations");
 
        return 0;
@@ -1993,7 +1993,7 @@ static int __core_scsi3_write_aptpl_to_file(
        memset(path, 0, 512);
 
        if (strlen(&wwn->unit_serial[0]) >= 512) {
-               printk(KERN_ERR "WWN value for struct se_device does not fit"
+               pr_err("WWN value for struct se_device does not fit"
                        " into path buffer\n");
                return -EMSGSIZE;
        }
@@ -2001,13 +2001,13 @@ static int __core_scsi3_write_aptpl_to_file(
        snprintf(path, 512, "/var/target/pr/aptpl_%s", &wwn->unit_serial[0]);
        file = filp_open(path, flags, 0600);
        if (IS_ERR(file) || !file || !file->f_dentry) {
-               printk(KERN_ERR "filp_open(%s) for APTPL metadata"
+               pr_err("filp_open(%s) for APTPL metadata"
                        " failed\n", path);
                return (PTR_ERR(file) < 0 ? PTR_ERR(file) : -ENOENT);
        }
 
        iov[0].iov_base = &buf[0];
-       if (!(pr_aptpl_buf_len))
+       if (!pr_aptpl_buf_len)
                iov[0].iov_len = (strlen(&buf[0]) + 1); /* Add extra for NULL */
        else
                iov[0].iov_len = pr_aptpl_buf_len;
@@ -2018,7 +2018,7 @@ static int __core_scsi3_write_aptpl_to_file(
        set_fs(old_fs);
 
        if (ret < 0) {
-               printk("Error writing APTPL metadata file: %s\n", path);
+               pr_debug("Error writing APTPL metadata file: %s\n", path);
                filp_close(file, NULL);
                return -EIO;
        }
@@ -2038,7 +2038,7 @@ static int core_scsi3_update_and_write_aptpl(
        /*
         * Can be called with a NULL pointer from PROUT service action CLEAR
         */
-       if (!(in_buf)) {
+       if (!in_buf) {
                memset(null_buf, 0, 64);
                buf = &null_buf[0];
                /*
@@ -2088,8 +2088,8 @@ static int core_scsi3_emulate_pro_register(
        unsigned char isid_buf[PR_REG_ISID_LEN], *isid_ptr = NULL;
        int pr_holder = 0, ret = 0, type;
 
-       if (!(se_sess) || !(se_lun)) {
-               printk(KERN_ERR "SPC-3 PR: se_sess || struct se_lun is NULL!\n");
+       if (!se_sess || !se_lun) {
+               pr_err("SPC-3 PR: se_sess || struct se_lun is NULL!\n");
                return PYX_TRANSPORT_LU_COMM_FAILURE;
        }
        se_tpg = se_sess->se_tpg;
@@ -2105,19 +2105,19 @@ static int core_scsi3_emulate_pro_register(
         * Follow logic from spc4r17 Section 5.7.7, Register Behaviors Table 47
         */
        pr_reg_e = core_scsi3_locate_pr_reg(dev, se_sess->se_node_acl, se_sess);
-       if (!(pr_reg_e)) {
+       if (!pr_reg_e) {
                if (res_key) {
-                       printk(KERN_WARNING "SPC-3 PR: Reservation Key non-zero"
+                       pr_warn("SPC-3 PR: Reservation Key non-zero"
                                " for SA REGISTER, returning CONFLICT\n");
                        return PYX_TRANSPORT_RESERVATION_CONFLICT;
                }
                /*
                 * Do nothing but return GOOD status.
                 */
-               if (!(sa_res_key))
+               if (!sa_res_key)
                        return PYX_TRANSPORT_SENT_TO_TRANSPORT;
 
-               if (!(spec_i_pt)) {
+               if (!spec_i_pt) {
                        /*
                         * Perform the Service Action REGISTER on the Initiator
                         * Port Endpoint that the PRO was received from on the
@@ -2128,7 +2128,7 @@ static int core_scsi3_emulate_pro_register(
                                        sa_res_key, all_tg_pt, aptpl,
                                        ignore_key, 0);
                        if (ret != 0) {
-                               printk(KERN_ERR "Unable to allocate"
+                               pr_err("Unable to allocate"
                                        " struct t10_pr_registration\n");
                                return PYX_TRANSPORT_INVALID_PARAMETER_LIST;
                        }
@@ -2149,10 +2149,10 @@ static int core_scsi3_emulate_pro_register(
                /*
                 * Nothing left to do for the APTPL=0 case.
                 */
-               if (!(aptpl)) {
+               if (!aptpl) {
                        pr_tmpl->pr_aptpl_active = 0;
                        core_scsi3_update_and_write_aptpl(cmd->se_dev, NULL, 0);
-                       printk("SPC-3 PR: Set APTPL Bit Deactivated for"
+                       pr_debug("SPC-3 PR: Set APTPL Bit Deactivated for"
                                        " REGISTER\n");
                        return 0;
                }
@@ -2167,9 +2167,9 @@ static int core_scsi3_emulate_pro_register(
                ret = core_scsi3_update_and_write_aptpl(cmd->se_dev,
                                &pr_reg->pr_aptpl_buf[0],
                                pr_tmpl->pr_aptpl_buf_len);
-               if (!(ret)) {
+               if (!ret) {
                        pr_tmpl->pr_aptpl_active = 1;
-                       printk("SPC-3 PR: Set APTPL Bit Activated for REGISTER\n");
+                       pr_debug("SPC-3 PR: Set APTPL Bit Activated for REGISTER\n");
                }
 
                core_scsi3_put_pr_reg(pr_reg);
@@ -2181,9 +2181,9 @@ static int core_scsi3_emulate_pro_register(
                pr_reg = pr_reg_e;
                type = pr_reg->pr_res_type;
 
-               if (!(ignore_key)) {
+               if (!ignore_key) {
                        if (res_key != pr_reg->pr_res_key) {
-                               printk(KERN_ERR "SPC-3 PR REGISTER: Received"
+                               pr_err("SPC-3 PR REGISTER: Received"
                                        " res_key: 0x%016Lx does not match"
                                        " existing SA REGISTER res_key:"
                                        " 0x%016Lx\n", res_key,
@@ -2193,7 +2193,7 @@ static int core_scsi3_emulate_pro_register(
                        }
                }
                if (spec_i_pt) {
-                       printk(KERN_ERR "SPC-3 PR UNREGISTER: SPEC_I_PT"
+                       pr_err("SPC-3 PR UNREGISTER: SPEC_I_PT"
                                " set while sa_res_key=0\n");
                        core_scsi3_put_pr_reg(pr_reg);
                        return PYX_TRANSPORT_INVALID_PARAMETER_LIST;
@@ -2203,7 +2203,7 @@ static int core_scsi3_emulate_pro_register(
                 * must also set ALL_TG_PT=1 in the incoming PROUT.
                 */
                if (pr_reg->pr_reg_all_tg_pt && !(all_tg_pt)) {
-                       printk(KERN_ERR "SPC-3 PR UNREGISTER: ALL_TG_PT=1"
+                       pr_err("SPC-3 PR UNREGISTER: ALL_TG_PT=1"
                                " registration exists, but ALL_TG_PT=1 bit not"
                                " present in received PROUT\n");
                        core_scsi3_put_pr_reg(pr_reg);
@@ -2215,8 +2215,8 @@ static int core_scsi3_emulate_pro_register(
                if (aptpl) {
                        pr_aptpl_buf = kzalloc(pr_tmpl->pr_aptpl_buf_len,
                                                GFP_KERNEL);
-                       if (!(pr_aptpl_buf)) {
-                               printk(KERN_ERR "Unable to allocate"
+                       if (!pr_aptpl_buf) {
+                               pr_err("Unable to allocate"
                                        " pr_aptpl_buf\n");
                                core_scsi3_put_pr_reg(pr_reg);
                                return PYX_TRANSPORT_LU_COMM_FAILURE;
@@ -2227,7 +2227,7 @@ static int core_scsi3_emulate_pro_register(
                 * Nexus sa_res_key=1 Change Reservation Key for registered I_T
                 * Nexus.
                 */
-               if (!(sa_res_key)) {
+               if (!sa_res_key) {
                        pr_holder = core_scsi3_check_implict_release(
                                        cmd->se_dev, pr_reg);
                        if (pr_holder < 0) {
@@ -2246,7 +2246,7 @@ static int core_scsi3_emulate_pro_register(
                                                &pr_tmpl->registration_list,
                                                pr_reg_list) {
 
-                                       if (!(pr_reg_p->pr_reg_all_tg_pt))
+                                       if (!pr_reg_p->pr_reg_all_tg_pt)
                                                continue;
 
                                        if (pr_reg_p->pr_res_key != res_key)
@@ -2295,10 +2295,10 @@ static int core_scsi3_emulate_pro_register(
                        }
                        spin_unlock(&pr_tmpl->registration_lock);
 
-                       if (!(aptpl)) {
+                       if (!aptpl) {
                                pr_tmpl->pr_aptpl_active = 0;
                                core_scsi3_update_and_write_aptpl(dev, NULL, 0);
-                               printk("SPC-3 PR: Set APTPL Bit Deactivated"
+                               pr_debug("SPC-3 PR: Set APTPL Bit Deactivated"
                                                " for UNREGISTER\n");
                                return 0;
                        }
@@ -2306,9 +2306,9 @@ static int core_scsi3_emulate_pro_register(
                        ret = core_scsi3_update_and_write_aptpl(dev,
                                        &pr_aptpl_buf[0],
                                        pr_tmpl->pr_aptpl_buf_len);
-                       if (!(ret)) {
+                       if (!ret) {
                                pr_tmpl->pr_aptpl_active = 1;
-                               printk("SPC-3 PR: Set APTPL Bit Activated"
+                               pr_debug("SPC-3 PR: Set APTPL Bit Activated"
                                                " for UNREGISTER\n");
                        }
 
@@ -2323,18 +2323,18 @@ static int core_scsi3_emulate_pro_register(
                        pr_reg->pr_res_generation = core_scsi3_pr_generation(
                                                        cmd->se_dev);
                        pr_reg->pr_res_key = sa_res_key;
-                       printk("SPC-3 PR [%s] REGISTER%s: Changed Reservation"
+                       pr_debug("SPC-3 PR [%s] REGISTER%s: Changed Reservation"
                                " Key for %s to: 0x%016Lx PRgeneration:"
                                " 0x%08x\n", cmd->se_tfo->get_fabric_name(),
                                (ignore_key) ? "_AND_IGNORE_EXISTING_KEY" : "",
                                pr_reg->pr_reg_nacl->initiatorname,
                                pr_reg->pr_res_key, pr_reg->pr_res_generation);
 
-                       if (!(aptpl)) {
+                       if (!aptpl) {
                                pr_tmpl->pr_aptpl_active = 0;
                                core_scsi3_update_and_write_aptpl(dev, NULL, 0);
                                core_scsi3_put_pr_reg(pr_reg);
-                               printk("SPC-3 PR: Set APTPL Bit Deactivated"
+                               pr_debug("SPC-3 PR: Set APTPL Bit Deactivated"
                                                " for REGISTER\n");
                                return 0;
                        }
@@ -2342,9 +2342,9 @@ static int core_scsi3_emulate_pro_register(
                        ret = core_scsi3_update_and_write_aptpl(dev,
                                        &pr_aptpl_buf[0],
                                        pr_tmpl->pr_aptpl_buf_len);
-                       if (!(ret)) {
+                       if (!ret) {
                                pr_tmpl->pr_aptpl_active = 1;
-                               printk("SPC-3 PR: Set APTPL Bit Activated"
+                               pr_debug("SPC-3 PR: Set APTPL Bit Activated"
                                                " for REGISTER\n");
                        }
 
@@ -2395,8 +2395,8 @@ static int core_scsi3_pro_reserve(
 
        memset(i_buf, 0, PR_REG_ISID_ID_LEN);
 
-       if (!(se_sess) || !(se_lun)) {
-               printk(KERN_ERR "SPC-3 PR: se_sess || struct se_lun is NULL!\n");
+       if (!se_sess || !se_lun) {
+               pr_err("SPC-3 PR: se_sess || struct se_lun is NULL!\n");
                return PYX_TRANSPORT_LU_COMM_FAILURE;
        }
        se_tpg = se_sess->se_tpg;
@@ -2406,8 +2406,8 @@ static int core_scsi3_pro_reserve(
         */
        pr_reg = core_scsi3_locate_pr_reg(cmd->se_dev, se_sess->se_node_acl,
                                se_sess);
-       if (!(pr_reg)) {
-               printk(KERN_ERR "SPC-3 PR: Unable to locate"
+       if (!pr_reg) {
+               pr_err("SPC-3 PR: Unable to locate"
                        " PR_REGISTERED *pr_reg for RESERVE\n");
                return PYX_TRANSPORT_LU_COMM_FAILURE;
        }
@@ -2421,7 +2421,7 @@ static int core_scsi3_pro_reserve(
         *       registered with the logical unit for the I_T nexus; and
         */
        if (res_key != pr_reg->pr_res_key) {
-               printk(KERN_ERR "SPC-3 PR RESERVE: Received res_key: 0x%016Lx"
+               pr_err("SPC-3 PR RESERVE: Received res_key: 0x%016Lx"
                        " does not match existing SA REGISTER res_key:"
                        " 0x%016Lx\n", res_key, pr_reg->pr_res_key);
                core_scsi3_put_pr_reg(pr_reg);
@@ -2438,7 +2438,7 @@ static int core_scsi3_pro_reserve(
         * and that persistent reservation has a scope of LU_SCOPE.
         */
        if (scope != PR_SCOPE_LU_SCOPE) {
-               printk(KERN_ERR "SPC-3 PR: Illegal SCOPE: 0x%02x\n", scope);
+               pr_err("SPC-3 PR: Illegal SCOPE: 0x%02x\n", scope);
                core_scsi3_put_pr_reg(pr_reg);
                return PYX_TRANSPORT_INVALID_PARAMETER_LIST;
        }
@@ -2462,7 +2462,7 @@ static int core_scsi3_pro_reserve(
                 */
                if (pr_res_holder != pr_reg) {
                        struct se_node_acl *pr_res_nacl = pr_res_holder->pr_reg_nacl;
-                       printk(KERN_ERR "SPC-3 PR: Attempted RESERVE from"
+                       pr_err("SPC-3 PR: Attempted RESERVE from"
                                " [%s]: %s while reservation already held by"
                                " [%s]: %s, returning RESERVATION_CONFLICT\n",
                                cmd->se_tfo->get_fabric_name(),
@@ -2484,7 +2484,7 @@ static int core_scsi3_pro_reserve(
                if ((pr_res_holder->pr_res_type != type) ||
                    (pr_res_holder->pr_res_scope != scope)) {
                        struct se_node_acl *pr_res_nacl = pr_res_holder->pr_reg_nacl;
-                       printk(KERN_ERR "SPC-3 PR: Attempted RESERVE from"
+                       pr_err("SPC-3 PR: Attempted RESERVE from"
                                " [%s]: %s trying to change TYPE and/or SCOPE,"
                                " while reservation already held by [%s]: %s,"
                                " returning RESERVATION_CONFLICT\n",
@@ -2522,11 +2522,11 @@ static int core_scsi3_pro_reserve(
        prf_isid = core_pr_dump_initiator_port(pr_reg, &i_buf[0],
                                PR_REG_ISID_ID_LEN);
 
-       printk(KERN_INFO "SPC-3 PR [%s] Service Action: RESERVE created new"
+       pr_debug("SPC-3 PR [%s] Service Action: RESERVE created new"
                " reservation holder TYPE: %s ALL_TG_PT: %d\n",
                cmd->se_tfo->get_fabric_name(), core_scsi3_pr_dump_type(type),
                (pr_reg->pr_reg_all_tg_pt) ? 1 : 0);
-       printk(KERN_INFO "SPC-3 PR [%s] RESERVE Node: %s%s\n",
+       pr_debug("SPC-3 PR [%s] RESERVE Node: %s%s\n",
                        cmd->se_tfo->get_fabric_name(),
                        se_sess->se_node_acl->initiatorname,
                        (prf_isid) ? &i_buf[0] : "");
@@ -2536,8 +2536,8 @@ static int core_scsi3_pro_reserve(
                ret = core_scsi3_update_and_write_aptpl(cmd->se_dev,
                                &pr_reg->pr_aptpl_buf[0],
                                pr_tmpl->pr_aptpl_buf_len);
-               if (!(ret))
-                       printk(KERN_INFO "SPC-3 PR: Updated APTPL metadata"
+               if (!ret)
+                       pr_debug("SPC-3 PR: Updated APTPL metadata"
                                        " for RESERVE\n");
        }
 
@@ -2564,7 +2564,7 @@ static int core_scsi3_emulate_pro_reserve(
                ret = core_scsi3_pro_reserve(cmd, dev, type, scope, res_key);
                break;
        default:
-               printk(KERN_ERR "SPC-3 PR: Unknown Service Action RESERVE Type:"
+               pr_err("SPC-3 PR: Unknown Service Action RESERVE Type:"
                        " 0x%02x\n", type);
                return PYX_TRANSPORT_INVALID_CDB_FIELD;
        }
@@ -2593,12 +2593,12 @@ static void __core_scsi3_complete_pro_release(
         */
        dev->dev_pr_res_holder = NULL;
 
-       printk(KERN_INFO "SPC-3 PR [%s] Service Action: %s RELEASE cleared"
+       pr_debug("SPC-3 PR [%s] Service Action: %s RELEASE cleared"
                " reservation holder TYPE: %s ALL_TG_PT: %d\n",
                tfo->get_fabric_name(), (explict) ? "explict" : "implict",
                core_scsi3_pr_dump_type(pr_reg->pr_res_type),
                (pr_reg->pr_reg_all_tg_pt) ? 1 : 0);
-       printk(KERN_INFO "SPC-3 PR [%s] RELEASE Node: %s%s\n",
+       pr_debug("SPC-3 PR [%s] RELEASE Node: %s%s\n",
                tfo->get_fabric_name(), se_nacl->initiatorname,
                (prf_isid) ? &i_buf[0] : "");
        /*
@@ -2620,16 +2620,16 @@ static int core_scsi3_emulate_pro_release(
        struct t10_reservation *pr_tmpl = &dev->se_sub_dev->t10_pr;
        int ret, all_reg = 0;
 
-       if (!(se_sess) || !(se_lun)) {
-               printk(KERN_ERR "SPC-3 PR: se_sess || struct se_lun is NULL!\n");
+       if (!se_sess || !se_lun) {
+               pr_err("SPC-3 PR: se_sess || struct se_lun is NULL!\n");
                return PYX_TRANSPORT_LU_COMM_FAILURE;
        }
        /*
         * Locate the existing *pr_reg via struct se_node_acl pointers
         */
        pr_reg = core_scsi3_locate_pr_reg(dev, se_sess->se_node_acl, se_sess);
-       if (!(pr_reg)) {
-               printk(KERN_ERR "SPC-3 PR: Unable to locate"
+       if (!pr_reg) {
+               pr_err("SPC-3 PR: Unable to locate"
                        " PR_REGISTERED *pr_reg for RELEASE\n");
                return PYX_TRANSPORT_LU_COMM_FAILURE;
        }
@@ -2647,7 +2647,7 @@ static int core_scsi3_emulate_pro_release(
         */
        spin_lock(&dev->dev_reservation_lock);
        pr_res_holder = dev->dev_pr_res_holder;
-       if (!(pr_res_holder)) {
+       if (!pr_res_holder) {
                /*
                 * No persistent reservation, return GOOD status.
                 */
@@ -2684,7 +2684,7 @@ static int core_scsi3_emulate_pro_release(
         *        that is registered with the logical unit for the I_T nexus;
         */
        if (res_key != pr_reg->pr_res_key) {
-               printk(KERN_ERR "SPC-3 PR RELEASE: Received res_key: 0x%016Lx"
+               pr_err("SPC-3 PR RELEASE: Received res_key: 0x%016Lx"
                        " does not match existing SA REGISTER res_key:"
                        " 0x%016Lx\n", res_key, pr_reg->pr_res_key);
                spin_unlock(&dev->dev_reservation_lock);
@@ -2700,7 +2700,7 @@ static int core_scsi3_emulate_pro_release(
        if ((pr_res_holder->pr_res_type != type) ||
            (pr_res_holder->pr_res_scope != scope)) {
                struct se_node_acl *pr_res_nacl = pr_res_holder->pr_reg_nacl;
-               printk(KERN_ERR "SPC-3 PR RELEASE: Attempted to release"
+               pr_err("SPC-3 PR RELEASE: Attempted to release"
                        " reservation from [%s]: %s with different TYPE "
                        "and/or SCOPE  while reservation already held by"
                        " [%s]: %s, returning RESERVATION_CONFLICT\n",
@@ -2767,8 +2767,8 @@ write_aptpl:
                ret = core_scsi3_update_and_write_aptpl(cmd->se_dev,
                                &pr_reg->pr_aptpl_buf[0],
                                pr_tmpl->pr_aptpl_buf_len);
-               if (!(ret))
-                       printk("SPC-3 PR: Updated APTPL metadata for RELEASE\n");
+               if (!ret)
+                       pr_debug("SPC-3 PR: Updated APTPL metadata for RELEASE\n");
        }
 
        core_scsi3_put_pr_reg(pr_reg);
@@ -2791,8 +2791,8 @@ static int core_scsi3_emulate_pro_clear(
         */
        pr_reg_n = core_scsi3_locate_pr_reg(cmd->se_dev,
                        se_sess->se_node_acl, se_sess);
-       if (!(pr_reg_n)) {
-               printk(KERN_ERR "SPC-3 PR: Unable to locate"
+       if (!pr_reg_n) {
+               pr_err("SPC-3 PR: Unable to locate"
                        " PR_REGISTERED *pr_reg for CLEAR\n");
                        return PYX_TRANSPORT_LU_COMM_FAILURE;
        }
@@ -2808,7 +2808,7 @@ static int core_scsi3_emulate_pro_clear(
         *         that is registered with the logical unit for the I_T nexus.
         */
        if (res_key != pr_reg_n->pr_res_key) {
-               printk(KERN_ERR "SPC-3 PR REGISTER: Received"
+               pr_err("SPC-3 PR REGISTER: Received"
                        " res_key: 0x%016Lx does not match"
                        " existing SA REGISTER res_key:"
                        " 0x%016Lx\n", res_key, pr_reg_n->pr_res_key);
@@ -2845,18 +2845,18 @@ static int core_scsi3_emulate_pro_clear(
                 *    command with CLEAR service action was received, with the
                 *    additional sense code set to RESERVATIONS PREEMPTED.
                 */
-               if (!(calling_it_nexus))
+               if (!calling_it_nexus)
                        core_scsi3_ua_allocate(pr_reg_nacl, pr_res_mapped_lun,
                                0x2A, ASCQ_2AH_RESERVATIONS_PREEMPTED);
        }
        spin_unlock(&pr_tmpl->registration_lock);
 
-       printk(KERN_INFO "SPC-3 PR [%s] Service Action: CLEAR complete\n",
+       pr_debug("SPC-3 PR [%s] Service Action: CLEAR complete\n",
                cmd->se_tfo->get_fabric_name());
 
        if (pr_tmpl->pr_aptpl_active) {
                core_scsi3_update_and_write_aptpl(cmd->se_dev, NULL, 0);
-               printk(KERN_INFO "SPC-3 PR: Updated APTPL metadata"
+               pr_debug("SPC-3 PR: Updated APTPL metadata"
                                " for CLEAR\n");
       &