Skip to contentSkip to conversation

kernel/, mm/, ipc/ designated initializer rework

PATCH New Rusty Russell 1 participant 1 message Jul 19, 2002

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kernel/, mm/, ipc/ designated initializer rework

Misc bits of the kernel rework.

Please apply,
Rusty.
PS. Whitespace is not *perfect*, but I really don't care. --
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.

Name: Designated initializers for kernel/, mm/ and ipc/
Author: Rusty Russell
Status: Trivial

D: The old form of designated initializers are obsolete: we need to
D: replace them with the ISO C forms before 2.6. Gcc has always supported
D: both forms anyway.

kernel/futex.c +4 -4
diff -urN -I \$.*\$ --exclude TAGS -X /home/rusty/current-dontdiff --minimal linux-2.5.26/kernel/futex.c working-2.5.26-designated-init/kernel/futex.c
@@ -245,8 +245,8 @@
 }
 
 static struct file_operations futex_fops = {
-	release:	futex_close,
-	poll:		futex_poll,
+	.release =	futex_close,
+	.poll =		futex_poll,
 };
 
 /* Signal allows caller to avoid the race which would occur if they
@@ -357,8 +357,8 @@
 }
 
 static struct file_system_type futex_fs_type = {
-	name:		"futexfs",
-	get_sb:		futexfs_get_sb,
+	.name =		"futexfs",
+	.get_sb =	futexfs_get_sb,
 };
 
 static int __init init(void)
kernel/kmod.c +7 -7
diff -urN -I \$.*\$ --exclude TAGS -X /home/rusty/current-dontdiff --minimal linux-2.5.26/kernel/kmod.c working-2.5.26-designated-init/kernel/kmod.c
@@ -338,15 +338,15 @@
 {
 	DECLARE_COMPLETION(work);
 	struct subprocess_info sub_info = {
-		complete:	&work,
-		path:		path,
-		argv:		argv,
-		envp:		envp,
-		retval:		0,
+		.complete =	&work,
+		.path =		path,
+		.argv =		argv,
+		.envp =		envp,
+		.retval =	0,
 	};
 	struct tq_struct tqs = {
-		routine:	__call_usermodehelper,
-		data:		&sub_info,
+		.routine =	__call_usermodehelper,
+		.data =		&sub_info,
 	};
 
 	if (path[0] == '\0')
kernel/module.c +17 -17
diff -urN -I \$.*\$ --exclude TAGS -X /home/rusty/current-dontdiff --minimal linux-2.5.26/kernel/module.c working-2.5.26-designated-init/kernel/module.c
@@ -44,15 +44,15 @@
 
 struct module kernel_module =
 {
-	size_of_struct:		sizeof(struct module),
-	name: 			"",
-	uc:	 		{ATOMIC_INIT(1)},
-	flags:			MOD_RUNNING,
-	syms:			__start___ksymtab,
-	ex_table_start:		__start___ex_table,
-	ex_table_end:		__stop___ex_table,
-	kallsyms_start:		__start___kallsyms,
-	kallsyms_end:		__stop___kallsyms,
+	.size_of_struct =	sizeof(struct module),
+	.name = 		"",
+	.uc =	 		{ATOMIC_INIT(1)},
+	.flags =		MOD_RUNNING,
+	.syms =			__start___ksymtab,
+	.ex_table_start =	__start___ex_table,
+	.ex_table_end =		__stop___ex_table,
+	.kallsyms_start =	__start___kallsyms,
+	.kallsyms_end =		__stop___kallsyms,
 };
 
 struct module *module_list = &kernel_module;
@@ -1132,10 +1132,10 @@
 	return 0;
 }
 struct seq_operations modules_op = {
-	start:	m_start,
-	next:	m_next,
-	stop:	m_stop,
-	show:	m_show
+	.start =m_start,
+	.next =	m_next,
+	.stop =	m_stop,
+	.show =	m_show
 };
 
 /*
@@ -1214,10 +1214,10 @@
 }
 
 struct seq_operations ksyms_op = {
-	start:	s_start,
-	next:	s_next,
-	stop:	s_stop,
-	show:	s_show
+	.start =s_start,
+	.next =	s_next,
+	.stop =	s_stop,
+	.show =	s_show
 };
 
 #else		/* CONFIG_MODULES */
kernel/platform.c +7 -7
diff -urN -I \$.*\$ --exclude TAGS -X /home/rusty/current-dontdiff --minimal linux-2.5.26/kernel/platform.c working-2.5.26-designated-init/kernel/platform.c
@@ -23,13 +23,13 @@
 }
 
 static struct platform_t default_platform = {
-	name:		"Default Platform",
-	suspend_states:	0,
-	reboot:		default_reboot,
-	halt:		default_halt,
-	power_off:	default_halt,
-	suspend:	default_suspend,
-	idle:		default_idle,
+	.name =		"Default Platform",
+	.suspend_states =0,
+	.reboot =	default_reboot,
+	.halt =		default_halt,
+	.power_off =	default_halt,
+	.suspend =	default_suspend,
+	.idle =		default_idle,
 };
 
 struct platform_t * platform = &default_platform;
