Skip to contentSkip to conversation

Staging: comedi: Remove useless code

PATCH In review Alessio Igor Bogani 2 participants 2 messages Mar 24, 2009 – Apr 21, 2009

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

PATCH 1/1 Staging: comedi: Remove useless code

Remove all code contained into CONFIG_COMEDI_RTAI, CONFIG_COMEDI_RTL, CONFIG_COMEDI_RTL_V1, CONFIG_COMEDI_FUSION and CONFIG_COMEDI_RT ifdef/endif preprocessor directives. Which all referred to method called "dual kernel approach" (where both a micro kernel OS and Linux running on same machine and IRQ dispatching is under the control of the first one) for achieve real-time behavior.

I take notice that:

1) Those are all completely undocumented.
2) No one express interest in keep those in sync so are unsupported.
3) As far I know, and at least for CONFIG_COMEDI_FUSION, are obsolete (FUSION was replaced by Xenomai long time ago).
4) Should be better to let respectively authors make a separate patch against Linux source and comedi drivers.
5) Removing those should do avoid confusion in Linux kernel developers.
6) Keep those in don't let us chance to break/change the interfaces.
7) Those aren't integrated with Kbuild so are useless in any case.
8) Removing those make the code more simple.

---
 drivers/staging/comedi/Kconfig                     |    7 -
 drivers/staging/comedi/Makefile                    |    1 -
 drivers/staging/comedi/comedi_fops.c               |   18 --
 drivers/staging/comedi/comedi_ksyms.c              |    7 -
 drivers/staging/comedi/comedi_rt.h                 |   75 -------
 drivers/staging/comedi/drivers/comedi_rt_timer.c   |   61 ------
 .../staging/comedi/kcomedilib/kcomedilib_main.c    |    9 -
 drivers/staging/comedi/rt.c                        |  216 --------------------
 drivers/staging/comedi/rt_pend_tq.c                |   52 -----
 9 files changed, 0 insertions(+), 446 deletions(-)
drivers/staging/comedi/Kconfig +0 -7
index 2d819d2..037ae4c 100644
@@ -13,13 +13,6 @@ config COMEDI_DEBUG
 	  This is an option for use by developers; most people should
 	  say N here. This enables comedi core and driver debugging.
 
-config COMEDI_RT
-	tristate "Comedi Real-time support"
-	depends on COMEDI && RT
-	default N
-	---help---
-	  Enable Real time support for the Comedi core.
-
 config COMEDI_PCI_DRIVERS
 	tristate "Comedi PCI drivers"
 	depends on COMEDI && PCI
drivers/staging/comedi/Makefile +0 -1
index afd1a19..793cf8c 100644
@@ -1,5 +1,4 @@
 obj-$(CONFIG_COMEDI) += comedi.o
-obj-$(CONFIG_COMEDI_RT) += comedi_rt.o
 
 obj-$(CONFIG_COMEDI)	+= kcomedilib/
 obj-$(CONFIG_COMEDI)	+= drivers/
drivers/staging/comedi/comedi_fops.c +0 -18
index 19dce2e..5c86002 100644
@@ -1097,13 +1097,6 @@ static int do_cmd_ioctl(struct comedi_device *dev, void *arg, void *file)
 
 	comedi_set_subdevice_runflags(s, ~0, SRF_USER | SRF_RUNNING);
 
-#ifdef CONFIG_COMEDI_RT
-	if (async->cmd.flags & TRIG_RT) {
-		if (comedi_switch_to_rt(dev) == 0)
-			comedi_set_subdevice_runflags(s, SRF_RT, SRF_RT);
-	}
-#endif
-
 	ret = s->do_cmd(dev, s);
 	if (ret == 0)
 		return 0;
@@ -1738,12 +1731,6 @@ void do_become_nonbusy(struct comedi_device *dev, struct comedi_subdevice *s)
 	struct comedi_async *async = s->async;
 
 	comedi_set_subdevice_runflags(s, SRF_RUNNING, 0);
