Felix Held has submitted this change. ( https://review.coreboot.org/c/coreboot/+/83412?usp=email )
Change subject: amdfwtool: make fields unsigned ......................................................................
amdfwtool: make fields unsigned
The value stored in `gen` is only ever `1` or `0`. Storing `1` causes Clang to warn, since the only valid values for a 1-bit int are -1 and 0: ``` amdfwtool.c:1487:27: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion] 1487 | amd_romsig->efs_gen.gen = EFS_BEFORE_SECOND_GEN; ```
TEST=Rebuilt coreboot; no warning was emitted.
Change-Id: Ibd83be8302e8a717db7e7dc86a403b5648976586 Signed-off-by: George Burgess IV gbiv@google.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/83412 Reviewed-by: Felix Held felix-coreboot@felixheld.de Reviewed-by: Matt DeVillier matt.devillier@gmail.com Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Raul Rangel rrangel@chromium.org --- M util/amdfwtool/amdfwtool.h 1 file changed, 2 insertions(+), 2 deletions(-)
Approvals: build bot (Jenkins): Verified Felix Held: Looks good to me, approved Raul Rangel: Looks good to me, approved Matt DeVillier: Looks good to me, but someone else must approve
diff --git a/util/amdfwtool/amdfwtool.h b/util/amdfwtool/amdfwtool.h index 1dc445c..b2fd2c0 100644 --- a/util/amdfwtool/amdfwtool.h +++ b/util/amdfwtool/amdfwtool.h @@ -143,8 +143,8 @@ } amd_addr_mode;
struct second_gen_efs { /* todo: expand for Server products */ - int gen:1; /* Client products only use bit 0 */ - int reserved:31; + uint32_t gen:1; /* Client products only use bit 0 */ + uint32_t reserved:31; } __attribute__((packed));
#define EFS_SECOND_GEN 0