summaryrefslogtreecommitdiffstats
path: root/hwclock/cmos.c
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/cmos.c
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/cmos.c')
-rw-r--r--hwclock/cmos.c31
1 files changed, 20 insertions, 11 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