From 27c5d8dcdffbf8ddb277f59e3fb3fa9b4b72a166 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Fri, 20 Mar 2009 12:36:01 +0000 Subject: [PATCH] The patch below fixes the following recently introduced checkpatch complaints: * use tabs not spaces * Macros with complex values should be enclosed in parenthesis. * printk() should include KERN_ facility level. The patch below has been verified by reviewing it carefully and by verifying the output of the following command: scripts/run-regression-tests -k 2.6.28.8 Signed-off-by: Bart Van Assche git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@707 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- iscsi-scst/kernel/config.c | 18 +++++++++--------- iscsi-scst/kernel/iscsi.c | 6 +++--- iscsi-scst/kernel/session.c | 4 ++-- iscsi-scst/usr/config.c | 2 +- iscsi-scst/usr/iscsi_scstd.c | 2 +- iscsi-scst/usr/isns.c | 4 ++-- scst/include/scst.h | 8 ++++---- scst/src/dev_handlers/scst_vdisk.c | 4 ++-- scst/src/scst_lib.c | 8 ++++---- 9 files changed, 28 insertions(+), 28 deletions(-) diff --git a/iscsi-scst/kernel/config.c b/iscsi-scst/kernel/config.c index 149f230a8..c53b592c5 100644 --- a/iscsi-scst/kernel/config.c +++ b/iscsi-scst/kernel/config.c @@ -490,26 +490,26 @@ static void iscsi_dump_char(int ch) if (ch < 0) { while ((i % 16) != 0) { - printk(" "); + printk(KERN_CONT " "); text[i] = ' '; i++; if ((i % 16) == 0) - printk(" | %.16s |\n", text); + printk(KERN_CONT " | %.16s |\n", text); else if ((i % 4) == 0) - printk(" |"); + printk(KERN_CONT " |"); } i = 0; return; } text[i] = (ch < 0x20 || (ch >= 0x80 && ch <= 0xa0)) ? ' ' : ch; - printk(" %02x", ch); + printk(KERN_CONT " %02x", ch); i++; if ((i % 16) == 0) { - printk(" | %.16s |\n", text); + printk(KERN_CONT " | %.16s |\n", text); i = 0; } else if ((i % 4) == 0) - printk(" |"); + printk(KERN_CONT " |"); } void iscsi_dump_pdu(struct iscsi_pdu *pdu) @@ -519,18 +519,18 @@ void iscsi_dump_pdu(struct iscsi_pdu *pdu) int i; buf = (void *)&pdu->bhs; - printk("BHS: (%p,%zd)\n", buf, sizeof(pdu->bhs)); + printk(KERN_DEBUG "BHS: (%p,%zd)\n", buf, sizeof(pdu->bhs)); for (i = 0; i < sizeof(pdu->bhs); i++) iscsi_dump_char(*buf++); iscsi_dump_char(-1); buf = (void *)pdu->ahs; - printk("AHS: (%p,%d)\n", buf, pdu->ahssize); + printk(KERN_DEBUG "AHS: (%p,%d)\n", buf, pdu->ahssize); for (i = 0; i < pdu->ahssize; i++) iscsi_dump_char(*buf++); iscsi_dump_char(-1); - printk("Data: (%d)\n", pdu->datasize); + printk(KERN_DEBUG "Data: (%d)\n", pdu->datasize); } } #endif /* CONFIG_SCST_DEBUG */ diff --git a/iscsi-scst/kernel/iscsi.c b/iscsi-scst/kernel/iscsi.c index 6aed6bd13..dc74c17a1 100644 --- a/iscsi-scst/kernel/iscsi.c +++ b/iscsi-scst/kernel/iscsi.c @@ -100,7 +100,7 @@ static inline u32 cmnd_read_size(struct iscsi_cmnd *cmnd) ahdr = (struct iscsi_ahs_hdr *)p; if (ahdr->ahstype == ISCSI_AHSTYPE_RLENGTH) { - struct iscsi_rlength_ahdr *rh = + struct iscsi_rlength_ahdr *rh = (struct iscsi_rlength_ahdr *)ahdr; return be32_to_cpu(rh->read_length); } @@ -1374,7 +1374,7 @@ static int scsi_cmnd_start(struct iscsi_cmnd *req) ahdr = (struct iscsi_ahs_hdr *)p; if (ahdr->ahstype == ISCSI_AHSTYPE_CDB) { - struct iscsi_cdb_ahdr *eca = + struct iscsi_cdb_ahdr *eca = (struct iscsi_cdb_ahdr *)ahdr; scst_cmd_set_ext_cdb(scst_cmd, eca->cdb, be16_to_cpu(ahdr->ahslength) - 1); @@ -2972,7 +2972,7 @@ static int iscsi_scsi_aen(struct scst_aen *aen) sg_init_table(sg, 2); sg_set_buf(&sg[0], &rsp->sense_hdr, sizeof(rsp->sense_hdr)); sg_set_buf(&sg[1], sense, sense_len); - + rsp->sense_hdr.length = cpu_to_be16(sense_len); rsp->pdu.datasize = sizeof(rsp->sense_hdr) + sense_len; rsp->bufflen = rsp->pdu.datasize; diff --git a/iscsi-scst/kernel/session.c b/iscsi-scst/kernel/session.c index d1523d3f2..e9146952b 100644 --- a/iscsi-scst/kernel/session.c +++ b/iscsi-scst/kernel/session.c @@ -165,7 +165,7 @@ int session_add(struct iscsi_target *target, info->sid); err = -EEXIST; goto out; - } + } sid = (union iscsi_sid)info->sid; sid.id.tsih = 0; @@ -181,7 +181,7 @@ int session_add(struct iscsi_target *target, i.id.tsih = 0; if ((sid.id64 == i.id64) && (strcmp(info->initiator_name, session->initiator_name) == 0)) { - if (!session->sess_shutting_down) { + if (!session->sess_shutting_down) { /* session reinstatement */ old_sess = session; } diff --git a/iscsi-scst/usr/config.c b/iscsi-scst/usr/config.c index 98fbd7c74..813881f64 100644 --- a/iscsi-scst/usr/config.c +++ b/iscsi-scst/usr/config.c @@ -238,7 +238,7 @@ int config_account_add(u32 tid, int dir, char *name, char *pass) if (tid) { /* check here */ -/* return -ENOENT; */ + /* return -ENOENT; */ } /* Check for minimum RFC defined value */ diff --git a/iscsi-scst/usr/iscsi_scstd.c b/iscsi-scst/usr/iscsi_scstd.c index 5a4d9de9e..a95056a5c 100644 --- a/iscsi-scst/usr/iscsi_scstd.c +++ b/iscsi-scst/usr/iscsi_scstd.c @@ -172,7 +172,7 @@ static void create_listen_socket(struct pollfd *array) opt = 1; if (res->ai_family == AF_INET6 && setsockopt(sock, IPPROTO_IPV6, IPV6_V6ONLY, &opt, sizeof(opt))) { - log_error("Unable to restrict IPv6 socket (%s)", strerror(errno)); + log_error("Unable to restrict IPv6 socket (%s)", strerror(errno)); close(sock); continue; } diff --git a/iscsi-scst/usr/isns.c b/iscsi-scst/usr/isns.c index 85e159e51..fb1bd0d80 100644 --- a/iscsi-scst/usr/isns.c +++ b/iscsi-scst/usr/isns.c @@ -604,8 +604,8 @@ static char *print_scn_pdu(struct isns_hdr *hdr) name = (char *) tlv->value; break; case ISNS_ATTR_TIMESTAMP: -/* log_error("%u : %u : %" PRIx64, ntohl(tlv->tag), vlen, */ -/* *((uint64_t *) tlv->value)); */ + /* log_error("%u : %u : %" PRIx64, ntohl(tlv->tag), vlen, */ + /* *((uint64_t *) tlv->value)); */ break; case ISNS_ATTR_ISCSI_SCN_BITMAP: log_error("scn bitmap : %x", *((uint32_t *) tlv->value)); diff --git a/scst/include/scst.h b/scst/include/scst.h index a37e2a479..8306c9bf5 100644 --- a/scst/include/scst.h +++ b/scst/include/scst.h @@ -445,11 +445,11 @@ enum scst_exec_context { #define SCST_SENSE_ASCQ_VALID 4 #define SCST_SENSE_ASCx_VALID (SCST_SENSE_ASC_VALID | \ - SCST_SENSE_ASCQ_VALID) + SCST_SENSE_ASCQ_VALID) #define SCST_SENSE_ALL_VALID (SCST_SENSE_KEY_VALID | \ - SCST_SENSE_ASC_VALID | \ - SCST_SENSE_ASCQ_VALID) + SCST_SENSE_ASC_VALID | \ + SCST_SENSE_ASCQ_VALID) /************************************************************* * TYPES @@ -675,7 +675,7 @@ struct scst_tgt_template { void (*task_mgmt_affected_cmds_done) (struct scst_mgmt_cmd *mgmt_cmd); /* - * This function informs the driver that the corresponding task + * This function informs the driver that the corresponding task * management function has been completed, i.e. all the corresponding * commands completed and freed. No return value expected. * diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c index 9d0dee7ff..6cd562ff6 100644 --- a/scst/src/dev_handlers/scst_vdisk.c +++ b/scst/src/dev_handlers/scst_vdisk.c @@ -93,7 +93,7 @@ static struct scst_proc_log vdisk_proc_local_trace_tbl[] = #define VDISK_NAME "vdisk" #define VCDROM_NAME "vcdrom" -#define VDISK_NULLIO_SIZE 3LL*1024*1024*1024*1024/2 +#define VDISK_NULLIO_SIZE (3LL*1024*1024*1024*1024/2) #define DEF_TST SCST_CONTR_MODE_SEP_TASK_SETS /* @@ -3326,7 +3326,7 @@ static int vcdrom_change(char *p, char *name) err = 0; virt_dev->file_name = NULL; } - + if (virt_dev->nullio) err = VDISK_NULLIO_SIZE; diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index fbff1e1a4..0dd88b1cc 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -3115,8 +3115,8 @@ int scst_obtain_device_parameters(struct scst_device *dev) #endif SCST_SENSE_VALID(sense_buffer)) { if (scst_analyze_sense(sense_buffer, - sizeof(sense_buffer), - SCST_SENSE_KEY_VALID, + sizeof(sense_buffer), + SCST_SENSE_KEY_VALID, ILLEGAL_REQUEST, 0, 0)) { TRACE(TRACE_SCSI|TRACE_MGMT_MINOR, "Device %d:%d:%d:%d doesn't " @@ -3136,8 +3136,8 @@ int scst_obtain_device_parameters(struct scst_device *dev) res = 0; goto out; } else if (scst_analyze_sense(sense_buffer, - sizeof(sense_buffer), - SCST_SENSE_KEY_VALID, + sizeof(sense_buffer), + SCST_SENSE_KEY_VALID, NOT_READY, 0, 0)) { TRACE(TRACE_SCSI, "Device %d:%d:%d:%d not ready",