public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* input: fix sleep support, kill bad ifdefs, cleanup comments
@ 2002-07-25 10:37 Pavel Machek
  2002-07-26  0:31 ` Marcin Dalecki
  0 siblings, 1 reply; 2+ messages in thread
From: Pavel Machek @ 2002-07-25 10:37 UTC (permalink / raw)
  To: vojtech, kernel list

Hi!

It is possible to kill few #ifdefs from input.c, so I did that.

Comments far to the left hurt readability in my eyes (I believe
input.c has *way* too much comments, too, but...).

Fixed serio.c so its sleep support actually works.
							Pavel

--- clean/drivers/input/input.c	Tue Jul  9 04:54:08 2002
+++ linux-swsusp/drivers/input/input.c	Thu Jul 25 12:21:55 2002
@@ -429,7 +429,10 @@
 	if (value != 0)
 		printk(KERN_WARNING "input.c: hotplug returned %d\n", value);
 }
-
+#else
+static void input_call_hotplug(char *verb, struct input_dev *dev)
+{
+}
 #endif
 
 void input_register_device(struct input_dev *dev)
@@ -438,9 +441,9 @@
 	struct input_handle *handle;
 	struct input_device_id *id;
 
-/*
- * Initialize repeat timer to default values.
- */
+	/*
+	 * Initialize repeat timer to default values.
+	 */
 
 	init_timer(&dev->timer);
 	dev->timer.data = (long) dev;
@@ -448,16 +451,16 @@
 	dev->rep[REP_DELAY] = HZ/4;
 	dev->rep[REP_PERIOD] = HZ/33;
 
-/*
- * Add the device.
- */
+	/*
+	 * Add the device.
+	 */
 
 	dev->next = input_dev;	
 	input_dev = dev;
 
-/*
- * Notify handlers.
- */
+	/*
+	 * Notify handlers.
+	 */
 
 	while (handler) {
 		if ((id = input_match_device(handler->id_table, dev)))
@@ -466,17 +469,15 @@
 		handler = handler->next;
 	}
 
-/*
- * Notify the hotplug agent.
- */
+	/*
+	 * Notify the hotplug agent.
+	 */
 
-#ifdef CONFIG_HOTPLUG
 	input_call_hotplug("add", dev);
-#endif
 
-/*
- * Notify /proc.
- */
+	/*
+	 * Notify /proc.
+	 */
 
 #ifdef CONFIG_PROC_FS
 	input_devices_state++;
@@ -491,21 +492,21 @@
 
 	if (!dev) return;
 
-/*
- * Turn off power management for the device.
- */
+	/*
+	 * Turn off power management for the device.
+	 */
 	if (dev->pm_dev)
 		pm_unregister(dev->pm_dev);
 
-/*
- * Kill any pending repeat timers.
- */
+	/*
+	 * Kill any pending repeat timers.
+	 */
 
 	del_timer(&dev->timer);
 
-/*
- * Notify handlers.
- */
+	/*
+	 * Notify handlers.
+	 */
 
 	while (handle) {
 		dnext = handle->dnext;
@@ -514,22 +515,20 @@
 		handle = dnext;
 	}
 
-/*
- * Notify the hotplug agent.
- */
+	/*
+	 * Notify the hotplug agent.
+	 */
 
-#ifdef CONFIG_HOTPLUG
 	input_call_hotplug("remove", dev);
-#endif
 
-/*
- * Remove the device.
- */
+	/*
+	 * Remove the device.
+	 */
 	input_find_and_remove(struct input_dev, input_dev, dev, next);
 
-/*
- * Notify /proc.
- */
+	/*
+	 * Notify /proc.
+	 */
 
 #ifdef CONFIG_PROC_FS
 	input_devices_state++;
@@ -545,23 +544,23 @@
 
 	if (!handler) return;
 
-/*
- * Add minors if needed.
- */
+	/*
+	 * Add minors if needed.
+	 */
 
 	if (handler->fops != NULL)
 		input_table[handler->minor >> 5] = handler;
 
-/*
- * Add the handler.
- */
+	/*
+	 * Add the handler.
+	 */
 
 	handler->next = input_handler;	
 	input_handler = handler;
 	
-/*
- * Notify it about all existing devices.
- */
+	/*
+	 * Notify it about all existing devices.
+	 */
 
 	while (dev) {
 		if ((id = input_match_device(handler->id_table, dev)))
@@ -570,9 +569,9 @@
 		dev = dev->next;
 	}
 
-/*
- * Notify /proc.
- */
+	/*
+	 * Notify /proc.
+	 */
 
 #ifdef CONFIG_PROC_FS
 	input_devices_state++;
@@ -585,9 +584,9 @@
 	struct input_handle *handle = handler->handle;
 	struct input_handle *hnext;
 
-/*
- * Tell the handler to disconnect from all devices it keeps open.
- */
+	/*
+	 * Tell the handler to disconnect from all devices it keeps open.
+	 */
 
 	while (handle) {
 		hnext = handle->hnext;
@@ -596,21 +595,21 @@
 		handle = hnext;
 	}
 
-/*
- * Remove it.
- */
+	/*
+	 * Remove it.
+	 */
 	input_find_and_remove(struct input_handler, input_handler, handler,
 				next);
 
-/*
- * Remove minors.
- */
+	/*
+	 * Remove minors.
+	 */
 	if (handler->fops != NULL)
 		input_table[handler->minor >> 5] = NULL;
 
-/*
- * Notify /proc.
- */
+	/*
+	 * Notify /proc.
+	 */
 
 #ifdef CONFIG_PROC_FS
 	input_devices_state++;
@@ -820,11 +819,9 @@
 
 static void __exit input_exit(void)
 {
-#ifdef CONFIG_PROC_FS
 	remove_proc_entry("devices", proc_bus_input_dir);
 	remove_proc_entry("handlers", proc_bus_input_dir);
 	remove_proc_entry("input", proc_bus);
-#endif
 	devfs_unregister(input_devfs_handle);
         if (devfs_unregister_chrdev(INPUT_MAJOR, "input"))
                 printk(KERN_ERR "input: can't unregister char major %d", INPUT_MAJOR);
--- clean/drivers/input/serio/serio.c	Tue Jul 23 10:40:01 2002
+++ linux-swsusp/drivers/input/serio/serio.c	Thu Jul 25 12:02:51 2002
@@ -94,9 +94,9 @@
 
 	do {
 		serio_handle_events();
+		interruptible_sleep_on(&serio_wait); 
 		if (current->flags & PF_FREEZE)
 			refrigerator(PF_IOTHREAD);
-		interruptible_sleep_on(&serio_wait); 
 	} while (!signal_pending(current));
 
 	printk(KERN_DEBUG "serio: kseriod exiting");

-- 
Worst form of spam? Adding advertisment signatures ala sourceforge.net.
What goes next? Inserting advertisment *into* email?

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

* Re: input: fix sleep support, kill bad ifdefs, cleanup comments
  2002-07-25 10:37 input: fix sleep support, kill bad ifdefs, cleanup comments Pavel Machek
@ 2002-07-26  0:31 ` Marcin Dalecki
  0 siblings, 0 replies; 2+ messages in thread
From: Marcin Dalecki @ 2002-07-26  0:31 UTC (permalink / raw)
  To: Pavel Machek; +Cc: vojtech, kernel list

Pavel Machek wrote:
> Hi!
> 
> It is possible to kill few #ifdefs from input.c, so I did that.
> 
> Comments far to the left hurt readability in my eyes (I believe
> input.c has *way* too much comments, too, but...).

Yes that's Vojtech in action. They don't just hurt my eyes. More 
importantly - they interferre with the usage of folding in some editors.
So please consider a style change. (And using FB if console is to narrow
for you. vga=0x318 always worked for me. No GNOME, no KDE, just X11 + 
MWM is a good terminal launcher as well - even if rebooting frequently.)

However: Please note that I greatly welcome that Vojtech
actually *does* good commenting in exceptionally *exemplary* 
comprehensive and adequate style!





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

end of thread, other threads:[~2002-07-26  4:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-07-25 10:37 input: fix sleep support, kill bad ifdefs, cleanup comments Pavel Machek
2002-07-26  0:31 ` Marcin Dalecki

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