From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753645AbbGFHiS (ORCPT ); Mon, 6 Jul 2015 03:38:18 -0400 Received: from smtprelay05.ispgateway.de ([80.67.31.98]:57180 "EHLO smtprelay05.ispgateway.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750931AbbGFHiR (ORCPT ); Mon, 6 Jul 2015 03:38:17 -0400 Message-ID: <559A301E.5000201@ladisch.de> Date: Mon, 06 Jul 2015 09:37:02 +0200 From: Clemens Ladisch User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Masahiro Yamada , Linux Kernel Mailing List Subject: Re: [Question] Usage of ENOTSUPP error code References: In-Reply-To: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Df-Sender: bGludXgta2VybmVsQGNsLmRvbWFpbmZhY3Rvcnkta3VuZGUuZGU= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Masahiro Yamada wrote: > I noticed many drivers return -ENOTSUPP on error. > > I assume ENOTSUPP is defined in include/linux/errno.h > as follows: > > /* Defined for the NFSv3 protocol */ > ... > #define ENOTSUPP 524 /* Operation is not supported */ > > If so, should ENOTSUPP be only used for NFS-related errors? There is typcially no such restriction. However, the problem with ENOTSUPP is that it is not defined in the uapi header, so it will not be known to user space programs. > In fact, ENOTSUPP is used by various drivers > including non-network ones such as pinctrl, USB, etc. If it is possible that the error code shows up for user space, ENOTSUPP should not be used. Alternatives would be something like ENOTSUP, EOPNOTSUPP, ENOIOCTLCMD, ENOSYS, or EINVAL. Regards, Clemens