From 970554f90d188cf4a0f97a5fb9ab8210ee420e41 Mon Sep 17 00:00:00 2001 From: Paul Menzel Date: Mon, 6 Jun 2022 12:37:34 +0200 Subject: [PATCH] vc/amd/agesa/f15tn: Declare `value` as constant in `GnbRegisterWriteTNDump()` Do not discard the const qualifier in `GnbRegisterWriteTNDump()` to fix the compiler warning below. CC libagesa/vendorcode/amd/agesa/f15tn/Proc/GNB/Modules/GnbInitTN/GnbRegisterAccTN.o In file included from src/vendorcode/amd/agesa/f15tn/Proc/GNB/Modules/GnbInitTN/GnbRegisterAccTN.c:53: src/vendorcode/amd/agesa/f15tn/Proc/GNB/Modules/GnbInitTN/GnbRegisterAccTN.c: In function 'GnbRegisterWriteTN': src/vendorcode/amd/agesa/f15tn/Proc/GNB/Modules/GnbInitTN/GnbRegisterAccTN.c:836:57: error: passing argument 3 of 'GnbRegisterWriteTNDump' discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers] 836 | GnbRegisterWriteTNDump (RegisterSpaceType, Address, Value); | ^~~~~ src/vendorcode/amd/agesa/f15tn/Proc/GNB/Common/Gnb.h:68:35: note: in definition of macro 'GNB_DEBUG_CODE' 68 | #define GNB_DEBUG_CODE(Code) Code | ^~~~ src/vendorcode/amd/agesa/f15tn/Proc/GNB/Modules/GnbInitTN/GnbRegisterAccTN.c:86:33: note: expected 'VOID *' {aka 'void *'} but argument is of type 'const VOID *' {aka 'const void *'} 86 | IN VOID *Value | ~~~~~~~~~~~~~~~~~~~~~^~~~~ CC libagesa/vendorcode/amd/agesa/f15tn/Proc/GNB/Modules/GnbInitTN/PcieComplexDataTN.o CC libagesa/vendorcode/amd/agesa/f15tn/Proc/GNB/Modules/GnbInitTN/PcieConfigTN.o CC libagesa/vendorcode/amd/agesa/f15tn/Proc/GNB/Modules/GnbInitTN/PcieEarlyInitTN.o CC libagesa/vendorcode/amd/agesa/f15tn/Proc/GNB/Modules/GnbInitTN/PcieEnvInitTN.o CC libagesa/vendorcode/amd/agesa/f15tn/Proc/GNB/Modules/GnbInitTN/PcieLibTN.o src/vendorcode/amd/agesa/f15tn/Proc/GNB/Modules/GnbInitTN/GnbRegisterAccTN.c: At top level: cc1: note: unrecognized command-line option '-Wno-pragma-pack' may have been intended to silence earlier diagnostics cc1: all warnings being treated as errors Found-by: gcc (Debian 11.3.0-3) 11.3.0 Change-Id: I2039cf66030030458bd247a31adc0621b9d033e6 Signed-off-by: Paul Menzel Reviewed-on: https://review.coreboot.org/c/coreboot/+/64989 Tested-by: build bot (Jenkins) Reviewed-by: Arthur Heymans --- .../agesa/f15tn/Proc/GNB/Modules/GnbInitTN/GnbRegisterAccTN.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vendorcode/amd/agesa/f15tn/Proc/GNB/Modules/GnbInitTN/GnbRegisterAccTN.c b/src/vendorcode/amd/agesa/f15tn/Proc/GNB/Modules/GnbInitTN/GnbRegisterAccTN.c index fa6dafd48c..3154254b0f 100644 --- a/src/vendorcode/amd/agesa/f15tn/Proc/GNB/Modules/GnbInitTN/GnbRegisterAccTN.c +++ b/src/vendorcode/amd/agesa/f15tn/Proc/GNB/Modules/GnbInitTN/GnbRegisterAccTN.c @@ -83,7 +83,7 @@ VOID GnbRegisterWriteTNDump ( IN UINT8 RegisterSpaceType, IN UINT32 Address, - IN VOID *Value + CONST IN VOID *Value ); AGESA_STATUS GnbRegisterReadServiceTN ( @@ -1265,7 +1265,7 @@ VOID GnbRegisterWriteTNDump ( IN UINT8 RegisterSpaceType, IN UINT32 Address, - IN VOID *Value + CONST IN VOID *Value ) { IDS_HDT_CONSOLE (NB_MISC, " R WRITE Space %s Address 0x%04x, Value 0x%04x\n",