kernel/sys.c +1 -1
diff -urN -I \$.*\$ --exclude TAGS -X /home/rusty/current-dontdiff --minimal linux-2.5.26/kernel/sys.c working-2.5.26-designated-init/kernel/sys.c
@@ -382,7 +382,7 @@
 void ctrl_alt_del(void)
 {
 	static struct tq_struct cad_tq = {
-		routine: deferred_cad,
+		.routine = deferred_cad,
 	};
 
 	if (C_A_D)
kernel/sysctl.c +3 -3
diff -urN -I \$.*\$ --exclude TAGS -X /home/rusty/current-dontdiff --minimal linux-2.5.26/kernel/sysctl.c working-2.5.26-designated-init/kernel/sysctl.c
@@ -126,12 +126,12 @@
 static int proc_sys_permission(struct inode *, int);
 
 struct file_operations proc_sys_file_operations = {
-	read:		proc_readsys,
-	write:		proc_writesys,
+	.read =		proc_readsys,
+	.write =	proc_writesys,
 };
 
 static struct inode_operations proc_sys_inode_operations = {
-	permission:	proc_sys_permission,
+	.permission =	proc_sys_permission,
 };
 
 extern struct proc_dir_entry *proc_sys_root;
kernel/user.c +3 -3
diff -urN -I \$.*\$ --exclude TAGS -X /home/rusty/current-dontdiff --minimal linux-2.5.26/kernel/user.c working-2.5.26-designated-init/kernel/user.c
@@ -28,9 +28,9 @@
 static spinlock_t uidhash_lock = SPIN_LOCK_UNLOCKED;
 
 struct user_struct root_user = {
-	__count:	ATOMIC_INIT(1),
-	processes:	ATOMIC_INIT(1),
-	files:		ATOMIC_INIT(0)
+	.__count =	ATOMIC_INIT(1),
+	.processes =	ATOMIC_INIT(1),
+	.files =	ATOMIC_INIT(0)
 };
 
 /*
mm/filemap.c +1 -1
diff -urN -I \$.*\$ --exclude TAGS -X /home/rusty/current-dontdiff --minimal linux-2.5.26/mm/filemap.c working-2.5.26-designated-init/mm/filemap.c
@@ -1591,7 +1591,7 @@
 }
 
 static struct vm_operations_struct generic_file_vm_ops = {
-	nopage:		filemap_nopage,
+	.nopage =	filemap_nopage,
 };
 
 /* This is used for a general mmap of a disk file */
mm/page_io.c +5 -5
diff -urN -I \$.*\$ --exclude TAGS -X /home/rusty/current-dontdiff --minimal linux-2.5.26/mm/page_io.c working-2.5.26-designated-init/mm/page_io.c
@@ -131,11 +131,11 @@
 }
 
 struct address_space_operations swap_aops = {
-	vm_writeback:	swap_vm_writeback,
-	writepage:	swap_writepage,
-	readpage:	swap_readpage,
-	sync_page:	block_sync_page,
-	set_page_dirty:	__set_page_dirty_nobuffers,
+	.vm_writeback =	swap_vm_writeback,
+	.writepage =	swap_writepage,
+	.readpage =	swap_readpage,
+	.sync_page =	block_sync_page,
+	.set_page_dirty =__set_page_dirty_nobuffers,
 };
 
 /*
mm/readahead.c +2 -2
diff -urN -I \$.*\$ --exclude TAGS -X /home/rusty/current-dontdiff --minimal linux-2.5.26/mm/readahead.c working-2.5.26-designated-init/mm/readahead.c
@@ -14,8 +14,8 @@
 #include <linux/backing-dev.h>
 
 struct backing_dev_info default_backing_dev_info = {
-	ra_pages:	(VM_MAX_READAHEAD * 1024) / PAGE_CACHE_SIZE,
-	state:		0,
+	.ra_pages =	(VM_MAX_READAHEAD * 1024) / PAGE_CACHE_SIZE,
+	.state =	0,
 };
 
 /*
mm/shmem.c +37 -37

119 lines not on this page · raw message

mm/slab.c +12 -12
diff -urN -I \$.*\$ --exclude TAGS -X /home/rusty/current-dontdiff --minimal linux-2.5.26/mm/slab.c working-2.5.26-designated-init/mm/slab.c
@@ -384,14 +384,14 @@
 
 /* internal cache of cache description objs */
 static kmem_cache_t cache_cache = {
-	slabs_full:	LIST_HEAD_INIT(cache_cache.slabs_full),
-	slabs_partial:	LIST_HEAD_INIT(cache_cache.slabs_partial),
-	slabs_free:	LIST_HEAD_INIT(cache_cache.slabs_free),
-	objsize:	sizeof(kmem_cache_t),
-	flags:		SLAB_NO_REAP,
-	spinlock:	SPIN_LOCK_UNLOCKED,
-	colour_off:	L1_CACHE_BYTES,
-	name:		"kmem_cache",
+	.slabs_full =	LIST_HEAD_INIT(cache_cache.slabs_full),
+	.slabs_partial =LIST_HEAD_INIT(cache_cache.slabs_partial),
+	.slabs_free =	LIST_HEAD_INIT(cache_cache.slabs_free),
+	.objsize =	sizeof(kmem_cache_t),
+	.flags =	SLAB_NO_REAP,
+	.spinlock =	SPIN_LOCK_UNLOCKED,
+	.colour_off =	L1_CACHE_BYTES,
+	.name =		"kmem_cache",
 };
 
 /* Guard access to the cache-chain. */
