Skip to content

Commit 9fa1abe

Browse files
Grolleau-BenjaminGrom-
authored andcommitted
[certificate] fix warning caused by single-use macro
1 parent 9684740 commit 9fa1abe

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

certificate/stse_certificate_subparsing.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -511,16 +511,14 @@ void stse_certificate_parse_extension(const PLAT_UI8 *ext, PLAT_UI32 *extFlags,
511511
tag = stse_certificate_identify_ASN1_TLV(next, &parsed, &seqSize, &next);
512512
/* It should start with a sequence */
513513
if (tag == TAG_BITSTRING) {
514-
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
515514
/* This reads the 8 bits (or less) and put it in the right place */
516-
for (i = 0; i < MAX((PLAT_I32)next[0], 8); i++) {
515+
for (i = 0; i < (((PLAT_I32)next[0] > 8) ? (PLAT_I32)next[0] : 8); i++) {
517516
/* Not very readable */
518517
*extFlags |= (((PLAT_UI32)next[1] >> (PLAT_UI8)(7U - (PLAT_UI8)i)) & 1U) << (PLAT_UI8)(16U + (PLAT_UI8)i);
519518
}
520519
if (next[0] == 9U && seqSize == 2) {
521520
*extFlags |= (((PLAT_UI32)next[2] >> 7) & 1U) << (15);
522521
}
523-
#undef MAX
524522
}
525523
}
526524
break;

0 commit comments

Comments
 (0)