All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/6] Werror: Fix casting wrong size integer to pointer
@ 2008-05-29 18:17 David Howells
  2008-05-29 18:17 ` [PATCH 2/6] Werror: Hide epca_setup() as it's unused David Howells
                   ` (6 more replies)
  0 siblings, 7 replies; 20+ messages in thread
From: David Howells @ 2008-05-29 18:17 UTC (permalink / raw)
  To: torvalds, akpm; +Cc: dhowells, bunk, linux-kernel

Fix casting wrong size integer to pointer.  Smaller integers must be cast to
unsigned long then cast to a pointer.

Signed-off-by: David Howells <dhowells@redhat.com>
---

 drivers/char/drm/sis_mm.c        |    2 +-
 drivers/message/i2o/i2o_config.c |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)


diff --git a/drivers/char/drm/sis_mm.c b/drivers/char/drm/sis_mm.c
index b387877..378b275 100644
--- a/drivers/char/drm/sis_mm.c
+++ b/drivers/char/drm/sis_mm.c
@@ -57,7 +57,7 @@ static void *sis_sman_mm_allocate(void *private, unsigned long size,
 	if (req.size == 0)
 		return NULL;
 	else
-		return (void *)~req.offset;
+		return (void *)(unsigned long)~req.offset;
 }
 
 static void sis_sman_mm_free(void *private, void *ref)
diff --git a/drivers/message/i2o/i2o_config.c b/drivers/message/i2o/i2o_config.c
index c0fb77d..a1c83af 100644
--- a/drivers/message/i2o/i2o_config.c
+++ b/drivers/message/i2o/i2o_config.c
@@ -886,7 +886,7 @@ static int i2o_cfg_passthru(unsigned long arg)
 			    flag_count & 0x04000000 /*I2O_SGL_FLAGS_DIR */ ) {
 				// TODO 64bit fix
 				if (copy_from_user
-				    (p, (void __user *)sg[i].addr_bus,
+				    (p, (void __user *)(unsigned long)sg[i].addr_bus,
 				     sg_size)) {
 					printk(KERN_DEBUG
 					       "%s: Could not copy SG buf %d FROM user\n",
@@ -942,7 +942,7 @@ static int i2o_cfg_passthru(unsigned long arg)
 				sg_size = sg[j].flag_count & 0xffffff;
 				// TODO 64bit fix
 				if (copy_to_user
-				    ((void __user *)sg[j].addr_bus, sg_list[j],
+				    ((void __user *)(unsigned long)sg[j].addr_bus, sg_list[j],
 				     sg_size)) {
 					printk(KERN_WARNING
 					       "%s: Could not copy %p TO user %x\n",


^ permalink raw reply related	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2008-05-29 20:10 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-29 18:17 [PATCH 1/6] Werror: Fix casting wrong size integer to pointer David Howells
2008-05-29 18:17 ` [PATCH 2/6] Werror: Hide epca_setup() as it's unused David Howells
2008-05-29 18:35   ` Alan Cox
2008-05-29 18:17 ` [PATCH 3/6] Werror: Remove iiEllisCleanup() " David Howells
2008-05-29 18:28   ` Adrian Bunk
2008-05-29 19:07     ` David Howells
2008-05-29 18:35   ` Alan Cox
2008-05-29 18:17 ` [PATCH 4/6] Werror: Hide warnings on static module device tables David Howells
2008-05-29 19:24   ` Adrian Bunk
2008-05-29 19:41     ` David Howells
2008-05-29 19:50       ` Adrian Bunk
2008-05-29 18:17 ` [PATCH 5/6] Werror: Remove the packed attribute from PofTimStamp_tag in the hysdn driver David Howells
2008-05-29 19:24   ` Andrew Morton
2008-05-29 18:17 ` [PATCH 6/6] Werror: Provide a configuration option to enable -Werror David Howells
2008-05-29 18:30   ` Linus Torvalds
2008-05-29 18:29 ` [PATCH 1/6] Werror: Fix casting wrong size integer to pointer Linus Torvalds
2008-05-29 18:48   ` David Howells
2008-05-29 19:19 ` Andrew Morton
2008-05-29 19:25   ` David Howells
2008-05-29 20:08     ` Andrew Morton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.