From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751217AbdEBODj (ORCPT ); Tue, 2 May 2017 10:03:39 -0400 Received: from mail-it0-f46.google.com ([209.85.214.46]:38218 "EHLO mail-it0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750884AbdEBODf (ORCPT ); Tue, 2 May 2017 10:03:35 -0400 MIME-Version: 1.0 X-Originating-IP: [176.63.54.97] From: Miklos Szeredi Date: Tue, 2 May 2017 16:03:34 +0200 Message-ID: Subject: error value for "internal error" To: linux-kernel@vger.kernel.org, Linux API , Linus Torvalds Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Miklos Szeredi Subject: error value for "internal error" Date: Tue, 2 May 2017 16:03:34 +0200 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Linux API , Linus Torvalds List-Id: linux-api@vger.kernel.org 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