@@ -2034,10 +2034,10 @@
  */
 
 struct seq_operations slabinfo_op = {
-	start:	s_start,
-	next:	s_next,
-	stop:	s_stop,
-	show:	s_show
+	.start =s_start,
+	.next =	s_next,
+	.stop =	s_stop,
+	.show =	s_show
 };
 
 #define MAX_SLABINFO_WRITE 128
mm/swap_state.c +12 -12
diff -urN -I \$.*\$ --exclude TAGS -X /home/rusty/current-dontdiff --minimal linux-2.5.26/mm/swap_state.c working-2.5.26-designated-init/mm/swap_state.c
@@ -23,23 +23,23 @@
  * avoid some special-casing in other parts of the kernel.
  */
 static struct inode swapper_inode = {
-	i_mapping:	&swapper_space,
+	.i_mapping =	&swapper_space,
 };
 
 extern struct address_space_operations swap_aops;
 
 struct address_space swapper_space = {
-	page_tree:	RADIX_TREE_INIT(GFP_ATOMIC),
-	page_lock:	RW_LOCK_UNLOCKED,
-	clean_pages:	LIST_HEAD_INIT(swapper_space.clean_pages),
-	dirty_pages:	LIST_HEAD_INIT(swapper_space.dirty_pages),
-	io_pages:	LIST_HEAD_INIT(swapper_space.io_pages),
-	locked_pages:	LIST_HEAD_INIT(swapper_space.locked_pages),
-	host:		&swapper_inode,
-	a_ops:		&swap_aops,
-	i_shared_lock:	SPIN_LOCK_UNLOCKED,
-	private_lock:	SPIN_LOCK_UNLOCKED,
-	private_list:	LIST_HEAD_INIT(swapper_space.private_list),
+	.page_tree =	RADIX_TREE_INIT(GFP_ATOMIC),
+	.page_lock =	RW_LOCK_UNLOCKED,
+	.clean_pages =	LIST_HEAD_INIT(swapper_space.clean_pages),
+	.dirty_pages =	LIST_HEAD_INIT(swapper_space.dirty_pages),
+	.io_pages =	LIST_HEAD_INIT(swapper_space.io_pages),
+	.locked_pages =	LIST_HEAD_INIT(swapper_space.locked_pages),
+	.host =		&swapper_inode,
+	.a_ops =	&swap_aops,
+	.i_shared_lock =SPIN_LOCK_UNLOCKED,
+	.private_lock =	SPIN_LOCK_UNLOCKED,
+	.private_list =	LIST_HEAD_INIT(swapper_space.private_list),
 };
 
 #ifdef SWAP_CACHE_INFO
ipc/shm.c +4 -4
diff -urpN -I \$.*\$ --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal linux-2.5.26.31511/ipc/shm.c linux-2.5.26.31511.updated/ipc/shm.c
@@ -166,13 +166,13 @@ static int shm_mmap(struct file * file, 
 }
 
 static struct file_operations shm_file_operations = {
-	mmap:	shm_mmap
+	.mmap =	shm_mmap
 };
 
 static struct vm_operations_struct shm_vm_ops = {
-	open:	shm_open,	/* callback for a new vm-area open */
-	close:	shm_close,	/* callback for when the vm-area is released */
-	nopage:	shmem_nopage,
+	.open =	shm_open,	/* callback for a new vm-area open */
+	.close =shm_close,	/* callback for when the vm-area is released */
+	.nopage =shmem_nopage,
 };
 
 static int newseg (key_t key, int shmflg, size_t size)