aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Hansen <dave.hansen@linux.intel.com>2014-11-18 13:23:43 -0500
committerThomas Gleixner <tglx@linutronix.de>2014-11-19 05:54:12 -0500
commit68c009c4137927fd4ffd3e653bb5209d752c1d42 (patch)
tree0056c3fba89ff00e0d30563ebd71ad9b07da1d0b
parentabe1e395f6171cb2d07330c690fe0285f7f859e6 (diff)
x86 mpx: Change return type of get_reg_offset()
get_reg_offset() used to return the register contents themselves instead of the register offset. When it did that, it was an unsigned long. I changed it to return an integer _offset_ instead of the register. But, I neglected to change the return type of the function or the variables in which we store the result of the call. This fixes up the code to clear up the warnings from the smatch bot: New smatch warnings: arch/x86/mm/mpx.c:178 mpx_get_addr_ref() warn: unsigned 'addr_offset' is never less than zero. arch/x86/mm/mpx.c:184 mpx_get_addr_ref() warn: unsigned 'base_offset' is never less than zero. arch/x86/mm/mpx.c:188 mpx_get_addr_ref() warn: unsigned 'indx_offset' is never less than zero. arch/x86/mm/mpx.c:196 mpx_get_addr_ref() warn: unsigned 'addr_offset' is never less than zero. Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com> Cc: Dave Hansen <dave@sr71.net> Cc: x86@kernel.org Link: http://lkml.kernel.org/r/20141118182343.C3E0C629@viggo.jf.intel.com Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--arch/x86/mm/mpx.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/arch/x86/mm/mpx.c b/arch/x86/mm/mpx.c
index f30b48e3a991..67ebf5751222 100644
--- a/arch/x86/mm/mpx.c
+++ b/arch/x86/mm/mpx.c
@@ -102,8 +102,8 @@ enum reg_type {
102 REG_TYPE_BASE, 102 REG_TYPE_BASE,
103}; 103};
104 104
105static unsigned long get_reg_offset(struct insn *insn, struct pt_regs *regs, 105static int get_reg_offset(struct insn *insn, struct pt_regs *regs,
106 enum reg_type type) 106 enum reg_type type)
107{ 107{
108 int regno = 0; 108 int regno = 0;
109 109
@@ -174,9 +174,8 @@ static unsigned long get_reg_offset(struct insn *insn, struct pt_regs *regs,
174 */ 174 */
175static void __user *mpx_get_addr_ref(struct insn *insn, struct pt_regs *regs) 175static void __user *mpx_get_addr_ref(struct insn *insn, struct pt_regs *regs)
176{ 176{
177 unsigned long addr, addr_offset; 177 unsigned long addr, base, indx;
178 unsigned long base, base_offset; 178 int addr_offset, base_offset, indx_offset;
179 unsigned long indx, indx_offset;
180 insn_byte_t sib; 179 insn_byte_t sib;
181 180
182 insn_get_modrm(insn); 181 insn_get_modrm(insn);