infra: comply to ISO C90

block/mars/kernel/sy_old/sy_generic.c:3164:2: warning: ISO C90 forbids variable length array ‘paths’ [-Wvla]
This commit is contained in:
Thomas Schoebel-Theuer 2021-01-29 10:16:51 +01:00 committed by Thomas Schoebel-Theuer
parent bb6506476f
commit 2bf49d5a64
1 changed files with 10 additions and 2 deletions

View File

@ -3142,6 +3142,8 @@ EXPORT_SYMBOL_GPL(_aio_brick_type);
const struct generic_brick_type *_sio_brick_type = NULL; const struct generic_brick_type *_sio_brick_type = NULL;
EXPORT_SYMBOL_GPL(_sio_brick_type); EXPORT_SYMBOL_GPL(_sio_brick_type);
#define MAX_PREV_COUNT 8
struct mars_brick *make_brick_all( struct mars_brick *make_brick_all(
struct mars_global *global, struct mars_global *global,
struct mars_dent *belongs, struct mars_dent *belongs,
@ -3161,12 +3163,18 @@ struct mars_brick *make_brick_all(
const char *new_path; const char *new_path;
char *_new_path = NULL; char *_new_path = NULL;
struct mars_brick *brick = NULL; struct mars_brick *brick = NULL;
char *paths[prev_count + 1]; char *paths[MAX_PREV_COUNT];
struct mars_brick *prev[prev_count + 1]; struct mars_brick *prev[MAX_PREV_COUNT];
bool switch_state; bool switch_state;
int i; int i;
int status; int status;
if (prev_count >= MAX_PREV_COUNT) {
MARS_ERR("internal: prev_count=%d too high!\n",
prev_count);
goto err;
}
// treat variable arguments // treat variable arguments
va_start(args, prev_count); va_start(args, prev_count);
if (new_fmt) { if (new_fmt) {