mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Fix warning in prefetch_range
@ 2004-04-24 23:51 Brian Gerst
  2004-04-26  5:08 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Brian Gerst @ 2004-04-24 23:51 UTC (permalink / raw)
  To: Andrew Morton; +Cc: lkml

[-- Attachment #1: Type: text/plain, Size: 177 bytes --]

Fix this warning:
include/linux/prefetch.h: In function `prefetch_range':
include/linux/prefetch.h:62: warning: pointer of type `void *' used in 
arithmetic

--
				Brian Gerst

[-- Attachment #2: prefetch-1 --]
[-- Type: text/plain, Size: 429 bytes --]

diff -urN linux-2.6.5-rc1-bk/include/linux/prefetch.h linux/include/linux/prefetch.h
--- linux-2.6.5-rc1-bk/include/linux/prefetch.h	2004-04-14 23:53:11.000000000 -0400
+++ linux/include/linux/prefetch.h	2004-04-16 11:12:25.840194048 -0400
@@ -59,7 +59,7 @@
 {
 #ifdef ARCH_HAS_PREFETCH
 	char *cp;
-	char *end = addr + len;
+	char *end = (char *)addr + len;
 
 	for (cp = addr; cp < end; cp += PREFETCH_STRIDE)
 		prefetch(cp);

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

* Re: [PATCH] Fix warning in prefetch_range
  2004-04-24 23:51 [PATCH] Fix warning in prefetch_range Brian Gerst
@ 2004-04-26  5:08 ` Andrew Morton
  2004-04-26 12:30   ` Brian Gerst
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2004-04-26  5:08 UTC (permalink / raw)
  To: Brian Gerst; +Cc: linux-kernel

Brian Gerst <bgerst@didntduck.org> wrote:
>
> Fix this warning:
> include/linux/prefetch.h: In function `prefetch_range':
> include/linux/prefetch.h:62: warning: pointer of type `void *' used in 
> arithmetic
> 

eh?  That's a gcc extension which has worked silently since forever.

What compiler version is generating the warning?

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

* Re: [PATCH] Fix warning in prefetch_range
  2004-04-26  5:08 ` Andrew Morton
@ 2004-04-26 12:30   ` Brian Gerst
  0 siblings, 0 replies; 3+ messages in thread
From: Brian Gerst @ 2004-04-26 12:30 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Brian Gerst, linux-kernel

Andrew Morton wrote:
> Brian Gerst <bgerst@didntduck.org> wrote:
> 
>>Fix this warning:
>>include/linux/prefetch.h: In function `prefetch_range':
>>include/linux/prefetch.h:62: warning: pointer of type `void *' used in 
>>arithmetic
>>
> 
> 
> eh?  That's a gcc extension which has worked silently since forever.
> 
> What compiler version is generating the warning?
> 

gcc (GCC) 3.3.3 20040412 (Red Hat Linux 3.3.3-7)

I saw the warning when compiling the nvidia driver, which uses 
-Wpointer-arith.  I'll drop that switch instead.

--
				Brian Gerst

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

end of thread, other threads:[~2004-04-26 12:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-24 23:51 [PATCH] Fix warning in prefetch_range Brian Gerst
2004-04-26  5:08 ` Andrew Morton
2004-04-26 12:30   ` Brian Gerst

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®