summaryrefslogtreecommitdiff
path: root/drivers/scsi/aic7xxx/aic7xxx_core.c
diff options
context:
space:
mode:
authorStephen Kitt <steve@sk2.org>2018-03-08 23:51:58 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2018-03-15 07:34:26 +0300
commit88b13609afca8ed2992c107c15326b4a8142e5da (patch)
tree1e570649c35ec871aff5127214a309c82bb4f634 /drivers/scsi/aic7xxx/aic7xxx_core.c
parent2e8c3002e350f4aa6b1c4c9d5a0409926e6eb556 (diff)
downloadlinux-88b13609afca8ed2992c107c15326b4a8142e5da.tar.xz
scsi: aic7xxx: aic79xx: remove VLAs
In preparation to enabling -Wvla, remove VLAs and replace them with fixed-length arrays instead. The arrays fixed here, using the number of constant sections, aren't really VLAs, but they appear so to the compiler. Replace the array sizes with a pre-processor-level constant instead using ARRAY_SIZE. This was prompted by https://lkml.org/lkml/2018/3/7/621 Signed-off-by: Stephen Kitt <steve@sk2.org> Reviewed-by: Kees Cook <keescook@chromium.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/aic7xxx/aic7xxx_core.c')
-rw-r--r--drivers/scsi/aic7xxx/aic7xxx_core.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/scsi/aic7xxx/aic7xxx_core.c b/drivers/scsi/aic7xxx/aic7xxx_core.c
index 6612ff3b2e83..e97eceacf522 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_core.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_core.c
@@ -6848,9 +6848,9 @@ ahc_dumpseq(struct ahc_softc* ahc)
static int
ahc_loadseq(struct ahc_softc *ahc)
{
- struct cs cs_table[num_critical_sections];
- u_int begin_set[num_critical_sections];
- u_int end_set[num_critical_sections];
+ struct cs cs_table[NUM_CRITICAL_SECTIONS];
+ u_int begin_set[NUM_CRITICAL_SECTIONS];
+ u_int end_set[NUM_CRITICAL_SECTIONS];
const struct patch *cur_patch;
u_int cs_count;
u_int cur_cs;
@@ -6915,7 +6915,7 @@ ahc_loadseq(struct ahc_softc *ahc)
* Move through the CS table until we find a CS
* that might apply to this instruction.
*/
- for (; cur_cs < num_critical_sections; cur_cs++) {
+ for (; cur_cs < NUM_CRITICAL_SECTIONS; cur_cs++) {
if (critical_sections[cur_cs].end <= i) {
if (begin_set[cs_count] == TRUE
&& end_set[cs_count] == FALSE) {