From 6077bb04e5d841382ea5935be2dc5888a7b62c1c Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Fri, 24 Oct 2008 12:11:17 +0000 Subject: [PATCH] The patch below fixes more checkpatch warnings about lines that are over eighty columns, and more sparse warnings about missing declarations by inserting the keyword static where appropriate. A sparse warning about a shadowed variable (ucmd) is also fixed. This patch has been verified by rereading the patch carefully, and by verifying that SCST source code still compiles fine. Signed-off-by: Bart Van Assche git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@538 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/dev_handlers/scst_changer.c | 4 ++-- scst/src/dev_handlers/scst_processor.c | 4 ++-- scst/src/dev_handlers/scst_raid.c | 2 +- scst/src/dev_handlers/scst_user.c | 10 +++++----- scst/src/dev_handlers/scst_vdisk.c | 3 ++- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/scst/src/dev_handlers/scst_changer.c b/scst/src/dev_handlers/scst_changer.c index 49d85e70c..84e2bbaa2 100644 --- a/scst/src/dev_handlers/scst_changer.c +++ b/scst/src/dev_handlers/scst_changer.c @@ -57,7 +57,7 @@ static struct scst_dev_type changer_devtype = CHANGER_TYPE; * * Description: *************************************************************/ -int changer_attach(struct scst_device *dev) +static int changer_attach(struct scst_device *dev) { int res = 0; int retries; @@ -142,7 +142,7 @@ void changer_detach(struct scst_device *dev) * * Note: Not all states are allowed on return ********************************************************************/ -int changer_parse(struct scst_cmd *cmd) +static int changer_parse(struct scst_cmd *cmd) { int res = SCST_CMD_STATE_DEFAULT; diff --git a/scst/src/dev_handlers/scst_processor.c b/scst/src/dev_handlers/scst_processor.c index 7b24e9c04..ba70d3331 100644 --- a/scst/src/dev_handlers/scst_processor.c +++ b/scst/src/dev_handlers/scst_processor.c @@ -57,7 +57,7 @@ static struct scst_dev_type processor_devtype = PROCESSOR_TYPE; * * Description: *************************************************************/ -int processor_attach(struct scst_device *dev) +static int processor_attach(struct scst_device *dev) { int res = 0; int retries; @@ -142,7 +142,7 @@ void processor_detach(struct scst_device *dev) * * Note: Not all states are allowed on return ********************************************************************/ -int processor_parse(struct scst_cmd *cmd) +static int processor_parse(struct scst_cmd *cmd) { int res = SCST_CMD_STATE_DEFAULT; diff --git a/scst/src/dev_handlers/scst_raid.c b/scst/src/dev_handlers/scst_raid.c index 38a38cb82..020e28a27 100644 --- a/scst/src/dev_handlers/scst_raid.c +++ b/scst/src/dev_handlers/scst_raid.c @@ -57,7 +57,7 @@ static struct scst_dev_type raid_devtype = RAID_TYPE; * * Description: *************************************************************/ -int raid_attach(struct scst_device *dev) +static int raid_attach(struct scst_device *dev) { int res = 0; int retries; diff --git a/scst/src/dev_handlers/scst_user.c b/scst/src/dev_handlers/scst_user.c index ce51be0de..e1c9daacf 100644 --- a/scst/src/dev_handlers/scst_user.c +++ b/scst/src/dev_handlers/scst_user.c @@ -2817,12 +2817,12 @@ static int dev_user_process_cleanup(struct scst_user_dev *dev) int i; for (i = 0; i < (int)ARRAY_SIZE(dev->ucmd_hash); i++) { struct list_head *head = &dev->ucmd_hash[i]; - struct scst_user_cmd *ucmd; + struct scst_user_cmd *ucmd2; again: - list_for_each_entry(ucmd, head, hash_list_entry) { - PRINT_ERROR("Lost ucmd %p (state %x, ref %d)", ucmd, - ucmd->state, atomic_read(&ucmd->ucmd_ref)); - ucmd_put(ucmd); + list_for_each_entry(ucmd2, head, hash_list_entry) { + PRINT_ERROR("Lost ucmd %p (state %x, ref %d)", ucmd2, + ucmd2->state, atomic_read(&ucmd2->ucmd_ref)); + ucmd_put(ucmd2); goto again; } } diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c index 51806bee2..ebd31f66f 100644 --- a/scst/src/dev_handlers/scst_vdisk.c +++ b/scst/src/dev_handlers/scst_vdisk.c @@ -2202,7 +2202,8 @@ restart: PRINT_ERROR("lseek trouble %lld != %lld", (long long unsigned int)err, (long long unsigned int)loff); - scst_set_cmd_error(cmd, SCST_LOAD_SENSE(scst_sense_hardw_error)); + scst_set_cmd_error(cmd, + SCST_LOAD_SENSE(scst_sense_hardw_error)); goto out_set_fs; }