summaryrefslogtreecommitdiffstats
path: root/hwclock
diff options
context:
space:
mode:
authorSami Kerola2011-07-25 21:33:39 +0200
committerSami Kerola2011-07-26 18:14:19 +0200
commit390c72eb23c49e0fc3e3ccec0ebcb99b6b86d676 (patch)
tree9e2eb138dfb893f992e730bcffbb852e5e70b83f /hwclock
parenthwclock: move path definitions to pathnames.h (diff)
downloadkernel-qcow2-util-linux-390c72eb23c49e0fc3e3ccec0ebcb99b6b86d676.tar.gz
kernel-qcow2-util-linux-390c72eb23c49e0fc3e3ccec0ebcb99b6b86d676.tar.xz
kernel-qcow2-util-linux-390c72eb23c49e0fc3e3ccec0ebcb99b6b86d676.zip
hwclock: fix compiler warnings
hwclock.c: In function 'manipulate_epoch': hwclock.c:1299:29: warning: unused parameter 'getepoch' [-Wunused-parameter] hwclock.c:1299:50: warning: unused parameter 'setepoch' [-Wunused-parameter] hwclock.c:1300:14: warning: unused parameter 'epoch_opt' [-Wunused-parameter] hwclock.c:1300:36: warning: unused parameter 'testing' [-Wunused-parameter] hwclock.c: In function 'usage': hwclock.c:1373:1: warning: embedding a directive within macro arguments is not portable [enabled by default] hwclock.c:1377:1: warning: embedding a directive within macro arguments is not portable [enabled by default] hwclock.c:1383:1: warning: embedding a directive within macro arguments is not portable [enabled by default] hwclock.c:1385:1: warning: embedding a directive within macro arguments is not portable [enabled by default] cmos.c: In function 'outb': cmos.c:84:15: warning: unused parameter 'a' [-Wunused-parameter] cmos.c:84:22: warning: unused parameter 'b' [-Wunused-parameter] cmos.c: In function 'inb': cmos.c:88:13: warning: unused parameter 'c' [-Wunused-parameter] cmos.c: In function 'atomic': cmos.c:265:20: warning: unused parameter 'name' [-Wunused-parameter] cmos.c: In function 'i386_iopl': cmos.c:544:32: warning: unused parameter 'level' [-Wunused-parameter] cmos.c: In function 'get_permissions_cmos': cmos.c:565:8: warning: unused variable 'errsv' [-Wunused-variable] Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'hwclock')
-rw-r--r--hwclock/cmos.c31
-rw-r--r--hwclock/hwclock.c61
2 files changed, 57 insertions, 35 deletions
diff --git a/hwclock/cmos.c b/hwclock/cmos.c
index 89bcc50f9..09b1555dd 100644
--- a/hwclock/cmos.c
+++ b/hwclock/cmos.c
@@ -66,11 +66,12 @@
* not export that header.
*/
#undef __i386__
-void outb(int a, int b)
+void outb(int a __attribute__ ((__unused__)),
+ int b __attribute__ ((__unused__)))
{
}
-int inb(int c)
+int inb(int c __attribute__ ((__unused__)))
{
return 0;
}
@@ -81,11 +82,12 @@ int inb(int c)
extern unsigned int inb(unsigned long port);
extern void outb(unsigned char b, unsigned long port);
#else
-void outb(int a, int b)
+void outb(int a __attribute__ ((__unused__)),
+ int b __attribute__ ((__unused__)))
{
}
-int inb(int c)
+int inb(int c __attribute__ ((__unused__)))
{
return 0;
}
@@ -298,7 +300,9 @@ atomic(const char *name, unsigned long (*op) (unsigned long), unsigned long arg)
* TODO: optimize the access to CMOS by mlockall(MCL_CURRENT) and SCHED_FIFO
*/
static unsigned long
-atomic(const char *name, unsigned long (*op) (unsigned long), unsigned long arg)
+atomic(const char *name __attribute__ ((__unused__)),
+ unsigned long (*op) (unsigned long),
+ unsigned long arg)
{
return (*op) (arg);
}
@@ -603,20 +607,26 @@ static int set_hardware_clock_cmos(const struct tm *new_broken_time)
return 0;
}
+#if defined(__i386__) || defined(__alpha__)
+# if defined(HAVE_IOPL)
static int i386_iopl(const int level)
{
-#if defined(__i386__) || defined(__alpha__)
-#if defined(HAVE_IOPL)
extern int iopl(const int lvl);
return iopl(level);
-#else
+}
+# else
+static int i386_iopl(const int level __attribute__ ((__unused__)))
+{
extern int ioperm(unsigned long from, unsigned long num, int turn_on);
return ioperm(clock_ctl_addr, 2, 1);
-#endif
+}
+# endif
#else
+static int i386_iopl(const int level __attribute__ ((__unused__)))
+{
return -2;
-#endif
}
+#endif
static int get_permissions_cmos(void)
{
@@ -624,7 +634,6 @@ static int get_permissions_cmos(void)
if (use_dev_port) {
if ((dev_port_fd = open("/dev/port", O_RDWR)) < 0) {
- int errsv = errno;
warn(_("Cannot open /dev/port"));
rc = 1;
} else
diff --git a/hwclock/hwclock.c b/hwclock/hwclock.c
index c1ab072cd..30ee856bd 100644
--- a/hwclock/hwclock.c
+++ b/hwclock/hwclock.c
@@ -1273,22 +1273,30 @@ manipulate_clock(const bool show, const bool adjust, const bool noadjfile,
* <epoch> == -1 if the user did not specify an "epoch" option.
*/
#ifdef __linux__
+/*
+ * Maintenance note: This should work on non-Alpha machines, but the
+ * evidence today (98.03.04) indicates that the kernel only keeps the epoch
+ * value on Alphas. If that is ever fixed, this function should be changed.
+ */
+# ifndef __alpha__
static void
-manipulate_epoch(const bool getepoch, const bool setepoch,
- const int epoch_opt, const bool testing)
+manipulate_epoch(const bool getepoch __attribute__ ((__unused__)),
+ const bool setepoch __attribute__ ((__unused__)),
+ const int epoch_opt __attribute__ ((__unused__)),
+ const bool testing __attribute__ ((__unused__)))
{
- /*
- * Maintenance note: This should work on non-Alpha machines, but the
- * evidence today (98.03.04) indicates that the kernel only keeps
- * the epoch value on Alphas. If that is ever fixed, this function
- * should be changed.
- */
-#ifndef __alpha__
warnx(_("The kernel keeps an epoch value for the Hardware Clock "
"only on an Alpha machine.\nThis copy of hwclock was built for "
"a machine other than Alpha\n(and thus is presumably not running "
"on an Alpha now). No action taken."));
-#else
+}
+# else
+static void
+manipulate_epoch(const bool getepoch,
+ const bool setepoch,
+ const int epoch_opt,
+ const bool testing)
+{
if (getepoch) {
unsigned long epoch;
@@ -1311,9 +1319,9 @@ manipulate_epoch(const bool getepoch, const bool setepoch,
printf(_
("Unable to set the epoch value in the kernel.\n"));
}
-#endif
}
-#endif
+# endif /* __alpha__ */
+#endif /* __linux__ */
static void out_version(void)
{
@@ -1347,21 +1355,25 @@ static void usage(const char *fmt, ...)
" -w | --systohc set the hardware clock to the current system time\n"
" --systz set the system time based on the current timezone\n"
" --adjust adjust the rtc to account for systematic drift since\n"
- " the clock was last set or adjusted\n"
+ " the clock was last set or adjusted\n"));
#ifdef __linux__
- " --getepoch print out the kernel's hardware clock epoch value\n"
+ fprintf(usageto,
+ _(" --getepoch print out the kernel's hardware clock epoch value\n"
" --setepoch set the kernel's hardware clock epoch value to the \n"
- " value given with --epoch\n"
+ " value given with --epoch\n"));
#endif
- " --predict predict rtc reading at time given with --date\n"
+ fprintf(usageto,
+ _(" --predict predict rtc reading at time given with --date\n"
" -v | --version print out the version of hwclock to stdout\n"
"\nOptions: \n"
" -u | --utc the hardware clock is kept in UTC\n"
- " --localtime the hardware clock is kept in local time\n"
+ " --localtime the hardware clock is kept in local time\n"));
#ifdef __linux__
- " -f | --rtc=path special /dev/... file to use instead of default\n"
+ fprintf(usageto,
+ _(" -f | --rtc=path special /dev/... file to use instead of default\n"));
#endif
- " --directisa access the ISA bus directly instead of %s\n"
+ fprintf(usageto,
+ _(" --directisa access the ISA bus directly instead of %s\n"
" --badyear ignore rtc's year because the bios is broken\n"
" --date specifies the time to which to set the hardware clock\n"
" --epoch=year specifies the year which is the beginning of the \n"
@@ -1372,12 +1384,13 @@ static void usage(const char *fmt, ...)
" %s)\n"
" --test do everything except actually updating the hardware\n"
" clock or anything else\n"
- " -D | --debug debug mode\n" "\n"),
- _PATH_RTC_DEV, _PATH_ADJPATH, _PATH_ADJPATH);
+ " -D | --debug debug mode\n" "\n"), _PATH_RTC_DEV,
+ _PATH_ADJPATH, _PATH_ADJPATH);
#ifdef __alpha__
- fprintf(usageto, _(" -J|--jensen, -A|--arc, -S|--srm, -F|--funky-toy\n"
- " tell hwclock the type of alpha you have (see hwclock(8))\n"
- "\n"));
+ fprintf(usageto,
+ _(" -J|--jensen, -A|--arc, -S|--srm, -F|--funky-toy\n"
+ " tell hwclock the type of alpha you have (see hwclock(8))\n"
+ "\n"));
#endif
fflush(usageto);