linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* error value for "internal error"
@ 2017-05-02 14:03 Miklos Szeredi
       [not found] ` <CAJfpegv3xS_MEVVeAnd4JUvjxoJd9PQdbsEzCPXNpUeex4SxHA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Miklos Szeredi @ 2017-05-02 14:03 UTC (permalink / raw)
  To: linux-kernel-u79uwXL29TY76Z2rM5mHXA, Linux API, Linus Torvalds

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.

Thanks,
Miklos

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-05-03  9:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-02 14:03 error value for "internal error" Miklos Szeredi
     [not found] ` <CAJfpegv3xS_MEVVeAnd4JUvjxoJd9PQdbsEzCPXNpUeex4SxHA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-05-02 18:37   ` Linus Torvalds
     [not found]     ` <CA+55aFxScO3nZPoj8HbHsyuwT1WA6BuT9Hi=A3AD+1LF3JsVCA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-05-03  9:10       ` Miklos Szeredi

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).