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 753FDC433DB for ; Mon, 29 Mar 2021 12:48:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2BAA561934 for ; Mon, 29 Mar 2021 12:48:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231244AbhC2Mrs (ORCPT ); Mon, 29 Mar 2021 08:47:48 -0400 Received: from mail-lf1-f52.google.com ([209.85.167.52]:42568 "EHLO mail-lf1-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230437AbhC2MrY (ORCPT ); Mon, 29 Mar 2021 08:47:24 -0400 Received: by mail-lf1-f52.google.com with SMTP id o10so18196416lfb.9; Mon, 29 Mar 2021 05:47:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:reply-to:to:cc :in-reply-to:references:mime-version:date:user-agent :content-transfer-encoding; bh=qcUkrZxCZhAMY+mD6RDntHpxB7c/p3mawg28QpuxShY=; b=TpjX4pNbD75w4xB+txGJdl9x5PI+sU44yTheoTNZC/w3MdNn3/hyVW9La3tv3HaT0/ Lr8SCKMQ7KI1ntgzy93y4u918nOG2DzOWYJOMzBIidjgemTTaIRitt6jlL5LmNHpojig W/7VGxfpzDUVixkWAR4EXI6ab0ILYYpogJpV+I1Xh34atEVUsq2QO0jM6CaOmHT4kShx bhOAcJI8k4WTHRoyVIu+/8qsDlmGj48vlEyl8xPbVt2nA55CuTLPXrTp31O+v3RBHiSd wyQAcLoIoYJdaCZu7ha+3XxIXhLOQ5Afn9quBHeVGg8y9nwklL2/H2O6RM9hbeIMOXkR OVww== X-Gm-Message-State: AOAM530kUIKiVXX2APdJR6nkeNt6iDqXWgRQgsIvVwI3AGJlVTQqVoHT DzHhMkwV1adr5gQ1/Fa0LHCxZAxNP++PPg== X-Google-Smtp-Source: ABdhPJxcqzSpvlZ5/l+LnbH92oR6LF57czHA95JmDUeNTw7crz1rVuvNSo46wGvFzvCg0HQ+zxMvhQ== X-Received: by 2002:a05:6512:5d7:: with SMTP id o23mr16028798lfo.81.1617022043565; Mon, 29 Mar 2021 05:47:23 -0700 (PDT) Received: from dc7vkhyyyyyyyyyyyyyby-3.rev.dnainternet.fi (dc7vkhyyyyyyyyyyyyyby-3.rev.dnainternet.fi. [2001:14ba:16e2:8300::2]) by smtp.gmail.com with ESMTPSA id f22sm1826514lfc.68.2021.03.29.05.47.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Mar 2021 05:47:23 -0700 (PDT) Message-ID: Subject: Re: [PATCH 2/2] gpiolib: Allow drivers to return EOPNOTSUPP from config From: Matti Vaittinen Reply-To: matti.vaittinen@fi.rohmeurope.com To: Andy Shevchenko , Joe Perches Cc: Linus Walleij , Bartosz Golaszewski , Stephen Boyd , Andy Shevchenko , "open list:GPIO SUBSYSTEM" , Linux Kernel Mailing List In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Mon, 29 Mar 2021 15:20:07 +0300 User-Agent: Evolution 3.34.4 (3.34.4-1.fc31) Content-Transfer-Encoding: 7bit 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 agree. OTOH, the checkpatch check makes sense to user-visible stuff. Yet, the checkpatch has hard time guessing what is user-visible - so it probably is easiest to nag about all ENOTSUPP uses as it does now. > 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. Yes, thanks for pulling Joe in. Anyways, no matter what the warning says, all false positives are annoying. I don't see why we should stay with ENOTSUPP in gpiolib? (other than the burden of changing it). But I have no strong opinion on this. All options I see have downsides. Accepting both ENOTSUPP and EOPNOTSUPP is the easy way to avoid allowing checkpatch warnings - but I admit it isn't stylish. Converting all ENOTSUPP cases inside gpiolib to EOPNOTSUPP is teodious although end result might be nicer. Leaving it as is gives annoying false-positives to driver developers. My personal preference was this patch - others can have other view like Andy does. I'll leave this to community/maintainers to evaluate :) Best Regards Matti Vaittinen