* [PATCH] staging: ced1401: fix sparse warning for ced1401
@ 2014-06-14 5:04 Seunghun Lee
2014-06-14 14:35 ` Greg KH
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Seunghun Lee @ 2014-06-14 5:04 UTC (permalink / raw)
To: gregkh; +Cc: alois.schloegl, devel, linux-kernel, Seunghun Lee
This patch fixes below warning.
drivers/staging/ced1401/ced_ioc.c:703:30: warning: incorrect type in assignment (different address spaces)
drivers/staging/ced1401/ced_ioc.c:703:30: expected void *[usertype] lpvBuff
drivers/staging/ced1401/ced_ioc.c:703:30: got char [noderef] <asn:1>*puBuf
Signed-off-by: Seunghun Lee <waydi1@gmail.com>
---
drivers/staging/ced1401/ced_ioc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/ced1401/ced_ioc.c b/drivers/staging/ced1401/ced_ioc.c
index ebbc509..963b941 100644
--- a/drivers/staging/ced1401/ced_ioc.c
+++ b/drivers/staging/ced1401/ced_ioc.c
@@ -700,7 +700,7 @@ static int SetArea(DEVICE_EXTENSION *pdx, int nArea, char __user *puBuf,
/* kmap() or kmap_atomic() to get a virtual address. page_address will give you */
/* (null) or at least it does in this context with an x86 machine. */
spin_lock_irq(&pdx->stagedLock);
- pTA->lpvBuff = puBuf; /* keep start of region (user address) */
+ pTA->lpvBuff = (__force void *)puBuf; /* keep start of region (user address) */
pTA->dwBaseOffset = ulOffset; /* save offset in first page to start of xfer */
pTA->dwLength = dwLength; /* Size if the region in bytes */
pTA->pPages = pPages; /* list of pages that are used by buffer */
--
1.7.9.5
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] staging: ced1401: fix sparse warning for ced1401
2014-06-14 5:04 [PATCH] staging: ced1401: fix sparse warning for ced1401 Seunghun Lee
@ 2014-06-14 14:35 ` Greg KH
2014-06-16 8:17 ` Dan Carpenter
2014-06-19 5:14 ` Greg KH
2 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2014-06-14 14:35 UTC (permalink / raw)
To: Seunghun Lee; +Cc: devel, alois.schloegl, linux-kernel
On Sat, Jun 14, 2014 at 02:04:38PM +0900, Seunghun Lee wrote:
> This patch fixes below warning.
>
> drivers/staging/ced1401/ced_ioc.c:703:30: warning: incorrect type in assignment (different address spaces)
> drivers/staging/ced1401/ced_ioc.c:703:30: expected void *[usertype] lpvBuff
> drivers/staging/ced1401/ced_ioc.c:703:30: got char [noderef] <asn:1>*puBuf
>
> Signed-off-by: Seunghun Lee <waydi1@gmail.com>
> ---
> drivers/staging/ced1401/ced_ioc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/ced1401/ced_ioc.c b/drivers/staging/ced1401/ced_ioc.c
> index ebbc509..963b941 100644
> --- a/drivers/staging/ced1401/ced_ioc.c
> +++ b/drivers/staging/ced1401/ced_ioc.c
> @@ -700,7 +700,7 @@ static int SetArea(DEVICE_EXTENSION *pdx, int nArea, char __user *puBuf,
> /* kmap() or kmap_atomic() to get a virtual address. page_address will give you */
> /* (null) or at least it does in this context with an x86 machine. */
> spin_lock_irq(&pdx->stagedLock);
> - pTA->lpvBuff = puBuf; /* keep start of region (user address) */
> + pTA->lpvBuff = (__force void *)puBuf; /* keep start of region (user address) */
It's usually not good to use __force unless you have to. Can't you fix
the type of the variable instead?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] staging: ced1401: fix sparse warning for ced1401
2014-06-14 5:04 [PATCH] staging: ced1401: fix sparse warning for ced1401 Seunghun Lee
2014-06-14 14:35 ` Greg KH
@ 2014-06-16 8:17 ` Dan Carpenter
2014-06-19 5:14 ` Greg KH
2 siblings, 0 replies; 5+ messages in thread
From: Dan Carpenter @ 2014-06-16 8:17 UTC (permalink / raw)
To: Seunghun Lee; +Cc: gregkh, devel, alois.schloegl, linux-kernel
On Sat, Jun 14, 2014 at 02:04:38PM +0900, Seunghun Lee wrote:
> This patch fixes below warning.
>
> drivers/staging/ced1401/ced_ioc.c:703:30: warning: incorrect type in assignment (different address spaces)
> drivers/staging/ced1401/ced_ioc.c:703:30: expected void *[usertype] lpvBuff
> drivers/staging/ced1401/ced_ioc.c:703:30: got char [noderef] <asn:1>*puBuf
>
> Signed-off-by: Seunghun Lee <waydi1@gmail.com>
No. This silences the warning by disabling Sparse.
Fix the annotations instead.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] staging: ced1401: fix sparse warning for ced1401
2014-06-14 5:04 [PATCH] staging: ced1401: fix sparse warning for ced1401 Seunghun Lee
2014-06-14 14:35 ` Greg KH
2014-06-16 8:17 ` Dan Carpenter
@ 2014-06-19 5:14 ` Greg KH
2 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2014-06-19 5:14 UTC (permalink / raw)
To: Seunghun Lee; +Cc: devel, alois.schloegl, linux-kernel
On Sat, Jun 14, 2014 at 02:04:38PM +0900, Seunghun Lee wrote:
> This patch fixes below warning.
>
> drivers/staging/ced1401/ced_ioc.c:703:30: warning: incorrect type in assignment (different address spaces)
> drivers/staging/ced1401/ced_ioc.c:703:30: expected void *[usertype] lpvBuff
> drivers/staging/ced1401/ced_ioc.c:703:30: got char [noderef] <asn:1>*puBuf
>
> Signed-off-by: Seunghun Lee <waydi1@gmail.com>
> ---
> drivers/staging/ced1401/ced_ioc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/ced1401/ced_ioc.c b/drivers/staging/ced1401/ced_ioc.c
> index ebbc509..963b941 100644
> --- a/drivers/staging/ced1401/ced_ioc.c
> +++ b/drivers/staging/ced1401/ced_ioc.c
> @@ -700,7 +700,7 @@ static int SetArea(DEVICE_EXTENSION *pdx, int nArea, char __user *puBuf,
> /* kmap() or kmap_atomic() to get a virtual address. page_address will give you */
> /* (null) or at least it does in this context with an x86 machine. */
> spin_lock_irq(&pdx->stagedLock);
> - pTA->lpvBuff = puBuf; /* keep start of region (user address) */
> + pTA->lpvBuff = (__force void *)puBuf; /* keep start of region (user address) */
Shouldn't you change the type of lpvBuff instead of having to force this
cast?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] staging: ced1401: fix sparse warning for ced1401
@ 2014-06-22 14:38 Seunghun Lee
0 siblings, 0 replies; 5+ messages in thread
From: Seunghun Lee @ 2014-06-22 14:38 UTC (permalink / raw)
To: gregkh; +Cc: alois.schloegl, devel, linux-kernel, Seunghun Lee
This patch fixes below warning.
drivers/staging/ced1401/ced_ioc.c:703:30: warning: incorrect type in assignment (different address spaces)
drivers/staging/ced1401/ced_ioc.c:703:30: expected void *[usertype] lpvBuff
drivers/staging/ced1401/ced_ioc.c:703:30: got char [noderef] <asn:1>*puBuf
Signed-off-by: Seunghun Lee <waydi1@gmail.com>
---
drivers/staging/ced1401/usb1401.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/ced1401/usb1401.h b/drivers/staging/ced1401/usb1401.h
index ea0fe63..8327e9c 100644
--- a/drivers/staging/ced1401/usb1401.h
+++ b/drivers/staging/ced1401/usb1401.h
@@ -101,7 +101,7 @@ typedef struct circBlk {
/* A structure holding all of the information about a transfer area - an area of */
/* memory set up for use either as a source or destination in DMA transfers. */
typedef struct transarea {
- void *lpvBuff; /* User address of xfer area saved for completeness */
+ void __user *lpvBuff; /* User address of xfer area saved for completeness */
UINT dwBaseOffset; /* offset to start of xfer area in first page */
UINT dwLength; /* Length of xfer area, in bytes */
struct page **pPages; /* Points at array of locked down pages */
--
1.7.9.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-06-22 14:38 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-14 5:04 [PATCH] staging: ced1401: fix sparse warning for ced1401 Seunghun Lee
2014-06-14 14:35 ` Greg KH
2014-06-16 8:17 ` Dan Carpenter
2014-06-19 5:14 ` Greg KH
-- strict thread matches above, loose matches on Subject: below --
2014-06-22 14:38 Seunghun Lee
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox