Skip to contentSkip to conversation

: Use C99 struct initializers in ip22 code

PATCH New Juan Quintela 1 participant 1 message Dec 18, 2002 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 : Use C99 struct initializers in ip22 code

Hi
switch to C99 declarations in ip22 code. note that some of the structs was already initialized that way.

There are also two printk labels in the middle.

Later, Juan.

Index: arch/mips/sgi-ip22/ip22-eisa.c
===================================================================
RCS file: /home/cvs/linux/arch/mips/sgi-ip22/ip22-eisa.c,v retrieving revision 1.1.2.1

mips/sgi-ip22/ip22-eisa.c +18 -18
diff -u -r1.1.2.1 ip22-eisa.c
@@ -153,14 +153,13 @@
 }
 
 static struct hw_interrupt_type ip22_eisa1_irq_type = {
-	"IP22 EISA",
-	startup_eisa1_irq,
-	shutdown_eisa1_irq,
-	enable_eisa1_irq,
-	disable_eisa1_irq,
-	mask_and_ack_eisa1_irq,
-	end_eisa1_irq,
-	NULL
+	.typename	= "IP22 EISA",
+	.startup	= startup_eisa1_irq,
+	.shutdown	= shutdown_eisa1_irq,
+	.enable		= enable_eisa1_irq,
+	.disable	= disable_eisa1_irq,
+	.ack		= mask_and_ack_eisa1_irq,
+	.end		= end_eisa1_irq,
 };
 
 static void enable_eisa2_irq(unsigned int irq)
@@ -217,22 +216,23 @@
 }
 
 static struct hw_interrupt_type ip22_eisa2_irq_type = {
-	"IP22 EISA",
-	startup_eisa2_irq,
-	shutdown_eisa2_irq,
-	enable_eisa2_irq,
-	disable_eisa2_irq,
-	mask_and_ack_eisa2_irq,
-	end_eisa2_irq,
-	NULL
+	.typename	= "IP22 EISA",
+	.startup	= startup_eisa2_irq,
+	.shutdown	= shutdown_eisa2_irq,
+	.enable		= enable_eisa2_irq,
+	.disable	= disable_eisa2_irq,
+	.ack		= mask_and_ack_eisa2_irq,
+	.end		= end_eisa2_irq,
 };
 
 static struct irqaction eisa_action = {
-	ip22_eisa_intr, 0, 0, "EISA", NULL, NULL
+	.handler	= ip22_eisa_intr,
+	.name		= "EISA",
 };
 
 static struct irqaction cascade_action = {
-	no_action, 0, 0, "EISA cascade", NULL, NULL
+	.handler	= no_action,
+	.name		= "EISA cascade",
 };
 
 int __init ip22_eisa_init(void)

Index: arch/mips/sgi-ip22/ip22-gio.c
===================================================================
RCS file: /home/cvs/linux/arch/mips/sgi-ip22/ip22-gio.c,v retrieving revision 1.1.2.3

mips/sgi-ip22/ip22-gio.c +19 -35

60 lines not on this page · raw message

Index: arch/mips/sgi-ip22/ip22-int.c
===================================================================
RCS file: /home/cvs/linux/arch/mips/sgi-ip22/ip22-int.c,v retrieving revision 1.2.2.6

mips/sgi-ip22/ip22-int.c +57 -42

130 lines not on this page · raw message

Index: arch/mips/sgi-ip22/ip22-reset.c
===================================================================
RCS file: /home/cvs/linux/arch/mips/sgi-ip22/ip22-reset.c,v retrieving revision 1.1.2.4

mips/sgi-ip22/ip22-reset.c +1 -3
diff -u -r1.1.2.4 ip22-reset.c
@@ -220,9 +220,7 @@
 }
 
 static struct notifier_block panic_block = {
-	panic_event,
-	NULL,
-	0
+	.notifier_call	= panic_event,
 };
 
 void indy_reboot_setup(void)

Index: arch/mips/sgi-ip22/ip22-system.c
===================================================================
RCS file: /home/cvs/linux/arch/mips/sgi-ip22/ip22-system.c,v retrieving revision 1.1.2.7

mips/sgi-ip22/ip22-system.c +31 -12

49 lines not on this page · raw message

Index: drivers/sgi/char/ds1286.c
===================================================================
RCS file: /home/cvs/linux/drivers/sgi/char/ds1286.c,v retrieving revision 1.14.2.2

