Commit 9a051019 authored by Douglas Gilbert's avatar Douglas Gilbert Committed by Martin K. Petersen

scsi: scsi_debug: tab, kstrto changes

Some of my development tools tend to add spaces (my preference) rather
than tabs (kernel convention). Running unexpand to clean these spaces
up found more of them than checkpatch.pl did. Then checkpatch.pl
complained about other style violations in those newly tabbed lines.
Signed-off-by: default avatarDouglas Gilbert <dgilbert@interlog.com>
Reviewed-by: default avatarBart Van Assche <bart.vanassche@wdc.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent dbec4c90
......@@ -308,8 +308,8 @@ struct opcode_info_t {
u32 flags; /* OR-ed set of SDEB_F_* */
int (*pfp)(struct scsi_cmnd *, struct sdebug_dev_info *);
const struct opcode_info_t *arrp; /* num_attached elements or NULL */
u8 len_mask[16]; /* len=len_mask[0], then mask for cdb[1]... */
/* ignore cdb bytes after position 15 */
u8 len_mask[16]; /* len_mask[0]-->cdb_len, then mask for cdb */
/* 1 to min(cdb_len, 15); ignore cdb[15...] */
};
/* SCSI opcodes (first byte of cdb) of interest mapped onto these indexes */
......@@ -344,7 +344,7 @@ enum sdeb_opcode_index {
SDEB_I_WRITE_SAME = 27, /* 10, 16 */
SDEB_I_SYNC_CACHE = 28, /* 10 only */
SDEB_I_COMP_WRITE = 29,
SDEB_I_LAST_ELEMENT = 30, /* keep this last */
SDEB_I_LAST_ELEMENT = 30, /* keep this last (previous + 1) */
};
......@@ -2320,8 +2320,8 @@ static int resp_ie_l_pg(unsigned char * arr)
#define SDEBUG_MAX_LSENSE_SZ 512
static int resp_log_sense(struct scsi_cmnd * scp,
struct sdebug_dev_info * devip)
static int resp_log_sense(struct scsi_cmnd *scp,
struct sdebug_dev_info *devip)
{
int ppc, sp, pcode, subpcode, alloc_len, len, n;
unsigned char arr[SDEBUG_MAX_LSENSE_SZ];
......@@ -3911,8 +3911,8 @@ static int scsi_debug_bus_reset(struct scsi_cmnd * SCpnt)
{
struct sdebug_host_info *sdbg_host;
struct sdebug_dev_info *devip;
struct scsi_device * sdp;
struct Scsi_Host * hp;
struct scsi_device *sdp;
struct Scsi_Host *hp;
int k = 0;
++num_bus_resets;
......@@ -4493,12 +4493,12 @@ static ssize_t opts_store(struct device_driver *ddp, const char *buf,
int opts;
char work[20];
if (1 == sscanf(buf, "%10s", work)) {
if (0 == strncasecmp(work,"0x", 2)) {
if (1 == sscanf(&work[2], "%x", &opts))
if (sscanf(buf, "%10s", work) == 1) {
if (strncasecmp(work, "0x", 2) == 0) {
if (kstrtoint(work + 2, 16, &opts) == 0)
goto opts_done;
} else {
if (1 == sscanf(work, "%d", &opts))
if (kstrtoint(work, 10, &opts) == 0)
goto opts_done;
}
}
......@@ -5257,8 +5257,8 @@ static int sdebug_add_adapter(void)
struct sdebug_host_info *sdbg_host;
struct sdebug_dev_info *sdbg_devinfo, *tmp;
sdbg_host = kzalloc(sizeof(*sdbg_host),GFP_KERNEL);
if (NULL == sdbg_host) {
sdbg_host = kzalloc(sizeof(*sdbg_host), GFP_KERNEL);
if (sdbg_host == NULL) {
pr_err("out of memory at line %d\n", __LINE__);
return -ENOMEM;
}
......@@ -5305,7 +5305,7 @@ static int sdebug_add_adapter(void)
static void sdebug_remove_adapter(void)
{
struct sdebug_host_info * sdbg_host = NULL;
struct sdebug_host_info *sdbg_host = NULL;
spin_lock(&sdebug_host_list_lock);
if (!list_empty(&sdebug_host_list)) {
......
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