public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] C99 initializers for drivers/macintosh/mac_hid.c
@ 2003-02-15 20:39 Art Haas
  2003-02-17  9:40 ` Geert Uytterhoeven
  0 siblings, 1 reply; 3+ messages in thread
From: Art Haas @ 2003-02-15 20:39 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-mac68k, linuxppc-dev

Hi.

This patch converts the file to use C99 initializers to improve
readability and remove warnings if '-W' is used.

Art Haas

===== drivers/macintosh/mac_hid.c 1.8 vs edited =====
--- 1.8/drivers/macintosh/mac_hid.c	Tue Oct  8 05:51:31 2002
+++ edited/drivers/macintosh/mac_hid.c	Sat Feb 15 13:19:37 2003
@@ -25,38 +25,56 @@
 
 #if defined(CONFIG_SYSCTL)
 /* file(s) in /proc/sys/dev/mac_hid */
-ctl_table mac_hid_files[] =
-{
-  {
-    DEV_MAC_HID_MOUSE_BUTTON_EMULATION,
-    "mouse_button_emulation", &mouse_emulate_buttons, sizeof(int),
-    0644, NULL, &proc_dointvec
-  },
-  {
-    DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE,
-    "mouse_button2_keycode", &mouse_button2_keycode, sizeof(int),
-    0644, NULL, &proc_dointvec
-  },
-  {
-    DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE,
-    "mouse_button3_keycode", &mouse_button3_keycode, sizeof(int),
-    0644, NULL, &proc_dointvec
-  },
-  { 0 }
+ctl_table mac_hid_files[] = {
+	{
+		.ctl_name	= DEV_MAC_HID_MOUSE_BUTTON_EMULATION,
+		.procname	= "mouse_button_emulation",
+		.data		= &mouse_emulate_buttons,
+		.maxlen		= sizeof(int),
+		.mode		= 0644,
+		.proc_handler	= &proc_dointvec,
+	},
+	{
+		.ctl_name	= DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE,
+		.procname	= "mouse_button2_keycode",
+		.data		= &mouse_button2_keycode,
+		.maxlen		= sizeof(int),
+		.mode		= 0644,
+		.proc_handler	= &proc_dointvec,
+	},
+	{
+		.ctl_name	= DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE,
+		.procname	= "mouse_button3_keycode",
+		.data		= &mouse_button3_keycode,
+		.maxlen		= sizeof(int),
+		.mode		= 0644,
+		.proc_handler	= &proc_dointvec,
+	},
+	{ .ctl_name = 0 }
 };
 
 /* dir in /proc/sys/dev */
-ctl_table mac_hid_dir[] =
-{
-  { DEV_MAC_HID, "mac_hid", NULL, 0, 0555, mac_hid_files },
-  { 0 }
+ctl_table mac_hid_dir[] = {
+	{
+		.ctl_name	= DEV_MAC_HID,
+		.procname	= "mac_hid",
+		.maxlen		= 0,
+		.mode		= 0555,
+		.child		= mac_hid_files,
+	},
+	{ .ctl_name = 0 }
 };
 
 /* /proc/sys/dev itself, in case that is not there yet */
-ctl_table mac_hid_root_dir[] =
-{
-  { CTL_DEV, "dev", NULL, 0, 0555, mac_hid_dir },
-  { 0 }
+ctl_table mac_hid_root_dir[] = {
+	{
+		.ctl_name	= CTL_DEV,
+		.procname	= "dev",
+		.maxlen		= 0,
+		.mode		= 0555,
+		.child		= mac_hid_dir,
+	},
+	{ .ctl_name = 0 }
 };
 
 static struct ctl_table_header *mac_hid_sysctl_header;
-- 
They that can give up essential liberty to obtain a little temporary safety
deserve neither liberty nor safety.
 -- Benjamin Franklin, Historical Review of Pennsylvania, 1759

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] C99 initializers for drivers/macintosh/mac_hid.c
  2003-02-15 20:39 [PATCH] C99 initializers for drivers/macintosh/mac_hid.c Art Haas
@ 2003-02-17  9:40 ` Geert Uytterhoeven
  0 siblings, 0 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2003-02-17  9:40 UTC (permalink / raw)
  To: Art Haas; +Cc: Linux Kernel Development, Linux/m68k on Mac,
	Linux/PPC Development

On Sat, 15 Feb 2003, Art Haas wrote:
> This patch converts the file to use C99 initializers to improve
> readability and remove warnings if '-W' is used.
> 
> Art Haas
> 
> ===== drivers/macintosh/mac_hid.c 1.8 vs edited =====
> --- 1.8/drivers/macintosh/mac_hid.c	Tue Oct  8 05:51:31 2002
> +++ edited/drivers/macintosh/mac_hid.c	Sat Feb 15 13:19:37 2003

Apparently this file is no longer used? I couldn't find CONFIG_MAC_EMUMOUSEBTN
in any Kconfig, unless it's in the PPC tree only.

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] C99 initializers for drivers/macintosh/mac_hid.c
       [not found] <200302171957.42597@enzo.bigblue.local>
@ 2003-02-17 21:22 ` Geert Uytterhoeven
  0 siblings, 0 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2003-02-17 21:22 UTC (permalink / raw)
  To: Franz Sirl
  Cc: Art Haas, Linux Kernel Development, Linux/m68k on Mac,
	Linux/PPC Development

On Mon, 17 Feb 2003, Franz Sirl wrote:
> On Monday 17 February 2003 10:40, Geert Uytterhoeven wrote:
> > On Sat, 15 Feb 2003, Art Haas wrote:
> > > This patch converts the file to use C99 initializers to improve
> > > readability and remove warnings if '-W' is used.
> > >
> > > Art Haas
> > >
> > > ===== drivers/macintosh/mac_hid.c 1.8 vs edited =====
> > > --- 1.8/drivers/macintosh/mac_hid.c	Tue Oct  8 05:51:31 2002
> > > +++ edited/drivers/macintosh/mac_hid.c	Sat Feb 15 13:19:37 2003
> >
> > Apparently this file is no longer used? I couldn't find
> > CONFIG_MAC_EMUMOUSEBTN in any Kconfig, unless it's in the PPC tree only.
> 
> Huh? It's in arch/ppc/Kconfig, even in plain Linus tree. Unfortunately it's 
> still impossible with current input layer (no way to prevent events from 
> reaching other handlers) to clean it up or move it to userspace, so it has to 
> stay :-(.

Aarghl, I keep on using grep with the CONFIG_ part included...

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-02-17 21:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-15 20:39 [PATCH] C99 initializers for drivers/macintosh/mac_hid.c Art Haas
2003-02-17  9:40 ` Geert Uytterhoeven
     [not found] <200302171957.42597@enzo.bigblue.local>
2003-02-17 21:22 ` Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox