Patch from Bart Van Assche <bart.vanassche@gmail.com>:

As discussed earlier today, GNU-style named initializers should be replaced
by C99-style named initializers. The patch below realizes this. The patch
below contains one additional change: double quotes are added around
a #warning message. These double qoutes are not required by the C89
or C99 language standards, but many tools expect these (e.g. checkpatch.pl).

This patch has been tested as follows:
* Verified that SCST still compiles and links (make scst iscsi && make -C srpt)
* Verified that checkpatch.pl does no longer complain on named initializers.
* Verified that the kernel patch generated by scripts/generate-kernel-patch
   applies cleanly to the 2.6.25.4 kernel, that the patched kernel compiles
   cleanly, installs properly and that it was possible after reboot to load
   the modules scst, iscsi-scst and ib_srpt load.

Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@379 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2008-05-20 14:17:25 +00:00
parent e4ac7040a8
commit 7fc39a3801
10 changed files with 155 additions and 155 deletions

View File

@@ -27,15 +27,15 @@
#define CDROM_NAME "dev_cdrom"
#define CDROM_TYPE { \
name: CDROM_NAME, \
type: TYPE_ROM, \
parse_atomic: 1, \
dev_done_atomic: 1, \
attach: cdrom_attach, \
detach: cdrom_detach, \
parse: cdrom_parse, \
dev_done: cdrom_done, \
#define CDROM_TYPE { \
.name = CDROM_NAME, \
.type = TYPE_ROM, \
.parse_atomic = 1, \
.dev_done_atomic = 1, \
.attach = cdrom_attach, \
.detach = cdrom_detach, \
.parse = cdrom_parse, \
.dev_done = cdrom_done, \
}
#define CDROM_SMALL_TIMEOUT (3 * HZ)

View File

@@ -26,15 +26,15 @@
#define CHANGER_NAME "dev_changer"
#define CHANGER_TYPE { \
name: CHANGER_NAME, \
type: TYPE_MEDIUM_CHANGER,\
parse_atomic: 1, \
/* dev_done_atomic: 1,*/ \
attach: changer_attach, \
/* detach: changer_detach,*/ \
parse: changer_parse, \
/* dev_done: changer_done*/ \
#define CHANGER_TYPE { \
.name = CHANGER_NAME, \
.type = TYPE_MEDIUM_CHANGER, \
.parse_atomic = 1, \
/* .dev_done_atomic = 1, */ \
.attach = changer_attach, \
/* .detach = changer_detach, */ \
.parse = changer_parse, \
/* .dev_done = changer_done */ \
}
#define CHANGER_RETRIES 2

View File

@@ -32,29 +32,29 @@
# define DISK_NAME "dev_disk"
# define DISK_PERF_NAME "dev_disk_perf"
#define DISK_TYPE { \
name: DISK_NAME, \
type: TYPE_DISK, \
parse_atomic: 1, \
dev_done_atomic: 1, \
exec_atomic: 1, \
attach: disk_attach, \
detach: disk_detach, \
parse: disk_parse, \
dev_done: disk_done, \
#define DISK_TYPE { \
.name = DISK_NAME, \
.type = TYPE_DISK, \
.parse_atomic = 1, \
.dev_done_atomic = 1, \
.exec_atomic = 1, \
.attach = disk_attach, \
.detach = disk_detach, \
.parse = disk_parse, \
.dev_done = disk_done, \
}
#define DISK_PERF_TYPE { \
name: DISK_PERF_NAME, \
type: TYPE_DISK, \
parse_atomic: 1, \
dev_done_atomic: 1, \
exec_atomic: 1, \
attach: disk_attach, \
detach: disk_detach, \
parse: disk_parse, \
dev_done: disk_done, \
exec: disk_exec, \
#define DISK_PERF_TYPE { \
.name = DISK_PERF_NAME, \
.type = TYPE_DISK, \
.parse_atomic = 1, \
.dev_done_atomic = 1, \
.exec_atomic = 1, \
.attach = disk_attach, \
.detach = disk_detach, \
.parse = disk_parse, \
.dev_done = disk_done, \
.exec = disk_exec, \
}
#define DISK_SMALL_TIMEOUT (3 * HZ)

View File

