We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 69d54ee commit c8340acCopy full SHA for c8340ac
drivers/spi/spi-axi-spi-engine.c
@@ -75,7 +75,7 @@
75
76
struct spi_engine_program {
77
unsigned int length;
78
- uint16_t instructions[];
+ uint16_t instructions[] __counted_by(length);
79
};
80
81
/**
@@ -115,9 +115,10 @@ struct spi_engine {
115
static void spi_engine_program_add_cmd(struct spi_engine_program *p,
116
bool dry, uint16_t cmd)
117
{
118
- if (!dry)
119
- p->instructions[p->length] = cmd;
120
p->length++;
+
+ if (!dry)
121
+ p->instructions[p->length - 1] = cmd;
122
}
123
124
static unsigned int spi_engine_get_config(struct spi_device *spi)
0 commit comments