From 7b02f74ee033cb22eecfff24c97270166016ddf6 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Mon, 6 Oct 2008 17:18:04 +0000 Subject: [PATCH] The patch below fixes the following classes of checkpatch errors: * ERROR: return is not a function, parentheses are not required * ERROR: that open brace { should be on the previous line This patch has been tested by verifying that the newly generated patch still applies without warnings to the 2.6.25.17 kernel and that the patched kernel still compiles. Signed-off-by: Bart Van Assche git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@512 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- iscsi-scst/kernel/iscsi.h | 2 +- iscsi-scst/kernel/iscsi_hdr.h | 2 +- scst/src/dev_handlers/scst_vdisk.c | 5 ++--- scst/src/scst_priv.h | 18 +++++++++--------- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/iscsi-scst/kernel/iscsi.h b/iscsi-scst/kernel/iscsi.h index e7afc2e62..bbfa594dd 100644 --- a/iscsi-scst/kernel/iscsi.h +++ b/iscsi-scst/kernel/iscsi.h @@ -518,7 +518,7 @@ static inline int test_write_ready(struct iscsi_conn *conn) * No need for write_list protection, in the worst case we will be * restarted again. */ - return (!list_empty(&conn->write_list) || conn->write_cmnd); + return !list_empty(&conn->write_list) || conn->write_cmnd; } static inline void conn_get(struct iscsi_conn *conn) diff --git a/iscsi-scst/kernel/iscsi_hdr.h b/iscsi-scst/kernel/iscsi_hdr.h index d279d4233..5c94e4324 100644 --- a/iscsi-scst/kernel/iscsi_hdr.h +++ b/iscsi-scst/kernel/iscsi_hdr.h @@ -515,7 +515,7 @@ struct iscsi_nop_in_hdr { #define cmnd_ttt(cmnd) cpu_to_be32((cmnd)->pdu.bhs.ttt) #define cmnd_itt(cmnd) cpu_to_be32((cmnd)->pdu.bhs.itt) #define cmnd_opcode(cmnd) ((cmnd)->pdu.bhs.opcode & ISCSI_OPCODE_MASK) -#define cmnd_scsicode(cmnd) cmnd_hdr(cmnd)->scb[0] +#define cmnd_scsicode(cmnd) (cmnd_hdr((cmnd))->scb[0]) #endif /* __ISCSI_HDR_H__ */ diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c index ad76189fc..c92d0844e 100644 --- a/scst/src/dev_handlers/scst_vdisk.c +++ b/scst/src/dev_handlers/scst_vdisk.c @@ -432,12 +432,11 @@ static int vdisk_attach(struct scst_device *dev) #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19) if ((fd->f_op == NULL) || (fd->f_op->readv == NULL) || - (fd->f_op->writev == NULL)) + (fd->f_op->writev == NULL)) { #else if ((fd->f_op == NULL) || (fd->f_op->aio_read == NULL) || - (fd->f_op->aio_write == NULL)) + (fd->f_op->aio_write == NULL)) { #endif - { PRINT_ERROR("%s", "Wrong f_op or FS doesn't have " "required capabilities"); res = -EINVAL; diff --git a/scst/src/scst_priv.h b/scst/src/scst_priv.h index c4c086764..5f5c49c47 100644 --- a/scst/src/scst_priv.h +++ b/scst/src/scst_priv.h @@ -408,19 +408,19 @@ void scst_process_reset(struct scst_device *dev, static inline int scst_is_ua_command(struct scst_cmd *cmd) { - return ((cmd->cdb[0] != INQUIRY) && - (cmd->cdb[0] != REQUEST_SENSE) && - (cmd->cdb[0] != REPORT_LUNS)); + return cmd->cdb[0] != INQUIRY + && cmd->cdb[0] != REQUEST_SENSE + && cmd->cdb[0] != REPORT_LUNS; } static inline int scst_is_implicit_hq(struct scst_cmd *cmd) { - return ((cmd->cdb[0] == INQUIRY) || - (cmd->cdb[0] == REPORT_LUNS) || - ((cmd->dev->type == TYPE_DISK) && - ((cmd->cdb[0] == READ_CAPACITY) || - ((cmd->cdb[0] == SERVICE_ACTION_IN) && - ((cmd->cdb[1] & 0x1f) == SAI_READ_CAPACITY_16))))); + return cmd->cdb[0] == INQUIRY + || cmd->cdb[0] == REPORT_LUNS + || (cmd->dev->type == TYPE_DISK + && (cmd->cdb[0] == READ_CAPACITY + || (cmd->cdb[0] == SERVICE_ACTION_IN + && (cmd->cdb[1] & 0x1f) == SAI_READ_CAPACITY_16))); } /*