error value for "internal error"

From: Miklos Szeredi
Date: Tue May 02 2017 - 10:03:41 EST

I've been wondering what to return for soft asserts like this:

if (WARN_ON(something unexpected))
return -E????;

EINVAL doesn't fit because it means the input from userspace was
wrong. EIO means something went bad with the hardware.

There's no "software error" or "internal error" type return code.
Would it make sense to introduce one?

Rule would be to always add more detail to dmesg (such as done by
WARN_ON) when such a code is returned.