diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2023-05-28 12:58:30 -0700 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2023-05-30 13:47:03 +0100 |
commit | 81ea9a0710bcf74934446f63898f0186aeb2b5b8 (patch) | |
tree | ce2c70e7ae47f66fe77ea48af8b4e0387e5abd96 /drivers/spi | |
parent | 282152fa9d54a84a486b93a913934c21503fb5db (diff) | |
download | linux-stable-81ea9a0710bcf74934446f63898f0186aeb2b5b8.tar.gz linux-stable-81ea9a0710bcf74934446f63898f0186aeb2b5b8.tar.bz2 linux-stable-81ea9a0710bcf74934446f63898f0186aeb2b5b8.zip |
spi: spi-sn-f-ospi: Make read-only array `width_available` static const
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>
Link: https://lore.kernel.org/r/20230528195830.164669-3-lars@metafoo.de
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r-- | drivers/spi/spi-sn-f-ospi.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; |