![]() | |||||||||||
Messages in this thread Complete thread (EXPERIMENTAL)Patch in this message |
On Tue, 1 Apr 2008 10:59:50 +0200 Rodolfo Giometti <giometti@enneenne.com> wrote:
On Fri, Mar 28, 2008 at 03:21:39AM -0700, Andrew Morton wrote:
On Thu, 6 Mar 2008 13:09:00 +0100 Rodolfo Giometti <giometti@linux.it> wrote:
This patch adds the kernel side of the PPS support currently named
"LinuxPPS".
powerpc: drivers/pps/pps.c: In function 'pps_cdev_ioctl': drivers/pps/pps.c:166: warning: format '%lld' expects type 'long long int', but argument 2 has type '__s64' drivers/pps/kapi.c: In function 'pps_event': drivers/pps/kapi.c:225: warning: format '%llu' expects type 'long long unsigned int', but argument 3 has type '__s64' drivers/pps/sysfs.c: In function 'pps_show_assert': drivers/pps/sysfs.c:42: warning: format '%lld' expects type 'long long int', but argument 3 has type '__s64' drivers/pps/sysfs.c:42: warning: format '%lld' expects type 'long long int', but argument 3 has type '__s64' drivers/pps/sysfs.c: In function 'pps_show_clear': drivers/pps/sysfs.c:56: warning: format '%lld' expects type 'long long int', but argument 3 has type '__s64' drivers/pps/sysfs.c:56: warning: format '%lld' expects type 'long long int', but argument 3 has type '__s64' Oops! I have no powerpc system... how can I solve this issue? Use %lld (if these things can legitimately be negative - otherwise %llu) and cast the argument to (long long) or (unsigned long long). Ok, here my modifications: [view this diff only] diff --git a/drivers/pps/kapi.c b/drivers/pps/kapi.c
index 34b3b22..d75c8c8 100644
--- a/drivers/pps/kapi.c
+++ b/drivers/pps/kapi.c
@@ -245,7 +245,7 @@ void pps_event(int source, int event, void *data)
return;
pr_debug("PPS event on source %d at %llu.%06u\n",
- pps->id, ts.sec, ts.nsec);
+ pps->id, (unsigned long long) ts.sec, ts.nsec);
spin_lock_irqsave(&pps->lock, flags);
diff --git a/drivers/pps/pps.c b/drivers/pps/pps.c
index a82b1d8..5cbfeb9 100644
--- a/drivers/pps/pps.c
+++ b/drivers/pps/pps.c
@@ -164,7 +164,8 @@ static int pps_cdev_ioctl(struct inode *inode, struct file *
err = wait_event_interruptible(pps->queue, pps->go);
else {
pr_debug("timeout %lld.%09d\n",
- fdata.timeout.sec, fdata.timeout.nsec);
+ (long long) fdata.timeout.sec,
+ fdata.timeout.nsec);
ticks = fdata.timeout.sec * HZ;
ticks += fdata.timeout.nsec / (NSEC_PER_SEC / HZ);
diff --git a/drivers/pps/sysfs.c b/drivers/pps/sysfs.c
index 3af773a..0520f62 100644
--- a/drivers/pps/sysfs.c
+++ b/drivers/pps/sysfs.c
@@ -38,7 +38,7 @@ static ssize_t pps_show_assert(struct device *dev,
return 0;
return sprintf(buf, "%lld.%09d#%d\n",
- pps->assert_tu.sec, pps->assert_tu.nsec,
+ (long long) pps->assert_tu.sec, pps->assert_tu.nsec,
pps->assert_sequence);
}
DEVICE_ATTR(assert, S_IRUGO, pps_show_assert, NULL);
@@ -52,7 +52,7 @@ static ssize_t pps_show_clear(struct device *dev,
return 0;
return sprintf(buf, "%lld.%09d#%d\n",
- pps->clear_tu.sec, pps->clear_tu.nsec,
+ (long long) pps->clear_tu.sec, pps->clear_tu.nsec,
pps->clear_sequence);
}
DEVICE_ATTR(clear, S_IRUGO, pps_show_clear, NULL);
This compile clearly on x86. I'm going to propose a new patch ASAP.
Thanks, Rodolfo -- GNU/Linux Solutions e-mail: giometti@enneenne.com Linux Device Driver giometti@gnudd.com Embedded Systems giometti@linux.it UNIX programming phone: +39 349 2432127 | ||||||||||
![]() | |||||||||||
| Last update: 2008-04-01 11:43 [W:0.227 / U:0.420 seconds] ©2003-2005 Jasper Spaans | |||||||||||