@@ -32,29 +32,29 @@
# define MODISK_NAME "dev_modisk"
# define MODISK_PERF_NAME "dev_modisk_perf"
#define MODISK_TYPE { \
name: MODISK_NAME, \
type: TYPE_MOD, \
parse_atomic: 1, \
dev_done_atomic: 1, \
exec_atomic: 1, \
attach: modisk_attach, \
detach: modisk_detach, \
parse: modisk_parse, \
dev_done: modisk_done, \
#define MODISK_TYPE { \
.name = MODISK_NAME, \
.type = TYPE_MOD, \
.parse_atomic = 1, \
.dev_done_atomic = 1, \
.exec_atomic = 1, \
.attach = modisk_attach, \
.detach = modisk_detach, \
.parse = modisk_parse, \
.dev_done = modisk_done, \
}
#define MODISK_PERF_TYPE { \
name: MODISK_PERF_NAME, \
type: TYPE_MOD, \
parse_atomic: 1, \
dev_done_atomic: 1, \
exec_atomic: 1, \
attach: modisk_attach, \
detach: modisk_detach, \
parse: modisk_parse, \
dev_done: modisk_done, \
exec: modisk_exec, \
#define MODISK_PERF_TYPE { \
.name = MODISK_PERF_NAME, \
.type = TYPE_MOD, \
.parse_atomic = 1, \
.dev_done_atomic = 1, \
.exec_atomic = 1, \
.attach = modisk_attach, \
.detach = modisk_detach, \
.parse = modisk_parse, \
.dev_done = modisk_done, \
.exec = modisk_exec, \
}
#define MODISK_SMALL_TIMEOUT (3 * HZ)

View File

@@ -26,15 +26,15 @@
#define PROCESSOR_NAME "dev_processor"
#define PROCESSOR_TYPE { \
name: PROCESSOR_NAME, \
type: TYPE_PROCESSOR, \
parse_atomic: 1, \
/* dev_done_atomic: 1,*/ \
attach: processor_attach, \
/* detach: processor_detach,*/ \
parse: processor_parse, \
/* dev_done: processor_done*/ \
#define PROCESSOR_TYPE { \
.name = PROCESSOR_NAME, \
.type = TYPE_PROCESSOR, \
.parse_atomic = 1, \
/* .dev_done_atomic = 1,*/ \
.attach = processor_attach, \
/* .detach = processor_detach,*/ \
.parse = processor_parse, \
/* .dev_done = processor_done*/ \
}
#define PROCESSOR_RETRIES 2

View File

@@ -26,15 +26,15 @@
#define RAID_NAME "dev_raid"
#define RAID_TYPE { \
name: RAID_NAME, \
type: TYPE_RAID, \
parse_atomic: 1, \
/* dev_done_atomic: 1,*/ \
attach: raid_attach, \
/* detach: raid_detach,*/ \
parse: raid_parse, \
/* dev_done: raid_done*/ \
#define RAID_TYPE { \
.name = RAID_NAME, \
.type = TYPE_RAID, \
.parse_atomic = 1, \
/* .dev_done_atomic = 1,*/ \
.attach = raid_attach, \
/* .detach = raid_detach,*/ \
.parse = raid_parse, \
/* .dev_done = raid_done*/ \
}
#define RAID_RETRIES 2

View File

@@ -32,29 +32,29 @@
# define TAPE_NAME "dev_tape"
# define TAPE_PERF_NAME "dev_tape_perf"
#define TAPE_TYPE { \
name: TAPE_NAME, \
type: TYPE_TAPE, \
parse_atomic: 1, \
dev_done_atomic: 1, \
exec_atomic: 1, \
attach: tape_attach, \
detach: tape_detach, \
parse: tape_parse, \
dev_done: tape_done, \
#define TAPE_TYPE { \
.name = TAPE_NAME, \
.type = TYPE_TAPE, \
.parse_atomic = 1, \
.dev_done_atomic = 1, \
.exec_atomic = 1, \
.attach = tape_attach, \
.detach = tape_detach, \
.parse = tape_parse, \
.dev_done = tape_done, \
}
#define TAPE_PERF_TYPE { \
name: TAPE_PERF_NAME, \
type: TYPE_TAPE, \
parse_atomic: 1, \
dev_done_atomic: 1, \
exec_atomic: 1, \
attach: tape_attach, \
detach: tape_detach, \
parse: tape_parse, \
dev_done: tape_done, \
exec: tape_exec, \
#define TAPE_PERF_TYPE { \
.name = TAPE_PERF_NAME, \
.type = TYPE_TAPE, \
.parse_atomic = 1, \
.dev_done_atomic = 1, \
.exec_atomic = 1, \
.attach = tape_attach, \
.detach = tape_detach, \
.parse = tape_parse, \
.dev_done = tape_done, \
.exec = tape_exec, \
}
#define TAPE_RETRIES 2

View File

@@ -27,10 +27,10 @@
#include "scst_dev_handler.h"
#if defined(CONFIG_HIGHMEM4G) || defined(CONFIG_HIGHMEM64G)
#warning HIGHMEM kernel configurations are not supported by this module, \
#warning "HIGHMEM kernel configurations are not supported by this module, \
because nowadays it doesn't worth the effort. Consider change \
VMSPLIT option or use 64-bit configuration instead. See README file \
for details.
for details."
#endif
#define DEV_USER_MAJOR 237
@@ -2910,10 +2910,10 @@ static int dev_usr_parse(struct scst_cmd *cmd)
}
/* Needed only for /proc support */
#define USR_TYPE { \
name: DEV_USER_NAME, \
type: -1, \
parse: dev_usr_parse, \
#define USR_TYPE { \
.name = DEV_USER_NAME, \
.type = -1, \
.parse = dev_usr_parse, \
}
static struct scst_dev_type dev_user_devtype = USR_TYPE;

