Re: [PATCH 2/3 RESEND] ptrace: cleanup address space conversion on ptrace_request()

Arnd Bergmann
2010-08-24T11:45:14Z

On Monday 23 August 2010, Namhyung Kim wrote:
> But removing __force results in following sparse warning:
>
> ptrace.c:567:40: warning: cast adds address space to expression
> (<asn:1>)

The problem is that ptrace takes a 'long' argument, not 'unsigned long'.
Sparse complains about adding address spaces in all casts except those
from/to unsigned long, which we often use as an opaque token that can
fit anything.

I don't think we ever rely on 'data' being signed, and user space
sees it as 'void *' anyway, so it should be possible to just turn
it into 'unsigned long'.

Arnd