From: Paul Gortmaker <paul.gortmaker@windriver.com>
To: <linux-kernel@vger.kernel.org>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>,
Tony Luck <tony.luck@intel.com>,
Fenghua Yu <fenghua.yu@intel.com>, <linux-ia64@vger.kernel.org>
Subject: [PATCH 1/2] ia64: macro-ize ia64_done_with_exception in asm/uaccess.h
Date: Tue, 16 Aug 2016 11:14:42 -0400 [thread overview]
Message-ID: <20160816151443.31082-2-paul.gortmaker@windriver.com> (raw)
In-Reply-To: <20160816151443.31082-1-paul.gortmaker@windriver.com>
Most of the other C content in this file is already implemented
in macro form. Doing the same for this function will allow us
to get rid of the duplicated search_exception_tables prototype.
We will bring it in as required via <linux/extable.h> inclusion.
Cc: Tony Luck <tony.luck@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: linux-ia64@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
arch/ia64/include/asm/uaccess.h | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/arch/ia64/include/asm/uaccess.h b/arch/ia64/include/asm/uaccess.h
index 465c70982f40..4b52b79213a3 100644
--- a/arch/ia64/include/asm/uaccess.h
+++ b/arch/ia64/include/asm/uaccess.h
@@ -363,17 +363,17 @@ struct exception_table_entry {
extern void ia64_handle_exception (struct pt_regs *regs, const struct exception_table_entry *e);
extern const struct exception_table_entry *search_exception_tables (unsigned long addr);
-static inline int
-ia64_done_with_exception (struct pt_regs *regs)
-{
- const struct exception_table_entry *e;
- e = search_exception_tables(regs->cr_iip + ia64_psr(regs)->ri);
- if (e) {
- ia64_handle_exception(regs, e);
- return 1;
- }
- return 0;
-}
+#define ia64_done_with_exception(regs) \
+({ \
+ int __ex_ret = 0; \
+ const struct exception_table_entry *e; \
+ e = search_exception_tables((regs)->cr_iip + ia64_psr(regs)->ri); \
+ if (e) { \
+ ia64_handle_exception(regs, e); \
+ __ex_ret = 1; \
+ } \
+ __ex_ret; \
+})
#define ARCH_HAS_TRANSLATE_MEM_PTR 1
static __inline__ void *
--
2.8.4
next prev parent reply other threads:[~2016-08-16 15:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-16 15:14 [PATCH 0/2] ia64: make use of new extable.h header Paul Gortmaker
2016-08-16 15:14 ` Paul Gortmaker [this message]
2016-08-17 17:15 ` [PATCH 1/2] ia64: macro-ize ia64_done_with_exception in asm/uaccess.h Al Viro
2016-08-18 15:14 ` Paul Gortmaker
2016-08-16 15:14 ` [PATCH 2/2] ia64: ensure exception table search users include extable.h Paul Gortmaker
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=20160816151443.31082-2-paul.gortmaker@windriver.com \
--to=paul.gortmaker@windriver.com \
--cc=fenghua.yu@intel.com \
--cc=linux-ia64@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tony.luck@intel.com \
/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).