Skip to content

Commit 81ea9a0

Browse files
larsclausenbroonie
authored andcommitted
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>
1 parent 282152f commit 81ea9a0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/spi/spi-sn-f-ospi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ static int f_ospi_exec_op(struct spi_mem *mem, const struct spi_mem_op *op)
526526
static bool f_ospi_supports_op_width(struct spi_mem *mem,
527527
const struct spi_mem_op *op)
528528
{
529-
u8 width_available[] = { 0, 1, 2, 4, 8 };
529+
static const u8 width_available[] = { 0, 1, 2, 4, 8 };
530530
u8 width_op[] = { op->cmd.buswidth, op->addr.buswidth,
531531
op->dummy.buswidth, op->data.buswidth };
532532
bool is_match_found;

0 commit comments

Comments
 (0)