[PATCH] hwclock: define cmos_interface only if necessary

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Carlos Santos <unixmania@xxxxxxxxx>

Move the static declaration to the probe_for_cmos_clock() function and
make it conditional to i386/x86_64, preventing a "defined but not used"
compiler warning.

Signed-off-by: Carlos Santos <unixmania@xxxxxxxxx>
---
 sys-utils/hwclock-cmos.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/sys-utils/hwclock-cmos.c b/sys-utils/hwclock-cmos.c
index a11f676b8..ada4a9c43 100644
--- a/sys-utils/hwclock-cmos.c
+++ b/sys-utils/hwclock-cmos.c
@@ -398,21 +398,21 @@ static const char *get_device_path(void)
 	return NULL;
 }
 
-static struct clock_ops cmos_interface = {
-	N_("Using direct ISA access to the clock"),
-	get_permissions_cmos,
-	read_hardware_clock_cmos,
-	set_hardware_clock_cmos,
-	synchronize_to_clock_tick_cmos,
-	get_device_path,
-};
-
 /*
  * return &cmos if cmos clock present, NULL otherwise.
  */
 struct clock_ops *probe_for_cmos_clock(void)
 {
 #if defined(__i386__) || defined(__x86_64__)
+	static struct clock_ops cmos_interface = {
+		N_("Using direct ISA access to the clock"),
+		get_permissions_cmos,
+		read_hardware_clock_cmos,
+		set_hardware_clock_cmos,
+		synchronize_to_clock_tick_cmos,
+		get_device_path,
+	};
+
 	return &cmos_interface;
 #else
 	return NULL;
-- 
2.18.1




[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux