All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: AceLan Kao <acelan.kao@canonical.com>
Cc: "Tudor Ambarus" <tudor.ambarus@linaro.org>,
	"Pratyush Yadav" <pratyush@kernel.org>,
	"Michael Walle" <michael@walle.cc>,
	"Richard Weinberger" <richard@nod.at>,
	"Vignesh Raghavendra" <vigneshr@ti.com>,
	"Mika Westerberg" <mika.westerberg@linux.intel.com>,
	"Dhruva Gole" <d-gole@ti.com>,
	linux-mtd@lists.infradead.org, "Mark Brown" <broonie@kernel.org>,
	"Kamal Dasu" <kamal.dasu@broadcom.com>,
	"Jonathan Neuschäfer" <j.neuschaefer@gmx.net>,
	"Mario Kicherer" <dev@kicherer.org>,
	"Chuanhong Guo" <gch981213@gmail.com>,
	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
Date: Wed, 29 Nov 2023 09:39:53 +0100	[thread overview]
Message-ID: <20231129093953.00dc04da@xps-13> (raw)
In-Reply-To: <20231129064311.272422-1-acelan.kao@canonical.com>

Hello,

acelan.kao@canonical.com wrote on Wed, 29 Nov 2023 14:43:10 +0800:

> From: "Chia-Lin Kao (AceLan)" <acelan.kao@canonical.com>
> 
> This commit updates the SPI subsystem, particularly affecting "SPI MEM"
> drivers and core parts, by replacing the -ENOTSUPP error code with
> -EOPNOTSUPP.
> 
> 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.
> 
> 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.
> 
> 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.
> 
> 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.
> 
> This commit does not introduce any functional changes to the SPI subsystem
> or the affected drivers.
> 
> Signed-off-by: Chia-Lin Kao (AceLan) <acelan.kao@canonical.com>
> 
> ---
> 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 <miquel.raynal@bootlin.com>

Thanks,
Miquèl

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

WARNING: multiple messages have this Message-ID (diff)
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: AceLan Kao <acelan.kao@canonical.com>
Cc: "Tudor Ambarus" <tudor.ambarus@linaro.org>,
	"Pratyush Yadav" <pratyush@kernel.org>,
	"Michael Walle" <michael@walle.cc>,
	"Richard Weinberger" <richard@nod.at>,
	"Vignesh Raghavendra" <vigneshr@ti.com>,
	"Mika Westerberg" <mika.westerberg@linux.intel.com>,
	"Dhruva Gole" <d-gole@ti.com>,
	linux-mtd@lists.infradead.org, "Mark Brown" <broonie@kernel.org>,
	"Kamal Dasu" <kamal.dasu@broadcom.com>,
	"Jonathan Neuschäfer" <j.neuschaefer@gmx.net>,
	"Mario Kicherer" <dev@kicherer.org>,
	"Chuanhong Guo" <gch981213@gmail.com>,
	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
Date: Wed, 29 Nov 2023 09:39:53 +0100	[thread overview]
Message-ID: <20231129093953.00dc04da@xps-13> (raw)
In-Reply-To: <20231129064311.272422-1-acelan.kao@canonical.com>

Hello,

acelan.kao@canonical.com wrote on Wed, 29 Nov 2023 14:43:10 +0800:

> From: "Chia-Lin Kao (AceLan)" <acelan.kao@canonical.com>
> 
> This commit updates the SPI subsystem, particularly affecting "SPI MEM"
> drivers and core parts, by replacing the -ENOTSUPP error code with
> -EOPNOTSUPP.
> 
> 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.
> 
> 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.
> 
> 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.
> 
> 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.
> 
> This commit does not introduce any functional changes to the SPI subsystem
> or the affected drivers.
> 
> Signed-off-by: Chia-Lin Kao (AceLan) <acelan.kao@canonical.com>
> 
> ---
> 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 <miquel.raynal@bootlin.com>

Thanks,
Miquèl

  parent reply	other threads:[~2023-11-29  8:40 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-29  6:43 [PATCH v7 1/2] spi: Unify error codes by replacing -ENOTSUPP with -EOPNOTSUPP AceLan Kao
2023-11-29  6:43 ` AceLan Kao
2023-11-29  6:43 ` [PATCH v7 2/2] mtd: spi-nor: Stop reporting warning message when soft reset is not suported AceLan Kao
2023-11-29  6:43   ` AceLan Kao
2023-11-29  7:46   ` Tudor Ambarus
2023-11-29  7:46     ` Tudor Ambarus
2023-11-29 21:19     ` Mark Brown
2023-11-29 21:19       ` Mark Brown
2023-11-30  2:27       ` AceLan Kao
2023-11-30  2:27         ` AceLan Kao
2023-11-30  9:20       ` Tudor Ambarus
2023-11-30  9:20         ` Tudor Ambarus
2023-11-29  8:40   ` Miquel Raynal
2023-11-29  8:40     ` Miquel Raynal
2023-11-29  7:05 ` [PATCH v7 1/2] spi: Unify error codes by replacing -ENOTSUPP with -EOPNOTSUPP Mika Westerberg
2023-11-29  7:05   ` Mika Westerberg
2023-11-29  7:38 ` Tudor Ambarus
2023-11-29  7:38   ` Tudor Ambarus
2023-11-29  8:28 ` Michael Walle
2023-11-29  8:28   ` Michael Walle
2023-11-29  8:39 ` Miquel Raynal [this message]
2023-11-29  8:39   ` Miquel Raynal
2023-11-30 14:19 ` Mark Brown
2023-11-30 14:19   ` Mark Brown
2024-03-13 15:40 ` Florian Fainelli
2024-03-13 15:40   ` Florian Fainelli
2024-03-13 15:56 ` Michael Walle
2024-03-13 15:56   ` Michael Walle
2024-03-13 17:13   ` Florian Fainelli
2024-03-13 17:13     ` Florian Fainelli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231129093953.00dc04da@xps-13 \
    --to=miquel.raynal@bootlin.com \
    --cc=acelan.kao@canonical.com \
    --cc=broonie@kernel.org \
    --cc=d-gole@ti.com \
    --cc=dev@kicherer.org \
    --cc=gch981213@gmail.com \
    --cc=j.neuschaefer@gmx.net \
    --cc=kamal.dasu@broadcom.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=michael@walle.cc \
    --cc=mika.westerberg@linux.intel.com \
    --cc=pratyush@kernel.org \
    --cc=richard@nod.at \
    --cc=tudor.ambarus@linaro.org \
    --cc=vigneshr@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.