From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752884AbcD0CrK (ORCPT ); Tue, 26 Apr 2016 22:47:10 -0400 Received: from mail-pa0-f41.google.com ([209.85.220.41]:35942 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752437AbcD0CrI (ORCPT ); Tue, 26 Apr 2016 22:47:08 -0400 Date: Wed, 27 Apr 2016 08:17:04 +0530 From: Viresh Kumar To: One Thousand Gnomes Cc: "Rafael J. Wysocki" , Viresh Kumar , Nishanth Menon , Stephen Boyd , linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, arnd.bergmann@linaro.org, andrew@lunn.ch, gregory.clement@free-electrons.com, jason@lakedaemon.net, sebastian.hesselbarth@gmail.com, thomas.petazzoni@free-electrons.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] PM / OPP: -ENOSYS is applicable only to syscalls Message-ID: <20160427024704.GB22326@vireshk-i7> References: <60895590.AIt8jZZHh3@vostro.rjw.lan> <20160422155941.23e1d05b@lxorguk.ukuu.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160422155941.23e1d05b@lxorguk.ukuu.org.uk> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 22-04-16, 15:59, One Thousand Gnomes wrote: > On Fri, 22 Apr 2016 14:42:31 +0200 > "Rafael J. Wysocki" wrote: > > > On Friday, April 22, 2016 08:46:51 AM Viresh Kumar wrote: > > > Some of the routines have use -ENOSYS, which is supposed to be used only > > > for syscalls. Replace that with -EINVAL. > > > > -EINVAL specifically means "invalid argument". > > > > What about using -ENXIO instead? > > That specifically means "device not present", but might be reasonable. > Quite a bit of the kernel uses EOPNOTSUPP (operation not supported). That looks reasonable to me.. Will switch to that. > Before you change it though please check how existing userspace does > error handling. It's nice to use more "correct" error codes, but that's > not sufficient reason if it turns out that existing user space checks for > ENOSYS for example. Userspace doesn't interact directly with this stuff, its pretty much within the kernel. So it should be fine. Thanks Alan. -- viresh