u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
* [PATCH] lib: remove superfluous #ifdefs from date.c
@ 2021-06-14 16:47 Heinrich Schuchardt
  0 siblings, 0 replies; only message in thread
From: Heinrich Schuchardt @ 2021-06-14 16:47 UTC (permalink / raw)
  To: Tom Rini; +Cc: Bin Meng, u-boot, Heinrich Schuchardt

We should avoid #ifdef in C modules. Unused functions are eliminated by the
linker.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 lib/date.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/lib/date.c b/lib/date.c
index 0456de78ab..c589d9ed3a 100644
--- a/lib/date.c
+++ b/lib/date.c
@@ -10,8 +10,6 @@
 #include <rtc.h>
 #include <linux/time.h>

-#if defined(CONFIG_LIB_DATE) || defined(CONFIG_TIMESTAMP)
-
 #define FEBRUARY		2
 #define	STARTOFTIME		1970
 #define SECDAY			86400L
@@ -97,9 +95,6 @@ unsigned long rtc_mktime(const struct rtc_time *tm)
 	return (hours * 60 + tm->tm_min) * 60 + tm->tm_sec;
 }

-#endif /* CONFIG_LIB_DATE || CONFIG_TIMESTAMP */
-
-#ifdef CONFIG_LIB_DATE
 /* for compatibility with linux code */
 time64_t mktime64(const unsigned int year, const unsigned int mon,
 		  const unsigned int day, const unsigned int hour,
@@ -116,4 +111,3 @@ time64_t mktime64(const unsigned int year, const unsigned int mon,

 	return (time64_t)rtc_mktime((const struct rtc_time *)&time);
 }
-#endif
--
2.30.2


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-06-14 16:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-14 16:47 [PATCH] lib: remove superfluous #ifdefs from date.c Heinrich Schuchardt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).