From: Lars-Peter Clausen <lars@metafoo.de>
To: Mark Brown <broonie@kernel.org>
Cc: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>,
linux-spi@vger.kernel.org, Lars-Peter Clausen <lars@metafoo.de>
Subject: [PATCH 3/3] spi: spi-sn-f-ospi: Make read-only array `width_available` static const
Date: Sun, 28 May 2023 12:58:30 -0700 [thread overview]
Message-ID: <20230528195830.164669-3-lars@metafoo.de> (raw)
In-Reply-To: <20230528195830.164669-1-lars@metafoo.de>
The `width_available` array is currently placed on the
`f_ospi_supports_op_width()` function's stack.
But the array is never modified. Make it `static const`. This makes the
code slightly smaller and more efficient.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
drivers/spi/spi-sn-f-ospi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/spi/spi-sn-f-ospi.c b/drivers/spi/spi-sn-f-ospi.c
index 691b6092fb3f..d64d3f75c726 100644
--- a/drivers/spi/spi-sn-f-ospi.c
+++ b/drivers/spi/spi-sn-f-ospi.c
@@ -526,7 +526,7 @@ static int f_ospi_exec_op(struct spi_mem *mem, const struct spi_mem_op *op)
static bool f_ospi_supports_op_width(struct spi_mem *mem,
const struct spi_mem_op *op)
{
- u8 width_available[] = { 0, 1, 2, 4, 8 };
+ static const u8 width_available[] = { 0, 1, 2, 4, 8 };
u8 width_op[] = { op->cmd.buswidth, op->addr.buswidth,
op->dummy.buswidth, op->data.buswidth };
bool is_match_found;
--
2.30.2
next prev parent reply other threads:[~2023-05-28 19:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-28 19:58 [PATCH 1/3] spi: spi-sn-f-ospi: Use devm_clk_get_enabled() Lars-Peter Clausen
2023-05-28 19:58 ` [PATCH 2/3] spi: spi-sn-f-ospi: Use min_t instead of opencoding it Lars-Peter Clausen
2023-05-28 19:58 ` Lars-Peter Clausen [this message]
2023-05-30 17:40 ` [PATCH 1/3] spi: spi-sn-f-ospi: Use devm_clk_get_enabled() Mark Brown
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=20230528195830.164669-3-lars@metafoo.de \
--to=lars@metafoo.de \
--cc=broonie@kernel.org \
--cc=hayashi.kunihiko@socionext.com \
--cc=linux-spi@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).