From: Josh Law <hlcj1234567@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Ovidiu Panait <ovidiu.panait.oss@gmail.com>
Cc: Gabriel Shahrouzi <gshahrouzi@gmail.com>,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
Josh Law <objecting@objecting.org>
Subject: [PATCH v2 10/10] staging: axis-fifo: simplify error returns in axis_fifo_parse_dt()
Date: Sun, 1 Mar 2026 21:48:15 +0000 [thread overview]
Message-ID: <20260301214815.2628942-10-objecting@objecting.org> (raw)
In-Reply-To: <20260301214815.2628942-1-objecting@objecting.org>
From: Josh Law <objecting@objecting.org>
Replace redundant 'ret = -EIO; return ret;' patterns with direct
'return -EIO;' statements, and change the final 'return ret;' to
'return 0;' since success is the only path that reaches it.
Signed-off-by: Josh Law <objecting@objecting.org>
---
drivers/staging/axis-fifo/axis-fifo.c | 20 +++++++-------------
1 file changed, 7 insertions(+), 13 deletions(-)
diff --git a/drivers/staging/axis-fifo/axis-fifo.c b/drivers/staging/axis-fifo/axis-fifo.c
index 7ca0404b0875..9aeb16d8a71f 100644
--- a/drivers/staging/axis-fifo/axis-fifo.c
+++ b/drivers/staging/axis-fifo/axis-fifo.c
@@ -403,8 +403,7 @@ static int axis_fifo_parse_dt(struct axis_fifo *fifo)
return ret;
} else if (value != 32) {
dev_err(fifo->dt_device, "xlnx,axi-str-rxd-tdata-width only supports 32 bits\n");
- ret = -EIO;
- return ret;
+ return -EIO;
}
ret = of_property_read_u32(node, "xlnx,axi-str-txd-tdata-width",
@@ -414,43 +413,38 @@ static int axis_fifo_parse_dt(struct axis_fifo *fifo)
return ret;
} else if (value != 32) {
dev_err(fifo->dt_device, "xlnx,axi-str-txd-tdata-width only supports 32 bits\n");
- ret = -EIO;
- return ret;
+ return -EIO;
}
ret = of_property_read_u32(node, "xlnx,rx-fifo-depth",
&fifo->rx_fifo_depth);
if (ret) {
dev_err(fifo->dt_device, "missing xlnx,rx-fifo-depth property\n");
- ret = -EIO;
- return ret;
+ return -EIO;
}
ret = of_property_read_u32(node, "xlnx,tx-fifo-depth",
&fifo->tx_fifo_depth);
if (ret) {
dev_err(fifo->dt_device, "missing xlnx,tx-fifo-depth property\n");
- ret = -EIO;
- return ret;
+ return -EIO;
}
ret = of_property_read_u32(node, "xlnx,use-rx-data",
&fifo->has_rx_fifo);
if (ret) {
dev_err(fifo->dt_device, "missing xlnx,use-rx-data property\n");
- ret = -EIO;
- return ret;
+ return -EIO;
}
ret = of_property_read_u32(node, "xlnx,use-tx-data",
&fifo->has_tx_fifo);
if (ret) {
dev_err(fifo->dt_device, "missing xlnx,use-tx-data property\n");
- ret = -EIO;
- return ret;
+ return -EIO;
}
- return ret;
+ return 0;
}
static int axis_fifo_probe(struct platform_device *pdev)
--
2.43.0
next prev parent reply other threads:[~2026-03-01 21:48 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-01 21:48 [PATCH v2 01/10] staging: axis-fifo: fix alignment and line length in wait_event_interruptible Josh Law
2026-03-01 21:48 ` [PATCH v2 02/10] staging: axis-fifo: remove redundant goto end Josh Law
2026-03-01 21:48 ` [PATCH v2 03/10] staging: axis-fifo: simplify resource mapping Josh Law
2026-03-01 21:48 ` [PATCH v2 04/10] staging: axis-fifo: use dev_err_probe() for IRQ error handling Josh Law
2026-03-01 21:48 ` [PATCH v2 05/10] staging: axis-fifo: improve IRQ handler Josh Law
2026-03-02 8:05 ` Dan Carpenter
2026-03-02 15:55 ` Josh Law
2026-03-03 6:10 ` Dan Carpenter
2026-03-03 7:02 ` Josh Law
2026-03-03 7:27 ` Dan Carpenter
2026-03-03 7:30 ` Josh Law
2026-03-03 7:46 ` Dan Carpenter
2026-03-03 6:58 ` Dan Carpenter
2026-03-01 21:48 ` [PATCH v2 06/10] staging: axis-fifo: minimize lock duration in write Josh Law
2026-03-01 21:48 ` [PATCH v2 07/10] staging: axis-fifo: fix grammar in Kconfig help text Josh Law
2026-03-01 21:48 ` [PATCH v2 08/10] staging: axis-fifo: use lowercase hex constant for consistency Josh Law
2026-03-01 21:48 ` [PATCH v2 09/10] staging: axis-fifo: remove unnecessary variable initializations Josh Law
2026-03-01 21:48 ` Josh Law [this message]
2026-03-02 8:14 ` [PATCH v2 01/10] staging: axis-fifo: fix alignment and line length in wait_event_interruptible Dan Carpenter
2026-03-02 8:42 ` Dan Carpenter
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=20260301214815.2628942-10-objecting@objecting.org \
--to=hlcj1234567@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=gshahrouzi@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=objecting@objecting.org \
--cc=ovidiu.panait.oss@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox