Received: by 2002:a05:7412:ba23:b0:fa:4c10:6cad with SMTP id jp35csp338640rdb; Thu, 18 Jan 2024 05:18:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IFQsd4A/6IuIkj9Iz7vU6+vFWGPXKkCCauYlzGMbCz/LS5dU+mm9Gfw97f1YqwnAvDcPjfO X-Received: by 2002:a05:6a20:7d9c:b0:199:9d1a:cba5 with SMTP id v28-20020a056a207d9c00b001999d1acba5mr804110pzj.37.1705583911385; Thu, 18 Jan 2024 05:18:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705583911; cv=pass; d=google.com; s=arc-20160816; b=R3Eva0IgWNHobKh6HmPW2J+jXAHWMif0n446zUoB8OhR6L1mFMqnQlGoQM1vrqnOv9 VK1UJBXJqiGG3iaSWCyVwY9yO8t61OaKtYrFNTBEXwQ/gdbypgvgj54iPoc/u0FkXhwJ E4/naonaqWT/RlTA2TDmE/YGao3bFElaisz6pGkKvZF117TCFdr2Py/9sCEcl/5X2G+F EzIuc8V8d2EuTIW5oimtO7lzjpdFTV1/XjZnOt/PfvirkG+LiAiWBNAuvekIyDZrWS+K nkx/Pvj2GF5ld+DsJLcR1woSO7gjjFyCNCW0phGAJ7vgfkhtKP30NGGd1rMLj+dwj8SU dqIg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=QvBNGC4E6LYR3uClPzVRaPdL+XA4Ac8k7SXynano+4o=; fh=vNeeKvNwzq1ka3pgezwiUsUeeWEyVqYFFZYB4RJoIxQ=; b=W2vIt95/AWXtwRSAcPsmZpCDiLkDTFwtca6Zqxxbny2G+UYAyI/Xl7kUTC5JPOEGXk p2mjc1dfHvK1CHKGsInzORzrrw2VbSBn9xlKEPOahpNftLqzp8mYT19SpUnzDKvHDa94 BHmAnskuu9TRiHP3hMicscmUR6LKm2+pLGmEjSX/+7aIZbZIuLGAcfhmvn9UwNYNDypV 9+u1U5Zr+6ZzY/qOyiT4yLLxTWA5tFCyDwmIFsuezr0pkjjLURd45+HDU7vxoIa2g5IW EIcwS+yQhQBVqFm03VGNepvn0Ps6SFsLY71fi9sw0gJTSRYLrsCH7i0dtCFmpqbMMQfo OutQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=hMlQWnJw; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-30143-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-30143-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id p17-20020a637411000000b005c65f924f6csi1421551pgc.319.2024.01.18.05.18.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jan 2024 05:18:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-30143-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=hMlQWnJw; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-30143-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-30143-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id ED422282EE0 for ; Thu, 18 Jan 2024 13:18:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D71B625760; Thu, 18 Jan 2024 13:15:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hMlQWnJw" Received: from mail-pg1-f172.google.com (mail-pg1-f172.google.com [209.85.215.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B56D525757; Thu, 18 Jan 2024 13:15:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705583753; cv=none; b=Ee77hH3tF69pYyaXdlugTteO8UiiVUw0PkeFr48r1Efd4qo/Ose8ly7Xf6HnI7jHQnUQ51bFraWXhXXN0bhicqan7kv5RRd4qOcpJTSbEC2Q7I+g1IqAjVeWZSMQXeX6TYTkWAFH8WPleFYDIbvOaaJk2I+GEUr4124c8ei3YZ4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705583753; c=relaxed/simple; bh=gawuwuYzbbmDzTZtAr7RJ6aRIEt4uhR05OLZfhfBC7Q=; h=Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Google-Smtp-Source:X-Received:Received:Date: From:To:Cc:Subject:Message-ID:References:MIME-Version:Content-Type: Content-Disposition:Content-Transfer-Encoding:In-Reply-To; b=ZVJGalSYn+uTYcaOXLkqVq2iFCo+oKvU7BfAlhJzaX0FBwjYMHgK4jxJaXYfFB24b+SwD5vfuwGeDv7FCM4qSrCh6cuJR1nImAsmF5PG71Tjmbf7NjUtlE69SZjaptmUecWDZ1Rg3oWTp+niHoA31S5imXsCLCvh1GI/a6SwYtY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=hMlQWnJw; arc=none smtp.client-ip=209.85.215.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pg1-f172.google.com with SMTP id 41be03b00d2f7-5bdbe2de25fso9606455a12.3; Thu, 18 Jan 2024 05:15:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705583751; x=1706188551; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=QvBNGC4E6LYR3uClPzVRaPdL+XA4Ac8k7SXynano+4o=; b=hMlQWnJwUJx+uZoFvcuFjhQeaL2i+2bRz5ruVq9ndoI/7sb1b/WH28YF93y4m2DuZr Q94ChiVWQMmJyfZPOqoMcvp3fm9tWr93gWDxojO9M17JSvL5NOT9tcLEWgSy5lB2ZEfp D90wNu+uDWqob6UatnfQcjqYxvo/vyg/x7w01CaES3j7CfUivTwy81UWwtzSClpJ6LIb WWBhqhIlBq4yKqFyOR2sTz3OXZZuhWu7ihX8LOdfRobP7TRe3GmLdFabF7qalyHbgrpB sUpJD8iuoBPkwQSb7g4qNE+yI+sBMzSVAV9aqPRy6f4jyEs//CDvuEakZj/3FX5yE93R vtfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705583751; x=1706188551; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=QvBNGC4E6LYR3uClPzVRaPdL+XA4Ac8k7SXynano+4o=; b=OBwIWRyZiaG4HYU85w4pW3Qsz6s9F9xdYP5H+3Yk19uE2QE4O0wYHX7xESOs3m5Nss GJj+oR8JEGVIUNXLBLTUx7DFyizX4AH6LC7K3cdFTq84xnn+ZTUbTu5vKWFaHdDieP6s ZjBo38X32Jy4kBDp6Yli40e6dwFskYHKYoOk2xkr2l276WBq5/6KybGb/Z9W2b8xaiDy 796EvbkyqFP/wwPNOWU265q0qsXq1XQjtCLYqYI98XzR++4Iu+aoKZ6UgXe/1tjxFmYn ymetOt8ewqKP8RG6artd3oC+pfHBLQbECWpjh6u0056GxqVsw4T71wUyx9Sy29wdGvav T1wg== X-Gm-Message-State: AOJu0YwswFij3YAAn2bwhzokWDxfXt1SNScWYcJoH1LDA6YlUn0RVwH1 gFtlKhnbbpx46wzMsDJKUxzTBwdNSPePKOWXhwPOwYQRd0iWKG1p X-Received: by 2002:a05:6a21:6d91:b0:196:ae4b:e007 with SMTP id wl17-20020a056a216d9100b00196ae4be007mr887739pzb.116.1705583750952; Thu, 18 Jan 2024 05:15:50 -0800 (PST) Received: from rigel (194-223-183-150.tpgi.com.au. [194.223.183.150]) by smtp.gmail.com with ESMTPSA id z189-20020a6333c6000000b005c66a7d70fdsm1455523pgz.61.2024.01.18.05.15.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jan 2024 05:15:50 -0800 (PST) Date: Thu, 18 Jan 2024 21:15:44 +0800 From: Kent Gibson To: Andy Shevchenko Cc: Hugo Villeneuve , Bartosz Golaszewski , gregkh@linuxfoundation.org, jirislaby@kernel.org, cosmin.tanislav@analog.com, shc_work@mail.ru, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Hugo Villeneuve Subject: Re: [PATCH 15/18] serial: max310x: replace ENOTSUPP with preferred EOPNOTSUPP (checkpatch) Message-ID: <20240118131544.GA151488@rigel> References: <20240117223856.2303475-1-hugo@hugovil.com> <20240117223856.2303475-16-hugo@hugovil.com> <20240117185909.78bb633ea090f74de9f4f3b7@hugovil.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Thu, Jan 18, 2024 at 10:59:34AM +0200, Andy Shevchenko wrote: > On Thu, Jan 18, 2024 at 1:59 AM Hugo Villeneuve wrote: > > On Thu, 18 Jan 2024 01:24:11 +0200 > > Andy Shevchenko wrote: > > > On Thu, Jan 18, 2024 at 12:39 AM Hugo Villeneuve wrote: > > ... > > > > > Fixes the following checkpatch warning: > > > > > > > > WARNING: ENOTSUPP is not a SUSV4 error code, prefer EOPNOTSUPP > > > > > > NAK. > > > It's a false positive. > > > > > > > According to include/linux/errno.h, ENOTSUPP is > > > > "Defined for the NFSv3 protocol", so replace it with preferred EOPNOTSUPP. > > > > > > The GPIO subsystem uses this internal error code internally. User > > > space won't get it, so users may not see this one. > > > > Hi Andy, > > I will drop the patch then. > > > > What about adding a comment to prevent future fixes? > > > > - return -ENOTSUPP; > > + return -ENOTSUPP; /* > > + * ENOTSUPP is used for backward compatibility > > + * with GPIO subsystem. > > + */ > > It's kinda useless to add it to a single (GPIO) driver. > Rather it needs to be mentioned somewhere between > https://www.kernel.org/doc/html/latest/driver-api/gpio/index.html. > > +Cc: Kent, Bart. It seems we have a handful of drivers violating this > (basically following what checkpatch says) and GPIO not documenting > this specific error code and its scope. Did I miss anything? > You are correct - the GPIO subsystem is expecting ENOTSUPP if the config is not supported. In some cases it absorbs the failure or emulates the feature instead (open drain/source, debounce). Returning EOPNOTSUPP would be unfortunate, so checkpatch is not being helpful here. And don't get me started on the gpio_chip interface contract being too vague. There are a handful of ways this could be addressed (documentation, checkpatch, handle either, switch to EOPNOTSUPP, ... or some combination), but making that call is definitely in Bart's court. Cheers, Kent.