From a6f2c38891406bab48278530be878d0fa3fe7be9 Mon Sep 17 00:00:00 2001 From: Marc Hartmayer Date: Fri, 23 Sep 2022 16:56:01 +0000 Subject: [PATCH] zdump: constify `dfi_vmcoreinfo_get` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Caller of `dfi_vmcoreinfo_get` must not modify the returned value, therefore return a `const char *` value for `dfi_vmcoreinfo_get`. Signed-off-by: Marc Hartmayer Reviewed-by: Steffen Eiden Signed-off-by: Jan Höppner --- zdump/dfi_vmcoreinfo.c | 2 +- zdump/dfi_vmcoreinfo.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/zdump/dfi_vmcoreinfo.c b/zdump/dfi_vmcoreinfo.c index f76bd731..b62c995c 100644 --- a/zdump/dfi_vmcoreinfo.c +++ b/zdump/dfi_vmcoreinfo.c @@ -132,7 +132,7 @@ void dfi_vmcoreinfo_init(void) /* * Return vmcoreinfo data */ -char *dfi_vmcoreinfo_get(void) +const char *dfi_vmcoreinfo_get(void) { return l.vmcoreinfo; } diff --git a/zdump/dfi_vmcoreinfo.h b/zdump/dfi_vmcoreinfo.h index 6b29f526..3cffcd13 100644 --- a/zdump/dfi_vmcoreinfo.h +++ b/zdump/dfi_vmcoreinfo.h @@ -9,7 +9,7 @@ #define DFI_VMCOREINFO_H void dfi_vmcoreinfo_init(void); -char *dfi_vmcoreinfo_get(void); +const char *dfi_vmcoreinfo_get(void); int dfi_vmcoreinfo_tag(char *str, int len, const char *sym); int dfi_vmcoreinfo_symbol(unsigned long *val, const char *sym); int dfi_vmcoreinfo_offset(unsigned long *offs, const char *sym);