From: Bart Van Assche Date: Sat, 10 Mar 2018 00:46:02 +0000 (-0800) Subject: Declare debug_levels[] const X-Git-Tag: fio-3.6~45 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=447931d99aff4dad5fabfafc3b96341d8143d90c Declare debug_levels[] const Since debug_levels[] is not modified by any code, declare it const. Signed-off-by: Bart Van Assche Signed-off-by: Jens Axboe --- diff --git a/debug.h b/debug.h index ac5f2ccd..b8718ddc 100644 --- a/debug.h +++ b/debug.h @@ -53,7 +53,7 @@ struct debug_level { unsigned long shift; unsigned int jobno; }; -extern struct debug_level debug_levels[]; +extern const struct debug_level debug_levels[]; extern unsigned long fio_debug; diff --git a/init.c b/init.c index 28061db8..bb0627b2 100644 --- a/init.c +++ b/init.c @@ -2094,7 +2094,7 @@ static int fill_def_thread(void) static void show_debug_categories(void) { #ifdef FIO_INC_DEBUG - struct debug_level *dl = &debug_levels[0]; + const struct debug_level *dl = &debug_levels[0]; int curlen, first = 1; curlen = 0; @@ -2184,7 +2184,7 @@ static void usage(const char *name) } #ifdef FIO_INC_DEBUG -struct debug_level debug_levels[] = { +const struct debug_level debug_levels[] = { { .name = "process", .help = "Process creation/exit logging", .shift = FD_PROCESS, @@ -2262,7 +2262,7 @@ struct debug_level debug_levels[] = { static int set_debug(const char *string) { - struct debug_level *dl; + const struct debug_level *dl; char *p = (char *) string; char *opt; int i;