input: fix sleep support, kill bad ifdefs, cleanup comments
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
drivers/input/input.c +61 -64
@@ -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 );
drivers/input/serio/serio.c +1 -1
@@ -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" );
Signature · 2 lines
Worst form of spam? Adding advertisment signatures ala sourceforge.net. What goes next? Inserting advertisment *into* email?
Quoted 6 lines · Pavel Machek
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.chas *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!