From: "Michael S. Tsirkin" <mst@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: Arnd Bergmann <arnd@arndb.de>,
linux-arch@vger.kernel.org,
"David S. Miller" <davem@davemloft.net>,
Sam Ravnborg <sam@ravnborg.org>,
Dave Kleikamp <dave.kleikamp@oracle.com>,
sparclinux@vger.kernel.org
Subject: [PATCH repost 15/16] sparc/uaccess: fix sparse errors
Date: Thu, 25 Dec 2014 11:30:22 +0200 [thread overview]
Message-ID: <1419499661-8566-16-git-send-email-mst@redhat.com> (raw)
In-Reply-To: <1419499661-8566-1-git-send-email-mst@redhat.com>
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>
---
arch/sparc/include/asm/uaccess_64.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/sparc/include/asm/uaccess_64.h b/arch/sparc/include/asm/uaccess_64.h
index c990a5e..b80866d 100644
--- a/arch/sparc/include/asm/uaccess_64.h
+++ b/arch/sparc/include/asm/uaccess_64.h
@@ -145,7 +145,7 @@ case 2: __get_user_asm(__gu_val,uh,addr,__gu_ret); break; \
case 4: __get_user_asm(__gu_val,uw,addr,__gu_ret); break; \
case 8: __get_user_asm(__gu_val,x,addr,__gu_ret); break; \
default: __gu_val = 0; __gu_ret = __get_user_bad(); break; \
-} data = (type) __gu_val; __gu_ret; })
+} data = (__force type) __gu_val; __gu_ret; })
#define __get_user_nocheck_ret(data,addr,size,type,retval) ({ \
register unsigned long __gu_val __asm__ ("l1"); \
@@ -155,7 +155,7 @@ case 2: __get_user_asm_ret(__gu_val,uh,addr,retval); break; \
case 4: __get_user_asm_ret(__gu_val,uw,addr,retval); break; \
case 8: __get_user_asm_ret(__gu_val,x,addr,retval); break; \
default: if (__get_user_bad()) return retval; \
-} data = (type) __gu_val; })
+} data = (__force type) __gu_val; })
#define __get_user_asm(x,size,addr,ret) \
__asm__ __volatile__( \
--
MST
next prev parent reply other threads:[~2014-12-25 9:31 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-25 9:28 [PATCH repost 00/16] uaccess: fix sparse warning on get_user for bitwise types Michael S. Tsirkin
2014-12-25 9:28 ` [PATCH repost 01/16] x86/uaccess: fix sparse errors Michael S. Tsirkin
2014-12-25 9:28 ` [PATCH repost 02/16] alpha/uaccess: " Michael S. Tsirkin
2014-12-25 9:28 ` [PATCH repost 03/16] arm64/uaccess: " Michael S. Tsirkin
2015-01-23 15:33 ` Catalin Marinas
2015-01-23 15:42 ` Will Deacon
2015-01-23 16:35 ` Catalin Marinas
2014-12-25 9:28 ` [PATCH repost 04/16] avr32/uaccess: " Michael S. Tsirkin
2014-12-25 9:28 ` [PATCH repost 05/16] blackfin/uaccess: " Michael S. Tsirkin
2014-12-25 9:28 ` [PATCH repost 06/16] cris/uaccess: " Michael S. Tsirkin
2014-12-25 9:28 ` [PATCH repost 07/16] ia64/uaccess: " Michael S. Tsirkin
2014-12-25 9:28 ` [PATCH repost 08/16] m32r/uaccess: " Michael S. Tsirkin
2014-12-25 9:29 ` [PATCH repost 09/16] metag/uaccess: " Michael S. Tsirkin
2015-01-02 15:41 ` James Hogan
2015-01-04 10:52 ` Michael S. Tsirkin
2015-01-05 9:44 ` James Hogan
2015-01-05 13:00 ` Michael S. Tsirkin
2015-01-05 14:47 ` James Hogan
2015-01-06 10:00 ` Michael S. Tsirkin
2014-12-25 9:29 ` [PATCH repost 10/16] microblaze/uaccess: " Michael S. Tsirkin
2014-12-25 9:29 ` [PATCH repost 11/16] openrisc/uaccess: " Michael S. Tsirkin
2014-12-25 9:29 ` [PATCH repost 12/16] parisc/uaccess: " Michael S. Tsirkin
2014-12-25 22:37 ` Helge Deller
2014-12-27 16:14 ` Michael S. Tsirkin
2014-12-31 17:17 ` James Bottomley
2014-12-31 18:38 ` Michael S. Tsirkin
2014-12-31 20:23 ` James Bottomley
2014-12-25 9:29 ` [PATCH repost 13/16] sh/uaccess: " Michael S. Tsirkin
2014-12-25 9:29 ` [PATCH repost 14/16] sparc/uaccess: " Michael S. Tsirkin
2014-12-25 9:30 ` Michael S. Tsirkin [this message]
2014-12-25 23:39 ` [PATCH repost 15/16] " David Miller
2014-12-28 10:21 ` Michael S. Tsirkin
2014-12-25 9:30 ` [PATCH repost 16/16] m68k/uaccess: " Michael S. Tsirkin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1419499661-8566-16-git-send-email-mst@redhat.com \
--to=mst@redhat.com \
--cc=arnd@arndb.de \
--cc=dave.kleikamp@oracle.com \
--cc=davem@davemloft.net \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sam@ravnborg.org \
--cc=sparclinux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).