Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4424383rdh; Wed, 29 Nov 2023 00:41:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IFlTIcKE0MpOcnBAklHoRVnTadfo6ko7MaqE0sRxI95rpKJ/PFOxdE0PjnlTqb7ldc05eyi X-Received: by 2002:a05:6a20:729c:b0:187:a455:2758 with SMTP id o28-20020a056a20729c00b00187a4552758mr19850088pzk.30.1701247271003; Wed, 29 Nov 2023 00:41:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701247270; cv=none; d=google.com; s=arc-20160816; b=UC/f1M/GIlLqBtdsh2U6s8ntRm1B4rsk+jOdNOxDz8PHA/hwBfuVORqb7ydiCYqwkj TUcKB0Au8En2qXdtPJkuSXn9yef0BZh2ffivASg7RECVGUkspFubJ3R3ZaPrLm9xEx2m GPdE2ZD8jWdFq15jV1umpTD3U3zEm3MjD44ATrOExXcYs1hKZAi4sGHR/5HC7bOe8L+J KZgZsJOsAArYFdHEezz8NPgq7ZcllFVG7B5LHyronRgDEP13H+29ElfM1Ub6RYxdT2ga b3lsbyRGf+bu1Szf1cvhv9d9A+EarSnoffrn2bc4jNyNkohqa29PvqkBDNJDD2+H+CxI naZA== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=AKfCywz8yVWhuffi+1nkdllKuJTy6/CWyrIaSRqsEDo=; fh=pPJhnB0GGoZJS6HXdb1n1veUe2JVe0+dqC4cz//uU+o=; b=RJN6rJU4qbct+cvdyG7b7dZgsKQT4emK+PrrHoMTpwO5joMkcQPwPZ+KJCRYihu6tp QopT+cvswTnmYw80hUCvZhA+ZCjCQuz/BsVUryXRs94QcGARVC+BXjmB9spbjb1wae/Y b9FQl5IHuXdn8FQSRbvVK/+lDRpO8qqXVOxVCbTMhB7bajKcn/+c7GKOoXuRDNzKdgwk 0WsqJWU2Op+Rq/UC3CXp2Z7Nyt7Rrzl23g7jkacOxKL1wXTpMzQEafgnrORvEctAskmF Nj29RdeYmtY8NYsV8LzPV6g0lyxzMTOwfuUgIZ916/yCPPphxrmTbys0MWOeLtlTDq2D pPhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=idDYTh8F; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id g27-20020aa79ddb000000b0068fcf6fe22esi13359487pfq.306.2023.11.29.00.41.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 00:41:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=idDYTh8F; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 506F580A97C3; Wed, 29 Nov 2023 00:41:08 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231255AbjK2Ikh (ORCPT + 99 others); Wed, 29 Nov 2023 03:40:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231221AbjK2IkG (ORCPT ); Wed, 29 Nov 2023 03:40:06 -0500 Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::228]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0BAFD19B7; Wed, 29 Nov 2023 00:40:00 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 245C21BF20B; Wed, 29 Nov 2023 08:39:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1701247199; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AKfCywz8yVWhuffi+1nkdllKuJTy6/CWyrIaSRqsEDo=; b=idDYTh8FaXonBvu10jpAJAvqRXDUMcy3ydRDLkNHkYSI9BJ7ZZ9fS23LrJCTTpMILCV7Mi R1hPCxUzohf/QP4DrynIEonaYa9zr6MEo1daksb5YCCT4zwKrP7ain62v8qu/a4E+N7QN+ JCt1cwaXAlGnow3OZZMcwB480LkPHgVRDNhAu+gHB6w0RR32dxFedr8Tu8QfTPRMhBgJqq xwr/qxKl9mGj0p88Y3w2fSz7MLsI1ATrVyrOevFeNrlTaHDQMEHQodqtGfzoqMtgBeTS4t uOhMqW2d2oMaG5zOlZ1dcHDDZ72G9Eeb+Z32AxpnBTKTQLLamuWPpoEDJMqqjQ== Date: Wed, 29 Nov 2023 09:39:53 +0100 From: Miquel Raynal To: AceLan Kao Cc: Tudor Ambarus , Pratyush Yadav , Michael Walle , Richard Weinberger , Vignesh Raghavendra , Mika Westerberg , Dhruva Gole , linux-mtd@lists.infradead.org, Mark Brown , Kamal Dasu , Jonathan =?UTF-8?B?TmV1c2Now6RmZXI=?= , Mario Kicherer , Chuanhong Guo , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v7 1/2] spi: Unify error codes by replacing -ENOTSUPP with -EOPNOTSUPP Message-ID: <20231129093953.00dc04da@xps-13> In-Reply-To: <20231129064311.272422-1-acelan.kao@canonical.com> References: <20231129064311.272422-1-acelan.kao@canonical.com> Organization: Bootlin X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-GND-Sasl: miquel.raynal@bootlin.com X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 29 Nov 2023 00:41:08 -0800 (PST) Hello, acelan.kao@canonical.com wrote on Wed, 29 Nov 2023 14:43:10 +0800: > From: "Chia-Lin Kao (AceLan)" >=20 > This commit updates the SPI subsystem, particularly affecting "SPI MEM" > drivers and core parts, by replacing the -ENOTSUPP error code with > -EOPNOTSUPP. >=20 > The key motivations for this change are as follows: > 1. The spi-nor driver currently uses EOPNOTSUPP, whereas calls to spi-mem > might return ENOTSUPP. This update aims to unify the error reporting > within the SPI subsystem for clarity and consistency. >=20 > 2. The use of ENOTSUPP has been flagged by checkpatch as inappropriate, > mainly being reserved for NFS-related errors. To align with kernel coding > standards and recommendations, this change is being made. >=20 > 3. By using EOPNOTSUPP, we provide more specific context to the error, > indicating that a particular operation is not supported. This helps > differentiate from the more generic ENOTSUPP error, allowing drivers to > better handle and respond to different error scenarios. >=20 > Risks and Considerations: > While this change is primarily intended as a code cleanup and error code > unification, there is a minor risk of breaking user-space applications > that rely on specific return codes for unsupported operations. However, > this risk is considered low, as such use-cases are unlikely to be common > or critical. Nevertheless, developers and users should be aware of this > change, especially if they have scripts or tools that specifically handle > SPI error codes. >=20 > This commit does not introduce any functional changes to the SPI subsystem > or the affected drivers. >=20 > Signed-off-by: Chia-Lin Kao (AceLan) >=20 > --- > v5. distinguish -EOPNOTSUPP from -ENOTSUPP > v6. a. spi_nor_set_4byte_addr_mode() should check -EOPNOTSUPP, all > callbacks of set_4byte_addr_mode() will eventually return > -EOPNOTSUPP if the checking failed. > b. Update comment to describe the reason for the patch and the > affected parts. > c. Update the kernel-doc of exec_op() in struct spi_controller_mem_ops > v7. added comment for the return code changes may affect userspace, and > the risk after this change > --- Looks sensible to me, let's make the conversion. Acked-by: Miquel Raynal Thanks, Miqu=C3=A8l