]> git.baikalelectronics.ru Git - kernel.git/commit
x86/mm, x86/mce: Fix return type/value for memcpy_mcsafe()
authorTony Luck <tony.luck@intel.com>
Mon, 14 Mar 2016 22:33:39 +0000 (15:33 -0700)
committerIngo Molnar <mingo@kernel.org>
Wed, 16 Mar 2016 08:02:18 +0000 (09:02 +0100)
commit1be3733e6de5f98bbbd918d72c7c654c37dd1b68
tree3d4f98e0dfff996531c295c8fbd95593f5f8ff1f
parent9d1b3db44308c5e9bedb9acf06f7757b9f06a879
x86/mm, x86/mce: Fix return type/value for memcpy_mcsafe()

Returning a 'bool' was very unpopular. Doubly so because the
code was just wrong (returning zero for true, one for false;
great for shell programming, not so good for C).

Change return type to "int". Keep zero as the success indicator
because it matches other similar code and people may be more
comfortable writing:

if (memcpy_mcsafe(to, from, count)) {
printk("Sad panda, copy failed\n");
...
}

Make the failure return value -EFAULT for now.

Reported by: Mika Penttilä <mika.penttila@nextfour.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: mika.penttila@nextfour.com
Fixes: 8a1b31fc1b34 ("x86/mm, x86/mce: Add memcpy_mcsafe()")
Link: http://lkml.kernel.org/r/695f14233fa7a54fcac4406c706d7fec228e3f4c.1457993040.git.tony.luck@intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/include/asm/string_64.h
arch/x86/lib/memcpy_64.S