summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/arm
diff options
context:
space:
mode:
authorRon <ron@debian.org>2009-06-27 04:44:27 +0930
committerMike Frysinger <vapier@gentoo.org>2009-07-05 20:27:17 -0400
commit8ee834680d39677a60e26a0de4ece2f0c1ebbde2 (patch)
treed6e76722bc716e70917af4d3d540164fdf60948e /libc/sysdeps/linux/arm
parent4a758b0f333fc886b2b4ce715cab22027adb03a6 (diff)
Avoid warnings about shifting more bits than we have
The test here is a constant expression and will compile out. For platforms that don't need the shift the code gets slightly smaller and simpler, for those that do the result is unchanged. Signed-off-by: Ron Lee <ron@debian.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'libc/sysdeps/linux/arm')
-rw-r--r--libc/sysdeps/linux/arm/posix_fadvise.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libc/sysdeps/linux/arm/posix_fadvise.c b/libc/sysdeps/linux/arm/posix_fadvise.c
index b23eb3d6b..278bff981 100644
--- a/libc/sysdeps/linux/arm/posix_fadvise.c
+++ b/libc/sysdeps/linux/arm/posix_fadvise.c
@@ -12,6 +12,8 @@
#if defined __NR_arm_fadvise64_64
+#define HIGH_BITS(x) (sizeof(x) > 4 ? (x) >> 32 : 0)
+
/* Was named __libc_posix_fadvise for some inexplicable reason.
** google says only uclibc has *__libc*_posix_fadviseXXX,
** so it cannot be compat with anything.
@@ -27,8 +29,8 @@ int posix_fadvise(int fd, off_t offset, off_t len, int advise)
{
INTERNAL_SYSCALL_DECL (err);
int ret = INTERNAL_SYSCALL (arm_fadvise64_64, err, 6, fd, advise,
- __LONG_LONG_PAIR ((long)(offset >> 32), (long)offset),
- __LONG_LONG_PAIR ((long)(len >> 32), (long)len));
+ __LONG_LONG_PAIR (HIGH_BITS(offset), (long)offset),
+ __LONG_LONG_PAIR (HIGH_BITS(len), (long)len));
if (INTERNAL_SYSCALL_ERROR_P (ret, err))
return INTERNAL_SYSCALL_ERRNO (ret, err);