From 272adb5363dba84a23f05e35a1c82eb01422423b Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Fri, 3 Sep 2010 16:53:31 +0000 Subject: [PATCH] Fixes for recently introduced minor checkpatch and sparse complaints. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2042 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/dev_handlers/scst_vdisk.c | 4 ++-- scst/src/scst_sysfs.c | 4 ++-- scst_local/scst_local.c | 7 +++---- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c index eb3c8268e..8e7e5c891 100644 --- a/scst/src/dev_handlers/scst_vdisk.c +++ b/scst/src/dev_handlers/scst_vdisk.c @@ -3724,7 +3724,7 @@ static ssize_t vcdrom_sysfs_filename_store(struct kobject *kobj, i_buf = kmalloc(count+1, GFP_KERNEL); if (i_buf == NULL) { - PRINT_ERROR("Unable to alloc intermediate buffer with size %d", + PRINT_ERROR("Unable to alloc intermediate buffer with size %zd", count+1); res = -ENOMEM; goto out; @@ -3966,7 +3966,7 @@ out: return res; } -static ssize_t vdisk_sysfs_process_resync_size_store( +static int vdisk_sysfs_process_resync_size_store( struct scst_sysfs_work_item *work) { int res; diff --git a/scst/src/scst_sysfs.c b/scst/src/scst_sysfs.c index 2081c904f..8c0158f9d 100644 --- a/scst/src/scst_sysfs.c +++ b/scst/src/scst_sysfs.c @@ -187,7 +187,7 @@ int scst_alloc_sysfs_work(int (*sysfs_work_fn)(struct scst_sysfs_work_item *), work = kzalloc(sizeof(*work), GFP_KERNEL); if (work == NULL) { - PRINT_ERROR("Unable to alloc sysfs work (size %d)", + PRINT_ERROR("Unable to alloc sysfs work (size %zd)", sizeof(*work)); res = -ENOMEM; goto out; @@ -1353,7 +1353,7 @@ out: return res; } -static int scst_dev_sysfs_threads_num_show(struct kobject *kobj, +static ssize_t scst_dev_sysfs_threads_num_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) { int pos = 0; diff --git a/scst_local/scst_local.c b/scst_local/scst_local.c index 4122ecc32..2831bfde9 100644 --- a/scst_local/scst_local.c +++ b/scst_local/scst_local.c @@ -1024,14 +1024,14 @@ static int __init scst_local_init(void) * Allocate a pool of structures for tgt_specific structures */ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 23) - #if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 25)) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 25)) /* * We only need this for kernels where we can get non scatterlists */ tgt_specific_pool = kmem_cache_create("scst_tgt_specific", sizeof(struct scst_local_tgt_specific), 0, SCST_SLAB_FLAGS, NULL); - #endif +#endif #else tgt_specific_pool = kmem_cache_create("scst_tgt_specific", sizeof(struct scst_local_tgt_specific), @@ -1130,9 +1130,8 @@ static void __exit scst_local_exit(void) TRACE_ENTRY(); - for (; k; k--) { + for (; k; k--) scst_local_remove_adapter(); - } do_remove_driverfs_files(); driver_unregister(&scst_local_driverfs_driver);