From 6405d78182ed413762cf0b9060ac5fa0aa744262 Mon Sep 17 00:00:00 2001 From: Thomas Cort Date: Sat, 10 Aug 2013 18:30:42 +0000 Subject: [PATCH] readclock/tda19988: fix compiler/cppcheck warnings readclock: - the setup function for readclock on i386 was missing a return. - the message field for RTCDEV_GRANT wasn't the right type. tda19988: - position variable was used without being initialized. Change-Id: I3f78dd0a9d44f35eb38cb7da0974909f066b7007 --- drivers/readclock/arch/i386/arch_readclock.c | 2 ++ drivers/tda19988/tda19988.c | 3 +-- include/minix/com.h | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/readclock/arch/i386/arch_readclock.c b/drivers/readclock/arch/i386/arch_readclock.c index 68071e783..9d6b5bd64 100644 --- a/drivers/readclock/arch/i386/arch_readclock.c +++ b/drivers/readclock/arch/i386/arch_readclock.c @@ -94,6 +94,8 @@ arch_setup(struct rtc *r) r->set_time = arch_set_time; r->pwr_off = arch_pwr_off; r->exit = arch_exit; + + return OK; } static int diff --git a/drivers/tda19988/tda19988.c b/drivers/tda19988/tda19988.c index 0d19422de..0913936fd 100644 --- a/drivers/tda19988/tda19988.c +++ b/drivers/tda19988/tda19988.c @@ -232,7 +232,6 @@ tda19988_blk_transfer(dev_t minor, int do_write, u64_t pos64, struct device *dv; u64_t dv_size; int r; - u64_t position; cp_grant_id_t grant; log_trace(&log, "tda19988_blk_transfer()\n"); @@ -265,7 +264,7 @@ tda19988_blk_transfer(dev_t minor, int do_write, u64_t pos64, /* don't go past the end of the device */ if (pos64 + count > dv_size) { - count = dv_size - position; + count = dv_size - pos64; } /* don't overflow copybuf */ diff --git a/include/minix/com.h b/include/minix/com.h index e8320e02d..f35d0e108 100644 --- a/include/minix/com.h +++ b/include/minix/com.h @@ -1333,7 +1333,7 @@ #define RTCDEV_TM m2_p1 /* pointer to struct tm */ #define RTCDEV_FLAGS m2_s1 /* clock flags flags */ #define RTCDEV_STATUS m2_i2 /* OK or error code */ -#define RTCDEV_GRANT m2_p1 /* grant containing struct tm */ +#define RTCDEV_GRANT m2_i3 /* grant containing struct tm */ /* Bits in 'RTCDEV_FLAGS' field of real time clock requests. */ #define RTCDEV_NOFLAGS 0x00 /* no flags are set */