[PATCH 2/3] os: remove useless smart scheduler macros

Tiago Vignatti tiago.vignatti at nokia.com
Tue Sep 7 05:39:18 PDT 2010


Signed-off-by: Tiago Vignatti <tiago.vignatti at nokia.com>
---
 os/utils.c |   21 ++-------------------
 1 files changed, 2 insertions(+), 19 deletions(-)

diff --git a/os/utils.c b/os/utils.c
index 547acfc..bf3d615 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -1116,17 +1116,9 @@ XNFstrdup(const char *s)
     return ret;
 }
 
-
-#define SMART_SCHEDULE_POSSIBLE
-#ifdef SMART_SCHEDULE_POSSIBLE
-#define SMART_SCHEDULE_SIGNAL		SIGALRM
-#define SMART_SCHEDULE_TIMER		ITIMER_REAL
-#endif
-
 void
 SmartScheduleStopTimer (void)
 {
-#ifdef SMART_SCHEDULE_POSSIBLE
     struct itimerval	timer;
     
     if (SmartScheduleDisable)
@@ -1136,13 +1128,11 @@ SmartScheduleStopTimer (void)
     timer.it_value.tv_sec = 0;
     timer.it_value.tv_usec = 0;
     (void) setitimer (ITIMER_REAL, &timer, 0);
-#endif
 }
 
 void
 SmartScheduleStartTimer (void)
 {
-#ifdef SMART_SCHEDULE_POSSIBLE
     struct itimerval	timer;
     
     if (SmartScheduleDisable)
@@ -1152,21 +1142,17 @@ SmartScheduleStartTimer (void)
     timer.it_value.tv_sec = 0;
     timer.it_value.tv_usec = SmartScheduleInterval * 1000;
     setitimer (ITIMER_REAL, &timer, 0);
-#endif
 }
 
-#ifdef SMART_SCHEDULE_POSSIBLE
 static void
 SmartScheduleTimer (int sig)
 {
     SmartScheduleTime += SmartScheduleInterval;
 }
-#endif
 
 Bool
 SmartScheduleInit (void)
 {
-#ifdef SMART_SCHEDULE_POSSIBLE
     struct sigaction	act;
 
     if (SmartScheduleDisable)
@@ -1177,16 +1163,13 @@ SmartScheduleInit (void)
     /* Set up the timer signal function */
     act.sa_handler = SmartScheduleTimer;
     sigemptyset (&act.sa_mask);
-    sigaddset (&act.sa_mask, SMART_SCHEDULE_SIGNAL);
-    if (sigaction (SMART_SCHEDULE_SIGNAL, &act, 0) < 0)
+    sigaddset (&act.sa_mask, SIGALRM);
+    if (sigaction (SIGALRM, &act, 0) < 0)
     {
 	perror ("sigaction for smart scheduler");
 	return FALSE;
     }
     return TRUE;
-#else
-    return FALSE;
-#endif
 }
 
 #ifdef SIG_BLOCK
-- 
1.7.1.226.g770c5



More information about the xorg-devel mailing list