[syslinux:elflink] sys/times.h: Mark times() static inline

syslinux-bot for Matt Fleming matt.fleming at linux.intel.com
Thu Feb 17 16:00:19 PST 2011


Commit-ID:  d3c3e191b8e2515422d7e38d2fcc8df05d1faff7
Gitweb:     http://syslinux.zytor.com/commit/d3c3e191b8e2515422d7e38d2fcc8df05d1faff7
Author:     Matt Fleming <matt.fleming at linux.intel.com>
AuthorDate: Thu, 17 Feb 2011 22:03:27 +0000
Committer:  H. Peter Anvin <hpa at linux.intel.com>
CommitDate: Thu, 17 Feb 2011 15:59:53 -0800

sys/times.h: Mark times() static inline

As times() is just an accessor function for accessing __ms_timer it's
worth marking it as static inline so that we don't incur any function
call overhead just for accessing a symbol.

Signed-off-by: Matt Fleming <matt.fleming at linux.intel.com>
Signed-off-by: H. Peter Anvin <hpa at linux.intel.com>


---
 com32/include/sys/times.h |    8 +++++++-
 com32/lib/sys/times.c     |   42 ------------------------------------------
 2 files changed, 7 insertions(+), 43 deletions(-)

diff --git a/com32/include/sys/times.h b/com32/include/sys/times.h
index 9047006..5eda295 100644
--- a/com32/include/sys/times.h
+++ b/com32/include/sys/times.h
@@ -16,6 +16,12 @@ struct tms {
 
 typedef uint32_t clock_t;
 
-clock_t times(struct tms *);
+extern volatile uint32_t __ms_timer;
+
+static inline clock_t times(struct tms *buf)
+{
+    (void)buf;
+    return __ms_timer;
+}
 
 #endif /* _SYS_TIMES_H */
diff --git a/com32/lib/sys/times.c b/com32/lib/sys/times.c
deleted file mode 100644
index 518ba82..0000000
--- a/com32/lib/sys/times.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/* ----------------------------------------------------------------------- *
- *
- *   Copyright 2004-2008 H. Peter Anvin - All Rights Reserved
- *
- *   Permission is hereby granted, free of charge, to any person
- *   obtaining a copy of this software and associated documentation
- *   files (the "Software"), to deal in the Software without
- *   restriction, including without limitation the rights to use,
- *   copy, modify, merge, publish, distribute, sublicense, and/or
- *   sell copies of the Software, and to permit persons to whom
- *   the Software is furnished to do so, subject to the following
- *   conditions:
- *
- *   The above copyright notice and this permission notice shall
- *   be included in all copies or substantial portions of the Software.
- *
- *   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- *   OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *   NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- *   HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- *   WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- *   FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- *   OTHER DEALINGS IN THE SOFTWARE.
- *
- * ----------------------------------------------------------------------- */
-
-/*
- * sys/times.c
- *
- * Returns something like a clock.
- */
-
-#include <sys/times.h>
-#include <syslinux/pmapi.h>
-#include <com32.h>
-
-clock_t times(struct tms * buf)
-{
-    (void)buf;
-    return __ms_timer;
-}



More information about the Syslinux-commits mailing list