* [PATCH 0/3] i3c: switch to use SUSV4 error codes
@ 2025-06-25 13:09 Wolfram Sang
2025-06-25 13:09 ` [PATCH 1/3] i3c: core: " Wolfram Sang
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Wolfram Sang @ 2025-06-25 13:09 UTC (permalink / raw)
To: linux-renesas-soc
Cc: Wolfram Sang, Alexandre Belloni, Frank Li, linux-i3c,
Przemysław Gaj
This checkpatch warning makes sense here: "ENOTSUPP is not a SUSV4 error
code, prefer EOPNOTSUPP" We don't have a userspace interface yet, but we
probably will get one. So, let's convert these error codes now, before
it will be forgotten in the future, and they could slip through to
applications.
This is based on 6.16-rc3 plus "[PATCH] i3c: don't fail if GETHDRCAP is
unsupported" which I sent earlier. During its development, the issue
became apparent. Automatically generated and build tested only.
Looking forward to comments.
Wolfram Sang (3):
i3c: core: switch to use SUSV4 error codes
i3c: dw: switch to use SUSV4 error codes
i3c: cdns: switch to use SUSV4 error codes
drivers/i3c/master.c | 20 ++++++++++----------
drivers/i3c/master/dw-i3c-master.c | 8 ++++----
drivers/i3c/master/i3c-master-cdns.c | 12 ++++++------
3 files changed, 20 insertions(+), 20 deletions(-)
--
2.47.2
--
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/3] i3c: core: switch to use SUSV4 error codes
2025-06-25 13:09 [PATCH 0/3] i3c: switch to use SUSV4 error codes Wolfram Sang
@ 2025-06-25 13:09 ` Wolfram Sang
2025-06-25 20:30 ` Frank Li
2025-06-25 13:09 ` [PATCH 2/3] i3c: dw: " Wolfram Sang
2025-06-25 13:09 ` [PATCH 3/3] i3c: cdns: " Wolfram Sang
2 siblings, 1 reply; 7+ messages in thread
From: Wolfram Sang @ 2025-06-25 13:09 UTC (permalink / raw)
To: linux-renesas-soc; +Cc: Wolfram Sang, Alexandre Belloni, Frank Li, linux-i3c
This checkpatch warning makes sense here: "ENOTSUPP is not a SUSV4 error
code, prefer EOPNOTSUPP" We don't have a userspace interface yet, but we
probably will get one. So, let's convert these error codes now, before
it will be forgotten in the future, and they could slip through to
applications.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
drivers/i3c/master.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
index e53c69d24873..354fef4a033c 100644
--- a/drivers/i3c/master.c
+++ b/drivers/i3c/master.c
@@ -837,14 +837,14 @@ static int i3c_master_send_ccc_cmd_locked(struct i3c_master_controller *master,
return -EINVAL;
if (!master->ops->send_ccc_cmd)
- return -ENOTSUPP;
+ return -EOPNOTSUPP;
if ((cmd->id & I3C_CCC_DIRECT) && (!cmd->dests || !cmd->ndests))
return -EINVAL;
if (master->ops->supports_ccc_cmd &&
!master->ops->supports_ccc_cmd(master, cmd))
- return -ENOTSUPP;
+ return -EOPNOTSUPP;
ret = master->ops->send_ccc_cmd(master, cmd);
if (ret) {
@@ -1439,7 +1439,7 @@ static int i3c_master_retrieve_dev_info(struct i3c_dev_desc *dev)
if (dev->info.bcr & I3C_BCR_HDR_CAP) {
ret = i3c_master_gethdrcap_locked(master, &dev->info);
- if (ret && ret != -ENOTSUPP)
+ if (ret && ret != -EOPNOTSUPP)
return ret;
}
@@ -2210,7 +2210,7 @@ of_i3c_master_add_i2c_boardinfo(struct i3c_master_controller *master,
*/
if (boardinfo->base.flags & I2C_CLIENT_TEN) {
dev_err(dev, "I2C device with 10 bit address not supported.");
- return -ENOTSUPP;
+ return -EOPNOTSUPP;
}
/* LVR is encoded in reg[2]. */
@@ -2340,13 +2340,13 @@ static int i3c_master_i2c_adapter_xfer(struct i2c_adapter *adap,
return -EINVAL;
if (!master->ops->i2c_xfers)
- return -ENOTSUPP;
+ return -EOPNOTSUPP;
/* Doing transfers to different devices is not supported. */
addr = xfers[0].addr;
for (i = 1; i < nxfers; i++) {
if (addr != xfers[i].addr)
- return -ENOTSUPP;
+ return -EOPNOTSUPP;
}
i3c_bus_normaluse_lock(&master->bus);
@@ -2766,7 +2766,7 @@ static int i3c_master_check_ops(const struct i3c_master_controller_ops *ops)
* controller)
* @ops: the master controller operations
* @secondary: true if you are registering a secondary master. Will return
- * -ENOTSUPP if set to true since secondary masters are not yet
+ * -EOPNOTSUPP if set to true since secondary masters are not yet
* supported
*
* This function takes care of everything for you:
@@ -2793,7 +2793,7 @@ int i3c_master_register(struct i3c_master_controller *master,
/* We do not support secondary masters yet. */
if (secondary)
- return -ENOTSUPP;
+ return -EOPNOTSUPP;
ret = i3c_master_check_ops(ops);
if (ret)
@@ -2954,7 +2954,7 @@ int i3c_dev_do_priv_xfers_locked(struct i3c_dev_desc *dev,
return -EINVAL;
if (!master->ops->priv_xfers)
- return -ENOTSUPP;
+ return -EOPNOTSUPP;
return master->ops->priv_xfers(dev, xfers, nxfers);
}
@@ -3004,7 +3004,7 @@ int i3c_dev_request_ibi_locked(struct i3c_dev_desc *dev,
int ret;
if (!master->ops->request_ibi)
- return -ENOTSUPP;
+ return -EOPNOTSUPP;
if (dev->ibi)
return -EBUSY;
--
2.47.2
--
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/3] i3c: dw: switch to use SUSV4 error codes
2025-06-25 13:09 [PATCH 0/3] i3c: switch to use SUSV4 error codes Wolfram Sang
2025-06-25 13:09 ` [PATCH 1/3] i3c: core: " Wolfram Sang
@ 2025-06-25 13:09 ` Wolfram Sang
2025-06-25 13:09 ` [PATCH 3/3] i3c: cdns: " Wolfram Sang
2 siblings, 0 replies; 7+ messages in thread
From: Wolfram Sang @ 2025-06-25 13:09 UTC (permalink / raw)
To: linux-renesas-soc; +Cc: Wolfram Sang, Alexandre Belloni, Frank Li, linux-i3c
This checkpatch warning makes sense here: "ENOTSUPP is not a SUSV4 error
code, prefer EOPNOTSUPP" We don't have a userspace interface yet, but we
probably will get one. So, let's convert these error codes now, before
it will be forgotten in the future, and they could slip through to
applications.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
drivers/i3c/master/dw-i3c-master.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/i3c/master/dw-i3c-master.c b/drivers/i3c/master/dw-i3c-master.c
index 611c22b72c15..91429d94a866 100644
--- a/drivers/i3c/master/dw-i3c-master.c
+++ b/drivers/i3c/master/dw-i3c-master.c
@@ -932,7 +932,7 @@ static int dw_i3c_master_priv_xfers(struct i3c_dev_desc *dev,
return 0;
if (i3c_nxfers > master->caps.cmdfifodepth)
- return -ENOTSUPP;
+ return -EOPNOTSUPP;
for (i = 0; i < i3c_nxfers; i++) {
if (i3c_xfers[i].rnw)
@@ -943,7 +943,7 @@ static int dw_i3c_master_priv_xfers(struct i3c_dev_desc *dev,
if (ntxwords > master->caps.datafifodepth ||
nrxwords > master->caps.datafifodepth)
- return -ENOTSUPP;
+ return -EOPNOTSUPP;
xfer = dw_i3c_master_alloc_xfer(master, i3c_nxfers);
if (!xfer)
@@ -1093,7 +1093,7 @@ static int dw_i3c_master_i2c_xfers(struct i2c_dev_desc *dev,
return 0;
if (i2c_nxfers > master->caps.cmdfifodepth)
- return -ENOTSUPP;
+ return -EOPNOTSUPP;
for (i = 0; i < i2c_nxfers; i++) {
if (i2c_xfers[i].flags & I2C_M_RD)
@@ -1104,7 +1104,7 @@ static int dw_i3c_master_i2c_xfers(struct i2c_dev_desc *dev,
if (ntxwords > master->caps.datafifodepth ||
nrxwords > master->caps.datafifodepth)
- return -ENOTSUPP;
+ return -EOPNOTSUPP;
xfer = dw_i3c_master_alloc_xfer(master, i2c_nxfers);
if (!xfer)
--
2.47.2
--
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/3] i3c: cdns: switch to use SUSV4 error codes
2025-06-25 13:09 [PATCH 0/3] i3c: switch to use SUSV4 error codes Wolfram Sang
2025-06-25 13:09 ` [PATCH 1/3] i3c: core: " Wolfram Sang
2025-06-25 13:09 ` [PATCH 2/3] i3c: dw: " Wolfram Sang
@ 2025-06-25 13:09 ` Wolfram Sang
2 siblings, 0 replies; 7+ messages in thread
From: Wolfram Sang @ 2025-06-25 13:09 UTC (permalink / raw)
To: linux-renesas-soc
Cc: Wolfram Sang, Przemysław Gaj, Alexandre Belloni, Frank Li,
linux-i3c
This checkpatch warning makes sense here: "ENOTSUPP is not a SUSV4 error
code, prefer EOPNOTSUPP" We don't have a userspace interface yet, but we
probably will get one. So, let's convert these error codes now, before
it will be forgotten in the future, and they could slip through to
applications.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
drivers/i3c/master/i3c-master-cdns.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/i3c/master/i3c-master-cdns.c b/drivers/i3c/master/i3c-master-cdns.c
index fd3752cea654..e24d93a82e1c 100644
--- a/drivers/i3c/master/i3c-master-cdns.c
+++ b/drivers/i3c/master/i3c-master-cdns.c
@@ -742,7 +742,7 @@ static int cdns_i3c_master_priv_xfers(struct i3c_dev_desc *dev,
for (i = 0; i < nxfers; i++) {
if (xfers[i].len > CMD0_FIFO_PL_LEN_MAX)
- return -ENOTSUPP;
+ return -EOPNOTSUPP;
}
if (!nxfers)
@@ -750,7 +750,7 @@ static int cdns_i3c_master_priv_xfers(struct i3c_dev_desc *dev,
if (nxfers > master->caps.cmdfifodepth ||
nxfers > master->caps.cmdrfifodepth)
- return -ENOTSUPP;
+ return -EOPNOTSUPP;
/*
* First make sure that all transactions (block of transfers separated
@@ -765,7 +765,7 @@ static int cdns_i3c_master_priv_xfers(struct i3c_dev_desc *dev,
if (rxslots > master->caps.rxfifodepth ||
txslots > master->caps.txfifodepth)
- return -ENOTSUPP;
+ return -EOPNOTSUPP;
cdns_xfer = cdns_i3c_master_alloc_xfer(master, nxfers);
if (!cdns_xfer)
@@ -822,11 +822,11 @@ static int cdns_i3c_master_i2c_xfers(struct i2c_dev_desc *dev,
int i, ret = 0;
if (nxfers > master->caps.cmdfifodepth)
- return -ENOTSUPP;
+ return -EOPNOTSUPP;
for (i = 0; i < nxfers; i++) {
if (xfers[i].len > CMD0_FIFO_PL_LEN_MAX)
- return -ENOTSUPP;
+ return -EOPNOTSUPP;
if (xfers[i].flags & I2C_M_RD)
nrxwords += DIV_ROUND_UP(xfers[i].len, 4);
@@ -836,7 +836,7 @@ static int cdns_i3c_master_i2c_xfers(struct i2c_dev_desc *dev,
if (ntxwords > master->caps.txfifodepth ||
nrxwords > master->caps.rxfifodepth)
- return -ENOTSUPP;
+ return -EOPNOTSUPP;
xfer = cdns_i3c_master_alloc_xfer(master, nxfers);
if (!xfer)
--
2.47.2
--
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 1/3] i3c: core: switch to use SUSV4 error codes
2025-06-25 13:09 ` [PATCH 1/3] i3c: core: " Wolfram Sang
@ 2025-06-25 20:30 ` Frank Li
2025-06-26 9:11 ` Wolfram Sang
0 siblings, 1 reply; 7+ messages in thread
From: Frank Li @ 2025-06-25 20:30 UTC (permalink / raw)
To: Wolfram Sang; +Cc: linux-renesas-soc, Alexandre Belloni, linux-i3c
On Wed, Jun 25, 2025 at 03:09:19PM +0200, Wolfram Sang wrote:
> This checkpatch warning makes sense here: "ENOTSUPP is not a SUSV4 error
> code, prefer EOPNOTSUPP" We don't have a userspace interface yet, but we
> probably will get one. So, let's convert these error codes now, before
> it will be forgotten in the future, and they could slip through to
> applications.
I suggest the simple words should be enough.
i3c: core: replace ENOTSUPP with SUSV4-compliant EOPNOTSUPP
Replace non-standard ENOTSUPP with the SUSV4-defined error code EOPNOTSUPP
to fix below checkpatch warning:
"ENOTSUPP is not a SUSV4 error code, prefer EOPNOTSUPP"
Frank
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> ---
> drivers/i3c/master.c | 20 ++++++++++----------
> 1 file changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
> index e53c69d24873..354fef4a033c 100644
> --- a/drivers/i3c/master.c
> +++ b/drivers/i3c/master.c
> @@ -837,14 +837,14 @@ static int i3c_master_send_ccc_cmd_locked(struct i3c_master_controller *master,
> return -EINVAL;
>
> if (!master->ops->send_ccc_cmd)
> - return -ENOTSUPP;
> + return -EOPNOTSUPP;
>
> if ((cmd->id & I3C_CCC_DIRECT) && (!cmd->dests || !cmd->ndests))
> return -EINVAL;
>
> if (master->ops->supports_ccc_cmd &&
> !master->ops->supports_ccc_cmd(master, cmd))
> - return -ENOTSUPP;
> + return -EOPNOTSUPP;
>
> ret = master->ops->send_ccc_cmd(master, cmd);
> if (ret) {
> @@ -1439,7 +1439,7 @@ static int i3c_master_retrieve_dev_info(struct i3c_dev_desc *dev)
>
> if (dev->info.bcr & I3C_BCR_HDR_CAP) {
> ret = i3c_master_gethdrcap_locked(master, &dev->info);
> - if (ret && ret != -ENOTSUPP)
> + if (ret && ret != -EOPNOTSUPP)
> return ret;
> }
>
> @@ -2210,7 +2210,7 @@ of_i3c_master_add_i2c_boardinfo(struct i3c_master_controller *master,
> */
> if (boardinfo->base.flags & I2C_CLIENT_TEN) {
> dev_err(dev, "I2C device with 10 bit address not supported.");
> - return -ENOTSUPP;
> + return -EOPNOTSUPP;
> }
>
> /* LVR is encoded in reg[2]. */
> @@ -2340,13 +2340,13 @@ static int i3c_master_i2c_adapter_xfer(struct i2c_adapter *adap,
> return -EINVAL;
>
> if (!master->ops->i2c_xfers)
> - return -ENOTSUPP;
> + return -EOPNOTSUPP;
>
> /* Doing transfers to different devices is not supported. */
> addr = xfers[0].addr;
> for (i = 1; i < nxfers; i++) {
> if (addr != xfers[i].addr)
> - return -ENOTSUPP;
> + return -EOPNOTSUPP;
> }
>
> i3c_bus_normaluse_lock(&master->bus);
> @@ -2766,7 +2766,7 @@ static int i3c_master_check_ops(const struct i3c_master_controller_ops *ops)
> * controller)
> * @ops: the master controller operations
> * @secondary: true if you are registering a secondary master. Will return
> - * -ENOTSUPP if set to true since secondary masters are not yet
> + * -EOPNOTSUPP if set to true since secondary masters are not yet
> * supported
> *
> * This function takes care of everything for you:
> @@ -2793,7 +2793,7 @@ int i3c_master_register(struct i3c_master_controller *master,
>
> /* We do not support secondary masters yet. */
> if (secondary)
> - return -ENOTSUPP;
> + return -EOPNOTSUPP;
>
> ret = i3c_master_check_ops(ops);
> if (ret)
> @@ -2954,7 +2954,7 @@ int i3c_dev_do_priv_xfers_locked(struct i3c_dev_desc *dev,
> return -EINVAL;
>
> if (!master->ops->priv_xfers)
> - return -ENOTSUPP;
> + return -EOPNOTSUPP;
>
> return master->ops->priv_xfers(dev, xfers, nxfers);
> }
> @@ -3004,7 +3004,7 @@ int i3c_dev_request_ibi_locked(struct i3c_dev_desc *dev,
> int ret;
>
> if (!master->ops->request_ibi)
> - return -ENOTSUPP;
> + return -EOPNOTSUPP;
>
> if (dev->ibi)
> return -EBUSY;
> --
> 2.47.2
>
--
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/3] i3c: core: switch to use SUSV4 error codes
2025-06-25 20:30 ` Frank Li
@ 2025-06-26 9:11 ` Wolfram Sang
2025-06-26 16:00 ` Frank Li
0 siblings, 1 reply; 7+ messages in thread
From: Wolfram Sang @ 2025-06-26 9:11 UTC (permalink / raw)
To: Frank Li; +Cc: linux-renesas-soc, Alexandre Belloni, linux-i3c
On Wed, Jun 25, 2025 at 04:30:36PM -0400, Frank Li wrote:
> On Wed, Jun 25, 2025 at 03:09:19PM +0200, Wolfram Sang wrote:
> > This checkpatch warning makes sense here: "ENOTSUPP is not a SUSV4 error
> > code, prefer EOPNOTSUPP" We don't have a userspace interface yet, but we
> > probably will get one. So, let's convert these error codes now, before
> > it will be forgotten in the future, and they could slip through to
> > applications.
>
> I suggest the simple words should be enough.
>
> i3c: core: replace ENOTSUPP with SUSV4-compliant EOPNOTSUPP
>
> Replace non-standard ENOTSUPP with the SUSV4-defined error code EOPNOTSUPP
> to fix below checkpatch warning:
> "ENOTSUPP is not a SUSV4 error code, prefer EOPNOTSUPP"
Can do so, if you really want, but "to fix checkpatch warning" is
usually a not-so-good commit description. The above text tells WHY
checkpatch issues the warning and why we should care. However, I can
probably simplify the wording a little.
--
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/3] i3c: core: switch to use SUSV4 error codes
2025-06-26 9:11 ` Wolfram Sang
@ 2025-06-26 16:00 ` Frank Li
0 siblings, 0 replies; 7+ messages in thread
From: Frank Li @ 2025-06-26 16:00 UTC (permalink / raw)
To: Wolfram Sang; +Cc: linux-renesas-soc, Alexandre Belloni, linux-i3c
On Thu, Jun 26, 2025 at 11:11:24AM +0200, Wolfram Sang wrote:
> On Wed, Jun 25, 2025 at 04:30:36PM -0400, Frank Li wrote:
> > On Wed, Jun 25, 2025 at 03:09:19PM +0200, Wolfram Sang wrote:
> > > This checkpatch warning makes sense here: "ENOTSUPP is not a SUSV4 error
> > > code, prefer EOPNOTSUPP" We don't have a userspace interface yet, but we
> > > probably will get one. So, let's convert these error codes now, before
> > > it will be forgotten in the future, and they could slip through to
> > > applications.
> >
> > I suggest the simple words should be enough.
> >
> > i3c: core: replace ENOTSUPP with SUSV4-compliant EOPNOTSUPP
> >
> > Replace non-standard ENOTSUPP with the SUSV4-defined error code EOPNOTSUPP
> > to fix below checkpatch warning:
> > "ENOTSUPP is not a SUSV4 error code, prefer EOPNOTSUPP"
>
> Can do so, if you really want, but "to fix checkpatch warning" is
> usually a not-so-good commit description.
The error message "ENOTSUPP is not a SUSV4 error code, prefer EOPNOTSUPP"
is straightforward enough.
Frank
> The above text tells WHY
> checkpatch issues the warning and why we should care. However, I can
> probably simplify the wording a little.
>
--
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2025-06-26 16:23 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-25 13:09 [PATCH 0/3] i3c: switch to use SUSV4 error codes Wolfram Sang
2025-06-25 13:09 ` [PATCH 1/3] i3c: core: " Wolfram Sang
2025-06-25 20:30 ` Frank Li
2025-06-26 9:11 ` Wolfram Sang
2025-06-26 16:00 ` Frank Li
2025-06-25 13:09 ` [PATCH 2/3] i3c: dw: " Wolfram Sang
2025-06-25 13:09 ` [PATCH 3/3] i3c: cdns: " Wolfram Sang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).