Commit c1287970 authored by Tomas Winkler's avatar Tomas Winkler Committed by James Bottomley

scsi_debug: define pr_fmt() for consistent logging

Use pr_fmt with both module name and __func__
Also drop few bare printk leftovers

The log format should stay pretty much intact
Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
Acked-by: default avatarDouglas Gilbert <dgilbert@interlog.com>
Reviewed-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarJames Bottomley <JBottomley@Odin.com>
parent 008549f6
...@@ -25,6 +25,9 @@ ...@@ -25,6 +25,9 @@
* module options to "modprobe scsi_debug num_tgts=2" [20021221] * module options to "modprobe scsi_debug num_tgts=2" [20021221]
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ":%s: " fmt, __func__
#include <linux/module.h> #include <linux/module.h>
#include <linux/kernel.h> #include <linux/kernel.h>
...@@ -2446,8 +2449,7 @@ static int dif_verify(struct sd_dif_tuple *sdt, const void *data, ...@@ -2446,8 +2449,7 @@ static int dif_verify(struct sd_dif_tuple *sdt, const void *data,
__be16 csum = dif_compute_csum(data, scsi_debug_sector_size); __be16 csum = dif_compute_csum(data, scsi_debug_sector_size);
if (sdt->guard_tag != csum) { if (sdt->guard_tag != csum) {
pr_err("%s: GUARD check failed on sector %lu rcvd 0x%04x, data 0x%04x\n", pr_err("GUARD check failed on sector %lu rcvd 0x%04x, data 0x%04x\n",
__func__,
(unsigned long)sector, (unsigned long)sector,
be16_to_cpu(sdt->guard_tag), be16_to_cpu(sdt->guard_tag),
be16_to_cpu(csum)); be16_to_cpu(csum));
...@@ -2455,14 +2457,14 @@ static int dif_verify(struct sd_dif_tuple *sdt, const void *data, ...@@ -2455,14 +2457,14 @@ static int dif_verify(struct sd_dif_tuple *sdt, const void *data,
} }
if (scsi_debug_dif == SD_DIF_TYPE1_PROTECTION && if (scsi_debug_dif == SD_DIF_TYPE1_PROTECTION &&
be32_to_cpu(sdt->ref_tag) != (sector & 0xffffffff)) { be32_to_cpu(sdt->ref_tag) != (sector & 0xffffffff)) {
pr_err("%s: REF check failed on sector %lu\n", pr_err("REF check failed on sector %lu\n",
__func__, (unsigned long)sector); (unsigned long)sector);
return 0x03; return 0x03;
} }
if (scsi_debug_dif == SD_DIF_TYPE2_PROTECTION && if (scsi_debug_dif == SD_DIF_TYPE2_PROTECTION &&
be32_to_cpu(sdt->ref_tag) != ei_lba) { be32_to_cpu(sdt->ref_tag) != ei_lba) {
pr_err("%s: REF check failed on sector %lu\n", pr_err("REF check failed on sector %lu\n",
__func__, (unsigned long)sector); (unsigned long)sector);
return 0x03; return 0x03;
} }
return 0; return 0;
...@@ -3449,7 +3451,7 @@ static void sdebug_q_cmd_complete(unsigned long indx) ...@@ -3449,7 +3451,7 @@ static void sdebug_q_cmd_complete(unsigned long indx)
atomic_inc(&sdebug_completions); atomic_inc(&sdebug_completions);
qa_indx = indx; qa_indx = indx;
if ((qa_indx < 0) || (qa_indx >= SCSI_DEBUG_CANQUEUE)) { if ((qa_indx < 0) || (qa_indx >= SCSI_DEBUG_CANQUEUE)) {
pr_err("%s: wild qa_indx=%d\n", __func__, qa_indx); pr_err("wild qa_indx=%d\n", qa_indx);
return; return;
} }
spin_lock_irqsave(&queued_arr_lock, iflags); spin_lock_irqsave(&queued_arr_lock, iflags);
...@@ -3457,21 +3459,21 @@ static void sdebug_q_cmd_complete(unsigned long indx) ...@@ -3457,21 +3459,21 @@ static void sdebug_q_cmd_complete(unsigned long indx)
scp = sqcp->a_cmnd; scp = sqcp->a_cmnd;
if (NULL == scp) { if (NULL == scp) {
spin_unlock_irqrestore(&queued_arr_lock, iflags); spin_unlock_irqrestore(&queued_arr_lock, iflags);
pr_err("%s: scp is NULL\n", __func__); pr_err("scp is NULL\n");
return; return;
} }
devip = (struct sdebug_dev_info *)scp->device->hostdata; devip = (struct sdebug_dev_info *)scp->device->hostdata;
if (devip) if (devip)
atomic_dec(&devip->num_in_q); atomic_dec(&devip->num_in_q);
else else
pr_err("%s: devip=NULL\n", __func__); pr_err("devip=NULL\n");
if (atomic_read(&retired_max_queue) > 0) if (atomic_read(&retired_max_queue) > 0)
retiring = 1; retiring = 1;
sqcp->a_cmnd = NULL; sqcp->a_cmnd = NULL;
if (!test_and_clear_bit(qa_indx, queued_in_use_bm)) { if (!test_and_clear_bit(qa_indx, queued_in_use_bm)) {
spin_unlock_irqrestore(&queued_arr_lock, iflags); spin_unlock_irqrestore(&queued_arr_lock, iflags);
pr_err("%s: Unexpected completion\n", __func__); pr_err("Unexpected completion\n");
return; return;
} }
...@@ -3481,7 +3483,7 @@ static void sdebug_q_cmd_complete(unsigned long indx) ...@@ -3481,7 +3483,7 @@ static void sdebug_q_cmd_complete(unsigned long indx)
retval = atomic_read(&retired_max_queue); retval = atomic_read(&retired_max_queue);
if (qa_indx >= retval) { if (qa_indx >= retval) {
spin_unlock_irqrestore(&queued_arr_lock, iflags); spin_unlock_irqrestore(&queued_arr_lock, iflags);
pr_err("%s: index %d too large\n", __func__, retval); pr_err("index %d too large\n", retval);
return; return;
} }
k = find_last_bit(queued_in_use_bm, retval); k = find_last_bit(queued_in_use_bm, retval);
...@@ -3509,7 +3511,7 @@ sdebug_q_cmd_hrt_complete(struct hrtimer *timer) ...@@ -3509,7 +3511,7 @@ sdebug_q_cmd_hrt_complete(struct hrtimer *timer)
atomic_inc(&sdebug_completions); atomic_inc(&sdebug_completions);
qa_indx = sd_hrtp->qa_indx; qa_indx = sd_hrtp->qa_indx;
if ((qa_indx < 0) || (qa_indx >= SCSI_DEBUG_CANQUEUE)) { if ((qa_indx < 0) || (qa_indx >= SCSI_DEBUG_CANQUEUE)) {
pr_err("%s: wild qa_indx=%d\n", __func__, qa_indx); pr_err("wild qa_indx=%d\n", qa_indx);
goto the_end; goto the_end;
} }
spin_lock_irqsave(&queued_arr_lock, iflags); spin_lock_irqsave(&queued_arr_lock, iflags);
...@@ -3517,21 +3519,21 @@ sdebug_q_cmd_hrt_complete(struct hrtimer *timer) ...@@ -3517,21 +3519,21 @@ sdebug_q_cmd_hrt_complete(struct hrtimer *timer)
scp = sqcp->a_cmnd; scp = sqcp->a_cmnd;
if (NULL == scp) { if (NULL == scp) {
spin_unlock_irqrestore(&queued_arr_lock, iflags); spin_unlock_irqrestore(&queued_arr_lock, iflags);
pr_err("%s: scp is NULL\n", __func__); pr_err("scp is NULL\n");
goto the_end; goto the_end;
} }
devip = (struct sdebug_dev_info *)scp->device->hostdata; devip = (struct sdebug_dev_info *)scp->device->hostdata;
if (devip) if (devip)
atomic_dec(&devip->num_in_q); atomic_dec(&devip->num_in_q);
else else
pr_err("%s: devip=NULL\n", __func__); pr_err("devip=NULL\n");
if (atomic_read(&retired_max_queue) > 0) if (atomic_read(&retired_max_queue) > 0)
retiring = 1; retiring = 1;
sqcp->a_cmnd = NULL; sqcp->a_cmnd = NULL;
if (!test_and_clear_bit(qa_indx, queued_in_use_bm)) { if (!test_and_clear_bit(qa_indx, queued_in_use_bm)) {
spin_unlock_irqrestore(&queued_arr_lock, iflags); spin_unlock_irqrestore(&queued_arr_lock, iflags);
pr_err("%s: Unexpected completion\n", __func__); pr_err("Unexpected completion\n");
goto the_end; goto the_end;
} }
...@@ -3541,7 +3543,7 @@ sdebug_q_cmd_hrt_complete(struct hrtimer *timer) ...@@ -3541,7 +3543,7 @@ sdebug_q_cmd_hrt_complete(struct hrtimer *timer)
retval = atomic_read(&retired_max_queue); retval = atomic_read(&retired_max_queue);
if (qa_indx >= retval) { if (qa_indx >= retval) {
spin_unlock_irqrestore(&queued_arr_lock, iflags); spin_unlock_irqrestore(&queued_arr_lock, iflags);
pr_err("%s: index %d too large\n", __func__, retval); pr_err("index %d too large\n", retval);
goto the_end; goto the_end;
} }
k = find_last_bit(queued_in_use_bm, retval); k = find_last_bit(queued_in_use_bm, retval);
...@@ -3580,7 +3582,7 @@ static struct sdebug_dev_info * devInfoReg(struct scsi_device * sdev) ...@@ -3580,7 +3582,7 @@ static struct sdebug_dev_info * devInfoReg(struct scsi_device * sdev)
return devip; return devip;
sdbg_host = *(struct sdebug_host_info **)shost_priv(sdev->host); sdbg_host = *(struct sdebug_host_info **)shost_priv(sdev->host);
if (!sdbg_host) { if (!sdbg_host) {
pr_err("%s: Host info NULL\n", __func__); pr_err("Host info NULL\n");
return NULL; return NULL;
} }
list_for_each_entry(devip, &sdbg_host->dev_info_list, dev_list) { list_for_each_entry(devip, &sdbg_host->dev_info_list, dev_list) {
...@@ -3596,8 +3598,7 @@ static struct sdebug_dev_info * devInfoReg(struct scsi_device * sdev) ...@@ -3596,8 +3598,7 @@ static struct sdebug_dev_info * devInfoReg(struct scsi_device * sdev)
if (!open_devip) { /* try and make a new one */ if (!open_devip) { /* try and make a new one */
open_devip = sdebug_device_create(sdbg_host, GFP_ATOMIC); open_devip = sdebug_device_create(sdbg_host, GFP_ATOMIC);
if (!open_devip) { if (!open_devip) {
printk(KERN_ERR "%s: out of memory at line %d\n", pr_err("out of memory at line %d\n", __LINE__);
__func__, __LINE__);
return NULL; return NULL;
} }
} }
...@@ -3615,7 +3616,7 @@ static struct sdebug_dev_info * devInfoReg(struct scsi_device * sdev) ...@@ -3615,7 +3616,7 @@ static struct sdebug_dev_info * devInfoReg(struct scsi_device * sdev)
static int scsi_debug_slave_alloc(struct scsi_device *sdp) static int scsi_debug_slave_alloc(struct scsi_device *sdp)
{ {
if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts) if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts)
printk(KERN_INFO "scsi_debug: slave_alloc <%u %u %u %llu>\n", pr_info("slave_alloc <%u %u %u %llu>\n",
sdp->host->host_no, sdp->channel, sdp->id, sdp->lun); sdp->host->host_no, sdp->channel, sdp->id, sdp->lun);
queue_flag_set_unlocked(QUEUE_FLAG_BIDI, sdp->request_queue); queue_flag_set_unlocked(QUEUE_FLAG_BIDI, sdp->request_queue);
return 0; return 0;
...@@ -3626,7 +3627,7 @@ static int scsi_debug_slave_configure(struct scsi_device *sdp) ...@@ -3626,7 +3627,7 @@ static int scsi_debug_slave_configure(struct scsi_device *sdp)
struct sdebug_dev_info *devip; struct sdebug_dev_info *devip;
if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts) if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts)
printk(KERN_INFO "scsi_debug: slave_configure <%u %u %u %llu>\n", pr_info("slave_configure <%u %u %u %llu>\n",
sdp->host->host_no, sdp->channel, sdp->id, sdp->lun); sdp->host->host_no, sdp->channel, sdp->id, sdp->lun);
if (sdp->host->max_cmd_len != SCSI_DEBUG_MAX_CMD_LEN) if (sdp->host->max_cmd_len != SCSI_DEBUG_MAX_CMD_LEN)
sdp->host->max_cmd_len = SCSI_DEBUG_MAX_CMD_LEN; sdp->host->max_cmd_len = SCSI_DEBUG_MAX_CMD_LEN;
...@@ -3646,7 +3647,7 @@ static void scsi_debug_slave_destroy(struct scsi_device *sdp) ...@@ -3646,7 +3647,7 @@ static void scsi_debug_slave_destroy(struct scsi_device *sdp)
(struct sdebug_dev_info *)sdp->hostdata; (struct sdebug_dev_info *)sdp->hostdata;
if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts) if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts)
printk(KERN_INFO "scsi_debug: slave_destroy <%u %u %u %llu>\n", pr_info("slave_destroy <%u %u %u %llu>\n",
sdp->host->host_no, sdp->channel, sdp->id, sdp->lun); sdp->host->host_no, sdp->channel, sdp->id, sdp->lun);
if (devip) { if (devip) {
/* make this slot available for re-use */ /* make this slot available for re-use */
...@@ -3897,8 +3898,7 @@ static void __init sdebug_build_parts(unsigned char *ramp, ...@@ -3897,8 +3898,7 @@ static void __init sdebug_build_parts(unsigned char *ramp,
return; return;
if (scsi_debug_num_parts > SDEBUG_MAX_PARTS) { if (scsi_debug_num_parts > SDEBUG_MAX_PARTS) {
scsi_debug_num_parts = SDEBUG_MAX_PARTS; scsi_debug_num_parts = SDEBUG_MAX_PARTS;
pr_warn("%s: reducing partitions to %d\n", __func__, pr_warn("reducing partitions to %d\n", SDEBUG_MAX_PARTS);
SDEBUG_MAX_PARTS);
} }
num_sectors = (int)sdebug_store_sectors; num_sectors = (int)sdebug_store_sectors;
sectors_per_part = (num_sectors - sdebug_sectors_per) sectors_per_part = (num_sectors - sdebug_sectors_per)
...@@ -3945,8 +3945,7 @@ schedule_resp(struct scsi_cmnd *cmnd, struct sdebug_dev_info *devip, ...@@ -3945,8 +3945,7 @@ schedule_resp(struct scsi_cmnd *cmnd, struct sdebug_dev_info *devip,
struct scsi_device *sdp = cmnd->device; struct scsi_device *sdp = cmnd->device;
if (NULL == cmnd || NULL == devip) { if (NULL == cmnd || NULL == devip) {
pr_warn("%s: called with NULL cmnd or devip pointer\n", pr_warn("called with NULL cmnd or devip pointer\n");
__func__);
/* no particularly good error to report back */ /* no particularly good error to report back */
return SCSI_MLQUEUE_HOST_BUSY; return SCSI_MLQUEUE_HOST_BUSY;
} }
...@@ -4383,8 +4382,7 @@ static ssize_t fake_rw_store(struct device_driver *ddp, const char *buf, ...@@ -4383,8 +4382,7 @@ static ssize_t fake_rw_store(struct device_driver *ddp, const char *buf,
fake_storep = vmalloc(sz); fake_storep = vmalloc(sz);
if (NULL == fake_storep) { if (NULL == fake_storep) {
pr_err("%s: out of memory, 9\n", pr_err("out of memory, 9\n");
__func__);
return -ENOMEM; return -ENOMEM;
} }
memset(fake_storep, 0, sz); memset(fake_storep, 0, sz);
...@@ -4784,8 +4782,7 @@ static int __init scsi_debug_init(void) ...@@ -4784,8 +4782,7 @@ static int __init scsi_debug_init(void)
atomic_set(&retired_max_queue, 0); atomic_set(&retired_max_queue, 0);
if (scsi_debug_ndelay >= 1000000000) { if (scsi_debug_ndelay >= 1000000000) {
pr_warn("%s: ndelay must be less than 1 second, ignored\n", pr_warn("ndelay must be less than 1 second, ignored\n");
__func__);
scsi_debug_ndelay = 0; scsi_debug_ndelay = 0;
} else if (scsi_debug_ndelay > 0) } else if (scsi_debug_ndelay > 0)
scsi_debug_delay = DELAY_OVERRIDDEN; scsi_debug_delay = DELAY_OVERRIDDEN;
...@@ -4797,8 +4794,7 @@ static int __init scsi_debug_init(void) ...@@ -4797,8 +4794,7 @@ static int __init scsi_debug_init(void)
case 4096: case 4096:
break; break;
default: default:
pr_err("%s: invalid sector_size %d\n", __func__, pr_err("invalid sector_size %d\n", scsi_debug_sector_size);
scsi_debug_sector_size);
return -EINVAL; return -EINVAL;
} }
...@@ -4811,29 +4807,28 @@ static int __init scsi_debug_init(void) ...@@ -4811,29 +4807,28 @@ static int __init scsi_debug_init(void)
break; break;
default: default:
pr_err("%s: dif must be 0, 1, 2 or 3\n", __func__); pr_err("dif must be 0, 1, 2 or 3\n");
return -EINVAL; return -EINVAL;
} }
if (scsi_debug_guard > 1) { if (scsi_debug_guard > 1) {
pr_err("%s: guard must be 0 or 1\n", __func__); pr_err("guard must be 0 or 1\n");
return -EINVAL; return -EINVAL;
} }
if (scsi_debug_ato > 1) { if (scsi_debug_ato > 1) {
pr_err("%s: ato must be 0 or 1\n", __func__); pr_err("ato must be 0 or 1\n");
return -EINVAL; return -EINVAL;
} }
if (scsi_debug_physblk_exp > 15) { if (scsi_debug_physblk_exp > 15) {
pr_err("%s: invalid physblk_exp %u\n", __func__, pr_err("invalid physblk_exp %u\n", scsi_debug_physblk_exp);
scsi_debug_physblk_exp);
return -EINVAL; return -EINVAL;
} }
if (scsi_debug_lowest_aligned > 0x3fff) { if (scsi_debug_lowest_aligned > 0x3fff) {
pr_err("%s: lowest_aligned too big: %u\n", __func__, pr_err("lowest_aligned too big: %u\n",
scsi_debug_lowest_aligned); scsi_debug_lowest_aligned);
return -EINVAL; return -EINVAL;
} }
...@@ -4863,7 +4858,7 @@ static int __init scsi_debug_init(void) ...@@ -4863,7 +4858,7 @@ static int __init scsi_debug_init(void)
if (0 == scsi_debug_fake_rw) { if (0 == scsi_debug_fake_rw) {
fake_storep = vmalloc(sz); fake_storep = vmalloc(sz);
if (NULL == fake_storep) { if (NULL == fake_storep) {
pr_err("%s: out of memory, 1\n", __func__); pr_err("out of memory, 1\n");
return -ENOMEM; return -ENOMEM;
} }
memset(fake_storep, 0, sz); memset(fake_storep, 0, sz);
...@@ -4877,11 +4872,10 @@ static int __init scsi_debug_init(void) ...@@ -4877,11 +4872,10 @@ static int __init scsi_debug_init(void)
dif_size = sdebug_store_sectors * sizeof(struct sd_dif_tuple); dif_size = sdebug_store_sectors * sizeof(struct sd_dif_tuple);
dif_storep = vmalloc(dif_size); dif_storep = vmalloc(dif_size);
pr_err("%s: dif_storep %u bytes @ %p\n", __func__, dif_size, pr_err("dif_storep %u bytes @ %p\n", dif_size, dif_storep);
dif_storep);
if (dif_storep == NULL) { if (dif_storep == NULL) {
pr_err("%s: out of mem. (DIX)\n", __func__); pr_err("out of mem. (DIX)\n");
ret = -ENOMEM; ret = -ENOMEM;
goto free_vm; goto free_vm;
} }
...@@ -4903,18 +4897,17 @@ static int __init scsi_debug_init(void) ...@@ -4903,18 +4897,17 @@ static int __init scsi_debug_init(void)
if (scsi_debug_unmap_alignment && if (scsi_debug_unmap_alignment &&
scsi_debug_unmap_granularity <= scsi_debug_unmap_granularity <=
scsi_debug_unmap_alignment) { scsi_debug_unmap_alignment) {
pr_err("%s: ERR: unmap_granularity <= unmap_alignment\n", pr_err("ERR: unmap_granularity <= unmap_alignment\n");
__func__);
return -EINVAL; return -EINVAL;
} }
map_size = lba_to_map_index(sdebug_store_sectors - 1) + 1; map_size = lba_to_map_index(sdebug_store_sectors - 1) + 1;
map_storep = vmalloc(BITS_TO_LONGS(map_size) * sizeof(long)); map_storep = vmalloc(BITS_TO_LONGS(map_size) * sizeof(long));
pr_info("%s: %lu provisioning blocks\n", __func__, map_size); pr_info("%lu provisioning blocks\n", map_size);
if (map_storep == NULL) { if (map_storep == NULL) {
pr_err("%s: out of mem. (MAP)\n", __func__); pr_err("out of mem. (MAP)\n");
ret = -ENOMEM; ret = -ENOMEM;
goto free_vm; goto free_vm;
} }
...@@ -4928,18 +4921,18 @@ static int __init scsi_debug_init(void) ...@@ -4928,18 +4921,18 @@ static int __init scsi_debug_init(void)
pseudo_primary = root_device_register("pseudo_0"); pseudo_primary = root_device_register("pseudo_0");
if (IS_ERR(pseudo_primary)) { if (IS_ERR(pseudo_primary)) {
pr_warn("%s: root_device_register() error\n", __func__); pr_warn("root_device_register() error\n");
ret = PTR_ERR(pseudo_primary); ret = PTR_ERR(pseudo_primary);
goto free_vm; goto free_vm;
} }
ret = bus_register(&pseudo_lld_bus); ret = bus_register(&pseudo_lld_bus);
if (ret < 0) { if (ret < 0) {
pr_warn("%s: bus_register error: %d\n", __func__, ret); pr_warn("bus_register error: %d\n", ret);
goto dev_unreg; goto dev_unreg;
} }
ret = driver_register(&sdebug_driverfs_driver); ret = driver_register(&sdebug_driverfs_driver);
if (ret < 0) { if (ret < 0) {
pr_warn("%s: driver_register error: %d\n", __func__, ret); pr_warn("driver_register error: %d\n", ret);
goto bus_unreg; goto bus_unreg;
} }
...@@ -4948,16 +4941,14 @@ static int __init scsi_debug_init(void) ...@@ -4948,16 +4941,14 @@ static int __init scsi_debug_init(void)
for (k = 0; k < host_to_add; k++) { for (k = 0; k < host_to_add; k++) {
if (sdebug_add_adapter()) { if (sdebug_add_adapter()) {
pr_err("%s: sdebug_add_adapter failed k=%d\n", pr_err("sdebug_add_adapter failed k=%d\n", k);
__func__, k);
break; break;
} }
} }
if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts) { if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts)
pr_info("%s: built %d host(s)\n", __func__, pr_info("built %d host(s)\n", scsi_debug_add_host);
scsi_debug_add_host);
}
return 0; return 0;
bus_unreg: bus_unreg:
...@@ -5012,8 +5003,7 @@ static int sdebug_add_adapter(void) ...@@ -5012,8 +5003,7 @@ static int sdebug_add_adapter(void)
sdbg_host = kzalloc(sizeof(*sdbg_host),GFP_KERNEL); sdbg_host = kzalloc(sizeof(*sdbg_host),GFP_KERNEL);
if (NULL == sdbg_host) { if (NULL == sdbg_host) {
printk(KERN_ERR "%s: out of memory at line %d\n", pr_err("out of memory at line %d\n", __LINE__);
__func__, __LINE__);
return -ENOMEM; return -ENOMEM;
} }
...@@ -5023,8 +5013,7 @@ static int sdebug_add_adapter(void) ...@@ -5023,8 +5013,7 @@ static int sdebug_add_adapter(void)
for (k = 0; k < devs_per_host; k++) { for (k = 0; k < devs_per_host; k++) {
sdbg_devinfo = sdebug_device_create(sdbg_host, GFP_KERNEL); sdbg_devinfo = sdebug_device_create(sdbg_host, GFP_KERNEL);
if (!sdbg_devinfo) { if (!sdbg_devinfo) {
printk(KERN_ERR "%s: out of memory at line %d\n", pr_err("out of memory at line %d\n", __LINE__);
__func__, __LINE__);
error = -ENOMEM; error = -ENOMEM;
goto clean; goto clean;
} }
...@@ -5338,7 +5327,7 @@ static int sdebug_driver_probe(struct device * dev) ...@@ -5338,7 +5327,7 @@ static int sdebug_driver_probe(struct device * dev)
sdebug_driver_template.use_clustering = ENABLE_CLUSTERING; sdebug_driver_template.use_clustering = ENABLE_CLUSTERING;
hpnt = scsi_host_alloc(&sdebug_driver_template, sizeof(sdbg_host)); hpnt = scsi_host_alloc(&sdebug_driver_template, sizeof(sdbg_host));
if (NULL == hpnt) { if (NULL == hpnt) {
pr_err("%s: scsi_host_alloc failed\n", __func__); pr_err("scsi_host_alloc failed\n");
error = -ENODEV; error = -ENODEV;
return error; return error;
} }
...@@ -5381,7 +5370,7 @@ static int sdebug_driver_probe(struct device * dev) ...@@ -5381,7 +5370,7 @@ static int sdebug_driver_probe(struct device * dev)
scsi_host_set_prot(hpnt, host_prot); scsi_host_set_prot(hpnt, host_prot);
printk(KERN_INFO "scsi_debug: host protection%s%s%s%s%s%s%s\n", pr_info("host protection%s%s%s%s%s%s%s\n",
(host_prot & SHOST_DIF_TYPE1_PROTECTION) ? " DIF1" : "", (host_prot & SHOST_DIF_TYPE1_PROTECTION) ? " DIF1" : "",
(host_prot & SHOST_DIF_TYPE2_PROTECTION) ? " DIF2" : "", (host_prot & SHOST_DIF_TYPE2_PROTECTION) ? " DIF2" : "",
(host_prot & SHOST_DIF_TYPE3_PROTECTION) ? " DIF3" : "", (host_prot & SHOST_DIF_TYPE3_PROTECTION) ? " DIF3" : "",
...@@ -5409,7 +5398,7 @@ static int sdebug_driver_probe(struct device * dev) ...@@ -5409,7 +5398,7 @@ static int sdebug_driver_probe(struct device * dev)
error = scsi_add_host(hpnt, &sdbg_host->dev); error = scsi_add_host(hpnt, &sdbg_host->dev);
if (error) { if (error) {
printk(KERN_ERR "%s: scsi_add_host failed\n", __func__); pr_err("scsi_add_host failed\n");
error = -ENODEV; error = -ENODEV;
scsi_host_put(hpnt); scsi_host_put(hpnt);
} else } else
...@@ -5426,8 +5415,7 @@ static int sdebug_driver_remove(struct device * dev) ...@@ -5426,8 +5415,7 @@ static int sdebug_driver_remove(struct device * dev)
sdbg_host = to_sdebug_host(dev); sdbg_host = to_sdebug_host(dev);
if (!sdbg_host) { if (!sdbg_host) {
printk(KERN_ERR "%s: Unable to locate host info\n", pr_err("Unable to locate host info\n");
__func__);
return -ENODEV; return -ENODEV;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment