From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754122AbcDVPAQ (ORCPT ); Fri, 22 Apr 2016 11:00:16 -0400 Received: from lxorguk.ukuu.org.uk ([81.2.110.251]:48992 "EHLO lxorguk.ukuu.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751761AbcDVPAO (ORCPT ); Fri, 22 Apr 2016 11:00:14 -0400 Date: Fri, 22 Apr 2016 15:59:41 +0100 From: One Thousand Gnomes To: "Rafael J. Wysocki" Cc: Viresh Kumar , 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: <20160422155941.23e1d05b@lxorguk.ukuu.org.uk> In-Reply-To: <60895590.AIt8jZZHh3@vostro.rjw.lan> References: <60895590.AIt8jZZHh3@vostro.rjw.lan> Organization: Intel Corporation X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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). 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. Alan