Re: [PATCH v14] x86, mce: Add memcpy_mcsafe()

From: Linus Torvalds
Date: Sat Mar 12 2016 - 20:12:50 EST


On Sat, Mar 12, 2016 at 9:16 AM, Ingo Molnar <mingo@xxxxxxxxxx> wrote:
>
> Please use the copy_*_user() memory copying API semantics, which are: return
> negative code (-EFAULT) on error, 0 on success.

Those are the get_user/put_user() semantics.

copy_*_user() has those annoying "bytes left uncopied" return values
that I really wouldn't encourage anybody else use unless they really
have to. There are (good) reasons why it's done that way, but it's
still not something that should be aped without the same kind of major
reasons.

Linus