View File

@@ -254,59 +254,59 @@ static int vcdrom_write_proc(char *buffer, char **start, off_t offset,
static int vdisk_task_mgmt_fn(struct scst_mgmt_cmd *mcmd,
struct scst_tgt_dev *tgt_dev);
#define VDISK_TYPE { \
name: VDISK_NAME, \
type: TYPE_DISK, \
exec_sync: 1, \
threads_num: -1, \
parse_atomic: 1, \
exec_atomic: 0, \
dev_done_atomic: 1, \
attach: vdisk_attach, \
detach: vdisk_detach, \
attach_tgt: vdisk_attach_tgt, \
detach_tgt: vdisk_detach_tgt, \
parse: vdisk_parse, \
exec: vdisk_do_job, \
read_proc: vdisk_read_proc, \
write_proc: vdisk_write_proc, \
task_mgmt_fn: vdisk_task_mgmt_fn, \
#define VDISK_TYPE { \
.name = VDISK_NAME, \
.type = TYPE_DISK, \
.exec_sync = 1, \
.threads_num = -1, \
.parse_atomic = 1, \
.exec_atomic = 0, \
.dev_done_atomic = 1, \
.attach = vdisk_attach, \
.detach = vdisk_detach, \
.attach_tgt = vdisk_attach_tgt, \
.detach_tgt = vdisk_detach_tgt, \
.parse = vdisk_parse, \
.exec = vdisk_do_job, \
.read_proc = vdisk_read_proc, \
.write_proc = vdisk_write_proc, \
.task_mgmt_fn = vdisk_task_mgmt_fn, \
}
#define VDISK_BLK_TYPE { \
name: VDISK_NAME "_blk", \
type: TYPE_DISK, \
threads_num: 0, \
parse_atomic: 1, \
exec_atomic: 0, \
dev_done_atomic: 1, \
no_proc: 1, \
attach: vdisk_attach, \
detach: vdisk_detach, \
attach_tgt: vdisk_attach_tgt, \
detach_tgt: vdisk_detach_tgt, \
parse: vdisk_parse, \
exec: vdisk_do_job, \
task_mgmt_fn: vdisk_task_mgmt_fn, \
#define VDISK_BLK_TYPE { \
.name = VDISK_NAME "_blk", \
.type = TYPE_DISK, \
.threads_num = 0, \
.parse_atomic = 1, \
.exec_atomic = 0, \
.dev_done_atomic = 1, \
.no_proc = 1, \
.attach = vdisk_attach, \
.detach = vdisk_detach, \
.attach_tgt = vdisk_attach_tgt, \
.detach_tgt = vdisk_detach_tgt, \
.parse = vdisk_parse, \
.exec = vdisk_do_job, \
.task_mgmt_fn = vdisk_task_mgmt_fn, \
}
#define VCDROM_TYPE { \
name: VCDROM_NAME, \
type: TYPE_ROM, \
exec_sync: 1, \
threads_num: -1, \
parse_atomic: 1, \
exec_atomic: 0, \
dev_done_atomic: 1, \
attach: vdisk_attach, \
detach: vdisk_detach, \
attach_tgt: vdisk_attach_tgt, \
detach_tgt: vdisk_detach_tgt, \
parse: vcdrom_parse, \
exec: vcdrom_exec, \
read_proc: vcdrom_read_proc, \
write_proc: vcdrom_write_proc, \
task_mgmt_fn: vdisk_task_mgmt_fn, \
#define VCDROM_TYPE { \
.name = VCDROM_NAME, \
.type = TYPE_ROM, \
.exec_sync = 1, \
.threads_num = -1, \
.parse_atomic = 1, \
.exec_atomic = 0, \
.dev_done_atomic = 1, \
.attach = vdisk_attach, \
.detach = vdisk_detach, \
.attach_tgt = vdisk_attach_tgt, \
.detach_tgt = vdisk_detach_tgt, \
.parse = vcdrom_parse, \
.exec = vcdrom_exec, \
.read_proc = vcdrom_read_proc, \
.write_proc = vcdrom_write_proc, \
.task_mgmt_fn = vdisk_task_mgmt_fn, \
}
static DEFINE_MUTEX(scst_vdisk_mutex);

View File

@@ -149,7 +149,7 @@ MODULE_PARM_DESC(scst_max_cmd_mem, "Maximum memory allowed to be consumed by "
struct scst_dev_type scst_null_devtype =
{
name: "none",
.name = "none",
};
int __scst_register_target_template(struct scst_tgt_template *vtt,