diff mbox

[repost,03/16] arm64/uaccess: fix sparse errors

Message ID 1419499661-8566-4-git-send-email-mst@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Michael S. Tsirkin Dec. 25, 2014, 9:28 a.m. UTC
virtio wants to read bitwise types from userspace using get_user.  At the
moment this triggers sparse errors, since the value is passed through an
integer.

Fix that up using __force.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

Acked-by: Will Deacon <will.deacon@arm.com>
---
 arch/arm64/include/asm/uaccess.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Catalin Marinas Jan. 23, 2015, 3:33 p.m. UTC | #1
On Thu, Dec 25, 2014 at 09:28:41AM +0000, Michael S. Tsirkin wrote:
> virtio wants to read bitwise types from userspace using get_user.  At the
> moment this triggers sparse errors, since the value is passed through an
> integer.
> 
> Fix that up using __force.
> 
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> 
> Acked-by: Will Deacon <will.deacon@arm.com>

I'm not sure who's going to merge this series. In the meantime, I
cherry-picked the arm64 patch. Thanks.
Will Deacon Jan. 23, 2015, 3:42 p.m. UTC | #2
On Fri, Jan 23, 2015 at 03:33:16PM +0000, Catalin Marinas wrote:
> On Thu, Dec 25, 2014 at 09:28:41AM +0000, Michael S. Tsirkin wrote:
> > virtio wants to read bitwise types from userspace using get_user.  At the
> > moment this triggers sparse errors, since the value is passed through an
> > integer.
> > 
> > Fix that up using __force.
> > 
> > Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> > 
> > Acked-by: Will Deacon <will.deacon@arm.com>
> 
> I'm not sure who's going to merge this series. In the meantime, I
> cherry-picked the arm64 patch. Thanks.

I think there was a pull request for the whole series that went to Arnd, so
I don't think we need to do anything on the arm64 side.

Will
Catalin Marinas Jan. 23, 2015, 4:35 p.m. UTC | #3
On Fri, Jan 23, 2015 at 03:42:14PM +0000, Will Deacon wrote:
> On Fri, Jan 23, 2015 at 03:33:16PM +0000, Catalin Marinas wrote:
> > On Thu, Dec 25, 2014 at 09:28:41AM +0000, Michael S. Tsirkin wrote:
> > > virtio wants to read bitwise types from userspace using get_user.  At the
> > > moment this triggers sparse errors, since the value is passed through an
> > > integer.
> > > 
> > > Fix that up using __force.
> > > 
> > > Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> > > 
> > > Acked-by: Will Deacon <will.deacon@arm.com>
> > 
> > I'm not sure who's going to merge this series. In the meantime, I
> > cherry-picked the arm64 patch. Thanks.
> 
> I think there was a pull request for the whole series that went to Arnd, so
> I don't think we need to do anything on the arm64 side.

OK. I dropped the patch.
diff mbox

Patch

diff --git a/arch/arm64/include/asm/uaccess.h b/arch/arm64/include/asm/uaccess.h
index 3bf8f4e..8d66bcf 100644
--- a/arch/arm64/include/asm/uaccess.h
+++ b/arch/arm64/include/asm/uaccess.h
@@ -147,7 +147,7 @@  do {									\
 	default:							\
 		BUILD_BUG();						\
 	}								\
-	(x) = (__typeof__(*(ptr)))__gu_val;				\
+	(x) = (__force __typeof__(*(ptr)))__gu_val;				\
 } while (0)
 
 #define __get_user(x, ptr)						\