-#ifdef CONFIG_COMEDI_RT
-	if (comedi_get_subdevice_runflags(s) & SRF_RT) {
-		comedi_switch_to_non_rt(dev);
-		comedi_set_subdevice_runflags(s, SRF_RT, 0);
-	}
-#endif
 	if (async) {
 		comedi_reset_async_buf(async);
 		async->inttrig = NULL;
@@ -2036,13 +2023,8 @@ void comedi_event(struct comedi_device *dev, struct comedi_subdevice *s)
 		if (comedi_get_subdevice_runflags(s) & SRF_USER) {
 
 			if (dev->rt) {
-#ifdef CONFIG_COMEDI_RT
-				/* pend wake up */
-				comedi_rt_pend_wakeup(&async->wait_head);
-#else
 				printk
 				    ("BUG: comedi_event() code unreachable\n");
-#endif
 			} else {
 				wake_up_interruptible(&async->wait_head);
 				if (s->subdev_flags & SDF_CMD_READ) {
drivers/staging/comedi/comedi_ksyms.c +0 -7
index 6e6fb97..a732e34 100644
@@ -46,13 +46,6 @@ EXPORT_SYMBOL(range_bipolar2_5);
 EXPORT_SYMBOL(range_unipolar10);
 EXPORT_SYMBOL(range_unipolar5);
 EXPORT_SYMBOL(range_unknown);
-#ifdef CONFIG_COMEDI_RT
-EXPORT_SYMBOL(comedi_free_irq);
-EXPORT_SYMBOL(comedi_request_irq);
-EXPORT_SYMBOL(comedi_switch_to_rt);
-EXPORT_SYMBOL(comedi_switch_to_non_rt);
-EXPORT_SYMBOL(rt_pend_call);
-#endif
 #ifdef CONFIG_COMEDI_DEBUG
 EXPORT_SYMBOL(comedi_debug);
 #endif
drivers/staging/comedi/comedi_rt.h +0 -75

108 lines not on this page · raw message

drivers/staging/comedi/drivers/comedi_rt_timer.c +0 -61

67 lines not on this page · raw message

drivers/staging/comedi/kcomedilib/kcomedilib_main.c +0 -9
index a4fa957..63e8b0d 100644
@@ -150,10 +150,6 @@ int comedi_command(void *d, struct comedi_cmd *cmd)
 
 	runflags = SRF_RUNNING;
 
-#ifdef CONFIG_COMEDI_RT
-	if (comedi_switch_to_rt(dev) == 0)
-		runflags |= SRF_RT;
-#endif
 	comedi_set_subdevice_runflags(s, ~0, runflags);
 
 	comedi_reset_async_buf(async);
@@ -449,11 +445,6 @@ int comedi_cancel(void *d, unsigned int subdevice)
 	if (ret)
 		return ret;
 
-#ifdef CONFIG_COMEDI_RT
-	if (comedi_get_subdevice_runflags(s) & SRF_RT)
-		comedi_switch_to_non_rt(dev);
-
-#endif
 	comedi_set_subdevice_runflags(s, SRF_RUNNING | SRF_RT, 0);
 	s->async->inttrig = NULL;
 	s->busy = NULL;
drivers/staging/comedi/rt.c +0 -216

231 lines not on this page · raw message

drivers/staging/comedi/rt_pend_tq.c +0 -52

74 lines not on this page · raw message

Signature · 1 line
1.6.0.4
#1 lore raw
Quoted 9 lines · Alessio Igor Bogani

Remove all code contained into CONFIG_COMEDI_RTAI, CONFIG_COMEDI_RTL, CONFIG_COMEDI_RTL_V1, CONFIG_COMEDI_FUSION and CONFIG_COMEDI_RT ifdef/endif preprocessor directives. Which all referred to method called "dual kernel approach" (where both a micro kernel OS and Linux running on same machine and IRQ dispatching is under the control of the first one) for achieve real-time behavior.

I take notice that:

Quoted 10 lines

1) Those are all completely undocumented.
2) No one express interest in keep those in sync so are unsupported.
3) As far I know, and at least for CONFIG_COMEDI_FUSION, are obsolete (FUSION was replaced by Xenomai long time ago).
4) Should be better to let respectively authors make a separate patch against Linux source and comedi drivers.
5) Removing those should do avoid confusion in Linux kernel developers.
6) Keep those in don't let us chance to break/change the interfaces.
7) Those aren't integrated with Kbuild so are useless in any case.
8) Removing those make the code more simple.

Can you run this by the other comedi developers? I think that there is some useful code in here, I don't want to just dump it all.

thanks,

greg k-h