Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3662100pxf; Mon, 29 Mar 2021 08:10:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy15EOdCizs+bdWr7CdtF8h7omr7XvHrECRa5Md14XvZTTYAO/sChA/ruyHeh/tN+ZUyq8n X-Received: by 2002:aa7:d98b:: with SMTP id u11mr29881516eds.352.1617030625388; Mon, 29 Mar 2021 08:10:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617030625; cv=none; d=google.com; s=arc-20160816; b=fmfpGIbZesTpLCA1f959LW5s86lM44L0s/dxvQHM5rttU1Wfxgq7x8ydrPTQxzHoVD W0jIPP/eDWRswooxvLxl1o/TS0gHHvjj1/yf5Slm6gOy3O+5bzKAOewHgBmDXDgHu6RU Vfq1q/Sg/OYC4Zui75EhvXfojNXOVGKQ6z0WGEmFYMv5/b89gQTAYX6YhbBYNoUNcJQ7 haWBOe7/SWMQwC/aOx3xIlmGryOqVdvrIvMIVsgC9gb+nWE/OKQmc8RIla/p7BPXsRz0 kI91SPOxpJaeLhjREKp9RPg0F0UESlt3i9S+VXXdYyBlEMMYjYNS/7VgXWdB6Oi6DDg0 hzJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=s2OmE0CJRRSZ+aqrVrsadvko7L/PTtz2lwVzsDpREiM=; b=gHHHgIAlPx+iT3KQhp8sEFfvkY/Y6pxt+I2fLFjCG4vvzFqN3oEvJX51xh7wxgkyQZ FgQFiIFnpr6jjJ7xEn8Jipx/nZBp1Z3naDjP4qlfmp26hxvRUf6auUFJLLTN74zPxplj mpd4pQfm7HsDLedmFQgSSaNxo7ZBXni3FJzJ/XpovmuUkCo1Wp6AGjFNbaOg07S1IYCH WwBhnvr8uOeaShk9rBSHk/s/nAKFIysXEPYtp+dvLfyQ1DO90Brw6MZVCaHojxPUGpDJ SAJnDy7eNm7bR5sT2flH8kKgLQeEb6Lm5Uc2n4trFwI4pUaSG8ky4ECOPlLssDzSTDMC uPcg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c18si12377024ede.125.2021.03.29.08.10.01; Mon, 29 Mar 2021 08:10:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229656AbhC2PJF (ORCPT + 99 others); Mon, 29 Mar 2021 11:09:05 -0400 Received: from smtprelay0184.hostedemail.com ([216.40.44.184]:47718 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229479AbhC2PI4 (ORCPT ); Mon, 29 Mar 2021 11:08:56 -0400 Received: from omf20.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay04.hostedemail.com (Postfix) with ESMTP id 47A6B180A5B1F; Mon, 29 Mar 2021 15:08:55 +0000 (UTC) Received: from [192.168.1.159] (unknown [47.151.137.21]) (Authenticated sender: joe@perches.com) by omf20.hostedemail.com (Postfix) with ESMTPA id 77FC918A608; Mon, 29 Mar 2021 15:08:53 +0000 (UTC) Message-ID: <1ceb7dc5c2fa376470ab9274020fddf1c2f1584f.camel@perches.com> Subject: Re: [PATCH 2/2] gpiolib: Allow drivers to return EOPNOTSUPP from config From: Joe Perches To: Andy Shevchenko , Matti Vaittinen , Jakub Kicinski Cc: Matti Vaittinen , Linus Walleij , Bartosz Golaszewski , Stephen Boyd , Andy Shevchenko , "open list:GPIO SUBSYSTEM" , Linux Kernel Mailing List Date: Mon, 29 Mar 2021 08:08:52 -0700 In-Reply-To: References: Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.38.1-1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 77FC918A608 X-Spam-Status: No, score=1.60 X-Stat-Signature: fdhzygs6faxkxwbfropctuqsjth8c68u X-Rspamd-Server: rspamout04 X-HE-Tag: 1617030533-220374 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2021-03-29 at 14:59 +0300, Andy Shevchenko wrote: > On Mon, Mar 29, 2021 at 2:43 PM Matti Vaittinen > wrote: > > > > The checkpacth instructs to switch from ENOSUPP to EOPNOTSUPP. > > > WARNING: ENOTSUPP is not a SUSV4 error code, prefer EOPNOTSUPP > > > > Make the gpiolib allow drivers to return both so driver developers > > can avoid one of the checkpatch complaints. > > Internally we are fine to use the ENOTSUPP. > Checkpatch false positives there. > > I doubt we need this change. Rather checkpatch should rephrase this to > point out that this is only applicable to _user-visible_ error path. > Cc'ed Joe. Adding CC for Jakub Kicinski who added that particular rule/test. And the output message report of the rule is merely a suggestion indicating a preference. It's always up to an individual to accept/reject. At best, perhaps wordsmithing the checkpatch message might be an OK option. +# ENOTSUPP is not a standard error code and should be avoided in new patches. +# Folks usually mean EOPNOTSUPP (also called ENOTSUP), when they type ENOTSUPP. +# Similarly to ENOSYS warning a small number of false positives is expected. + if (!$file && $line =~ /\bENOTSUPP\b/) { + if (WARN("ENOTSUPP", + "ENOTSUPP is not a SUSV4 error code, prefer EOPNOTSUPP\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/\bENOTSUPP\b/EOPNOTSUPP/; + } + } +