sgi/char/ds1286.c +3 -3
diff -u -r1.14.2.2 ds1286.c
@@ -290,9 +290,9 @@
 
 static struct miscdevice ds1286_dev=
 {
-	RTC_MINOR,
-	"rtc",
-	&ds1286_fops
+	.minor	= RTC_MINOR,
+	.name	= "rtc",
+	.fops	= &ds1286_fops,
 };
 
 int __init ds1286_init(void)

Index: drivers/sgi/char/graphics.c
===================================================================
RCS file: /home/cvs/linux/drivers/sgi/char/graphics.c,v retrieving revision 1.30.2.2

sgi/char/graphics.c +6 -2
diff -u -r1.30.2.2 graphics.c
@@ -299,12 +293,16 @@
 
 /* /dev/graphics */
 static struct miscdevice dev_graphics = {
-	SGI_GRAPHICS_MINOR, "sgi-graphics", &sgi_graphics_fops
+	.minor	= SGI_GRAPHICS_MINOR,
+	.name	= "sgi-graphics",
+	.fops	= &sgi_graphics_fops,
 };
 
 /* /dev/opengl */
 static struct miscdevice dev_opengl = {
-	SGI_OPENGL_MINOR, "sgi-opengl", &sgi_graphics_fops
+	.minor	= SGI_OPENGL_MINOR,
+	.name	= "sgi-opengl",
+	.fops	= &sgi_graphics_fops,
 };
 
 /* This is called later from the misc-init routine */

Index: drivers/sgi/char/streamable.c
===================================================================
RCS file: /home/cvs/linux/drivers/sgi/char/streamable.c,v retrieving revision 1.13.4.2

sgi/char/streamable.c +11 -5
diff -u -r1.13.4.2 streamable.c
@@ -53,7 +53,7 @@
 static int
 sgi_gfx_ioctl (struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
 {
-	printk ("GFX: ioctl 0x%x %ld called\n", cmd, arg);
+	printk (KERN_BEBUG "GFX: ioctl 0x%x %ld called\n", cmd, arg);
 	return 0;
 	return -EINVAL;
 }
@@ -63,7 +63,9 @@
 };
 
 static struct miscdevice dev_gfx = {
-	SGI_GFX_MINOR, "sgi-gfx", &sgi_gfx_fops
+	.minor	= SGI_GFX_MINOR,
+	.name	= "sgi-gfx",
+	.fops	= &sgi_gfx_fops,
 };
 
 /* /dev/input/keyboard streams device */
@@ -172,7 +174,9 @@
 };
 
 static struct miscdevice dev_input_keyboard = {
-	SGI_STREAMS_KEYBOARD, "streams-keyboard", &sgi_keyb_fops
+	.minor	= SGI_STREAMS_KEYBOARD,
+	.name	= "streams-keyboard",
+	.fops	= &sgi_keyb_fops,
 };
 
 /* /dev/input/mouse streams device */
@@ -305,13 +309,15 @@
 
 /* /dev/input/mouse */
 static struct miscdevice dev_input_mouse = {
-	SGI_STREAMS_KEYBOARD, "streams-mouse", &sgi_mouse_fops
+	.minor	= SGI_STREAMS_KEYBOARD,
+	.name	= "streams-mouse",
+	.fops	= &sgi_mouse_fops,
 };
 
 void
 streamable_init (void)
 {
-	printk ("streamable misc devices registered (keyb:%d, gfx:%d)\n",
+	printk (KERN_INFO "streamable misc devices registered (keyb:%d, gfx:%d)\n",
 		SGI_STREAMS_KEYBOARD, SGI_GFX_MINOR);
 
 	misc_register (&dev_gfx);

Index: drivers/sgi/char/usema.c
===================================================================
RCS file: /home/cvs/linux/drivers/sgi/char/usema.c,v retrieving revision 1.22.2.2

sgi/char/usema.c +4 -2
diff -u -r1.22.2.2 usema.c
@@ -170,13 +170,15 @@
 };
 
 static struct miscdevice dev_usemaclone = {
-	SGI_USEMACLONE, "usemaclone", &sgi_usemaclone_fops
+	.minor	= SGI_USEMACLONE,
+	.name	= "usemaclone",
+	.fops	= &sgi_usemaclone_fops,
 };
 
 void
 usema_init(void)
 {
-	printk("usemaclone misc device registered (minor: %d)\n",
+	printk(KERN_INFO "usemaclone misc device registered (minor: %d)\n",
 	       SGI_USEMACLONE);
 	misc_register(&dev_usemaclone);
 }
Signature · 2 lines
In theory, practice and theory are the same, but in practice they 
are different -- Larry McVoy