From: Christoph Hellwig <hch@lst.de>
To: Geert Uytterhoeven <geert@linux-m68k.org>,
Greg Ungerer <gerg@linux-m68k.org>
Cc: Michael Schmitz <schmitzmic@gmail.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
linux-m68k@lists.linux-m68k.org
Subject: [PATCH 3/6] m68k: use BUILD_BUG for passing invalid sizes to get_user/put_user
Date: Thu, 16 Sep 2021 09:04:02 +0200 [thread overview]
Message-ID: <20210916070405.52750-4-hch@lst.de> (raw)
In-Reply-To: <20210916070405.52750-1-hch@lst.de>
Simplify the handling a bit by using the common helper instead of
referencing undefined symbols.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
arch/m68k/include/asm/uaccess.h | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/arch/m68k/include/asm/uaccess.h b/arch/m68k/include/asm/uaccess.h
index 610bfe8d64d5f..01334a9658c40 100644
--- a/arch/m68k/include/asm/uaccess.h
+++ b/arch/m68k/include/asm/uaccess.h
@@ -39,9 +39,6 @@ static inline int access_ok(const void __user *addr,
#define MOVES "move"
#endif
-extern int __put_user_bad(void);
-extern int __get_user_bad(void);
-
#define __put_user_asm(res, x, ptr, bwl, reg, err) \
asm volatile ("\n" \
"1: "MOVES"."#bwl" %2,%1\n" \
@@ -105,8 +102,7 @@ asm volatile ("\n" \
break; \
} \
default: \
- __pu_err = __put_user_bad(); \
- break; \
+ BUILD_BUG(); \
} \
__pu_err; \
})
@@ -179,8 +175,7 @@ asm volatile ("\n" \
break; \
} \
default: \
- __gu_err = __get_user_bad(); \
- break; \
+ BUILD_BUG(); \
} \
__gu_err; \
})
--
2.30.2
next prev parent reply other threads:[~2021-09-16 7:06 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-16 7:03 remove set_fs for m68k Christoph Hellwig
2021-09-16 7:04 ` [PATCH 1/6] m68k: document that access_ok is broken for !CONFIG_CPU_HAS_ADDRESS_SPACES Christoph Hellwig
2021-09-16 7:04 ` [PATCH 2/6] m68k: remove the 030 case in virt_to_phys_slow Christoph Hellwig
2021-09-16 7:04 ` Christoph Hellwig [this message]
2021-09-23 14:46 ` [PATCH 3/6] m68k: use BUILD_BUG for passing invalid sizes to get_user/put_user Geert Uytterhoeven
2021-09-16 7:04 ` [PATCH 4/6] m68k: factor the 8-byte lowlevel {get,put}_user code into helpers Christoph Hellwig
2021-09-23 14:47 ` Geert Uytterhoeven
2021-09-16 7:04 ` [PATCH 5/6] m68k: provide __{get,put}_kernel_nofault Christoph Hellwig
2021-09-23 14:47 ` Geert Uytterhoeven
2021-09-16 7:04 ` [PATCH 6/6] m68k: remove set_fs() Christoph Hellwig
2021-09-23 14:48 ` Geert Uytterhoeven
2021-09-17 5:40 ` remove set_fs for m68k Michael Schmitz
2021-09-23 14:52 ` Geert Uytterhoeven
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=20210916070405.52750-4-hch@lst.de \
--to=hch@lst.de \
--cc=geert@linux-m68k.org \
--cc=gerg@linux-m68k.org \
--cc=linux-m68k@lists.linux-m68k.org \
--cc=schmitzmic@gmail.com \
--cc=torvalds@linux-foundation.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).