From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 16D7EC433C1 for ; Mon, 29 Mar 2021 15:09:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CC5D7600EF for ; Mon, 29 Mar 2021 15:09:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230161AbhC2PJF (ORCPT ); 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-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/; + } + } +