* [PATCH -next] staging: lustre: Use proper constant types for L*_POISON values
@ 2013-08-23 15:46 Geert Uytterhoeven
2013-08-23 17:21 ` Greg Kroah-Hartman
0 siblings, 1 reply; 2+ messages in thread
From: Geert Uytterhoeven @ 2013-08-23 15:46 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: devel, linux-kernel, linux-next, Geert Uytterhoeven
On 32-bit m68k, I get lots of warnings like:
warning: integer constant is too large for ‘long’ type
Switch the L*_POISON definitions from too-large constants and casts
to the proper constant types to fix this.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
The values in drivers/staging/lustre/lustre/include/linux/lustre_lib.h
don't seem to be used, as LP_POISON is already defined at that point?
.../lustre/include/linux/libcfs/linux/kp30.h | 10 +++++++---
.../lustre/lustre/include/linux/lustre_lib.h | 10 ++++------
2 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/drivers/staging/lustre/include/linux/libcfs/linux/kp30.h b/drivers/staging/lustre/include/linux/libcfs/linux/kp30.h
index 073f4d1..c204b67 100644
--- a/drivers/staging/lustre/include/linux/libcfs/linux/kp30.h
+++ b/drivers/staging/lustre/include/linux/libcfs/linux/kp30.h
@@ -187,9 +187,13 @@ extern int lwt_snapshot (cfs_cycles_t *now, int *ncpu, int *total_size,
# endif
#endif
-# define LI_POISON ((int)0x5a5a5a5a5a5a5a5a)
-# define LL_POISON ((long)0x5a5a5a5a5a5a5a5a)
-# define LP_POISON ((void *)(long)0x5a5a5a5a5a5a5a5a)
+# define LI_POISON 0x5a5a5a5a
+#if BITS_PER_LONG > 32
+# define LL_POISON 0x5a5a5a5a5a5a5a5aL
+#else
+# define LL_POISON 0x5a5a5a5aL
+#endif
+# define LP_POISON ((void *)LL_POISON)
/* this is a bit chunky */
diff --git a/drivers/staging/lustre/lustre/include/linux/lustre_lib.h b/drivers/staging/lustre/lustre/include/linux/lustre_lib.h
index b2f755a..57f3b01 100644
--- a/drivers/staging/lustre/lustre/include/linux/lustre_lib.h
+++ b/drivers/staging/lustre/lustre/include/linux/lustre_lib.h
@@ -53,15 +53,13 @@
# include <linux/lustre_common.h>
#ifndef LP_POISON
+# define LI_POISON 0x5a5a5a5a
#if BITS_PER_LONG > 32
-# define LI_POISON ((int)0x5a5a5a5a5a5a5a5a)
-# define LL_POISON ((long)0x5a5a5a5a5a5a5a5a)
-# define LP_POISON ((void *)(long)0x5a5a5a5a5a5a5a5a)
+# define LL_POISON 0x5a5a5a5a5a5a5a5aL
#else
-# define LI_POISON ((int)0x5a5a5a5a)
-# define LL_POISON ((long)0x5a5a5a5a)
-# define LP_POISON ((void *)(long)0x5a5a5a5a)
+# define LL_POISON 0x5a5a5a5aL
#endif
+# define LP_POISON ((void *)LL_POISON)
#endif
/* This macro is only for compatibility reasons with older Linux Lustre user
--
1.7.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH -next] staging: lustre: Use proper constant types for L*_POISON values
2013-08-23 15:46 [PATCH -next] staging: lustre: Use proper constant types for L*_POISON values Geert Uytterhoeven
@ 2013-08-23 17:21 ` Greg Kroah-Hartman
0 siblings, 0 replies; 2+ messages in thread
From: Greg Kroah-Hartman @ 2013-08-23 17:21 UTC (permalink / raw)
To: Geert Uytterhoeven; +Cc: devel, linux-next, linux-kernel
On Fri, Aug 23, 2013 at 05:46:48PM +0200, Geert Uytterhoeven wrote:
> On 32-bit m68k, I get lots of warnings like:
>
> warning: integer constant is too large for ‘long’ type
>
> Switch the L*_POISON definitions from too-large constants and casts
> to the proper constant types to fix this.
>
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> ---
> The values in drivers/staging/lustre/lustre/include/linux/lustre_lib.h
> don't seem to be used, as LP_POISON is already defined at that point?
Probably. I don't see where anyone even uses these "poison" values,
except to check variables to ensure they don't contain the value, which
is always going to be true as no one sets them.
Oh well, more dead code in the driver, nothing new...
thanks,
greg k-h
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-08-23 17:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-23 15:46 [PATCH -next] staging: lustre: Use proper constant types for L*_POISON values Geert Uytterhoeven
2013-08-23 17:21 ` Greg Kroah-Hartman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).