[v2,1/3] dyndbg: constify opt_array

Message ID 20230709-dyndbg-filename-v2-1-fd83beef0925@weissschuh.net
State New
Headers
Series dyndbg: add source file name to prefix |

Commit Message

Thomas Weißschuh July 9, 2023, 9:17 p.m. UTC
  It is never modified, so mark it const.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
 lib/dynamic_debug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Luis Chamberlain July 10, 2023, 7:32 p.m. UTC | #1
On Sun, Jul 09, 2023 at 11:17:58PM +0200, Thomas Weißschuh wrote:
> It is never modified, so mark it const.
> 
> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>

Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>

  Luis
  

Patch

diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
index fdd6d9800a70..71b22d206a1b 100644
--- a/lib/dynamic_debug.c
+++ b/lib/dynamic_debug.c
@@ -88,7 +88,7 @@  static inline const char *trim_prefix(const char *path)
 	return path + skip;
 }
 
-static struct { unsigned flag:8; char opt_char; } opt_array[] = {
+static const struct { unsigned flag:8; char opt_char; } opt_array[] = {
 	{ _DPRINTK_FLAGS_PRINT, 'p' },
 	{ _DPRINTK_FLAGS_INCL_MODNAME, 'm' },
 	{ _DPRINTK_FLAGS_INCL_FUNCNAME, 'f' },