public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] trivial fs/select.c compiler warning fix
@ 2006-04-08 11:28 Horst Schirmeier
  2006-04-08 11:46 ` Horst Schirmeier
  0 siblings, 1 reply; 2+ messages in thread
From: Horst Schirmeier @ 2006-04-08 11:28 UTC (permalink / raw)
  To: Alexander Viro; +Cc: linux-kernel, trivial

This trivial patch fixes
fs/select.c: In function `core_sys_select':
fs/select.c:339: warning: assignment from incompatible pointer type
fs/select.c:376: warning: comparison of distinct pointer types lacks a cast
by casting to (char *) when accessing stack_fds.

Signed-off-by: Horst Schirmeier <horst@schirmeier.com>

---

diff --git a/fs/select.c b/fs/select.c
index 071660f..3025cec 100644
--- a/fs/select.c
+++ b/fs/select.c
@@ -336,7 +336,7 @@ static int core_sys_select(int n, fd_set
 	ret = -ENOMEM;
 	size = FDS_BYTES(n);
 	if (6*size < SELECT_STACK_ALLOC)
-		bits = stack_fds;
+		bits = (char *) stack_fds;
 	else
 		bits = kmalloc(6 * size, GFP_KERNEL);
 	if (!bits)
@@ -373,7 +373,7 @@ static int core_sys_select(int n, fd_set
 		ret = -EFAULT;
 
 out:
-	if (bits != stack_fds)
+	if (bits != (char *) stack_fds)
 		kfree(bits);
 out_nofds:
 	return ret;

-- 
PGP-Key 0xD40E0E7A

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

* Re: [PATCH] trivial fs/select.c compiler warning fix
  2006-04-08 11:28 [PATCH] trivial fs/select.c compiler warning fix Horst Schirmeier
@ 2006-04-08 11:46 ` Horst Schirmeier
  0 siblings, 0 replies; 2+ messages in thread
From: Horst Schirmeier @ 2006-04-08 11:46 UTC (permalink / raw)
  To: Alexander Viro, linux-kernel, trivial

Whoops. Looks like Russell King already created a more elaborate patch
for this problem yesterday (20060407153715.GA31458@flint.arm.linux.org.uk).

On Sat, 08 Apr 2006, Horst Schirmeier wrote:
> This trivial patch fixes
> fs/select.c: In function `core_sys_select':
> fs/select.c:339: warning: assignment from incompatible pointer type
> fs/select.c:376: warning: comparison of distinct pointer types lacks a cast
> by casting to (char *) when accessing stack_fds.
> 
> Signed-off-by: Horst Schirmeier <horst@schirmeier.com>
> 
> ---
> 
> diff --git a/fs/select.c b/fs/select.c
> index 071660f..3025cec 100644
> --- a/fs/select.c
> +++ b/fs/select.c
> @@ -336,7 +336,7 @@ static int core_sys_select(int n, fd_set
>  	ret = -ENOMEM;
>  	size = FDS_BYTES(n);
>  	if (6*size < SELECT_STACK_ALLOC)
> -		bits = stack_fds;
> +		bits = (char *) stack_fds;
>  	else
>  		bits = kmalloc(6 * size, GFP_KERNEL);
>  	if (!bits)
> @@ -373,7 +373,7 @@ static int core_sys_select(int n, fd_set
>  		ret = -EFAULT;
>  
>  out:
> -	if (bits != stack_fds)
> +	if (bits != (char *) stack_fds)
>  		kfree(bits);
>  out_nofds:
>  	return ret;
> 

-- 
PGP-Key 0xD40E0E7A

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

end of thread, other threads:[~2006-04-08 11:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-08 11:28 [PATCH] trivial fs/select.c compiler warning fix Horst Schirmeier
2006-04-08 11:46 ` Horst Schirmeier

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