[SeaBIOS] [PATCH 3/3] tpm: Add a menu for TPM configuration

Peter Stuge peter at stuge.se
Mon Nov 30 06:02:45 CET 2015


Stefan Berger wrote:
> +++ b/src/tcgbios.c
> +static u32
> +read_stclear_flags(char *buf, int buf_len)
> +{
..
> +    if (rc || returnCode)
> +        goto err_exit;
..
> +err_exit:
> +    dprintf(DEBUG_tcg, "TCGBIOS: TPM malfunctioning (line %d).\n", __LINE__);

I can't help but think that it would be significantly more useful to
turn the "goto err_exit" into a macro everywhere. Something like:

#define malfunc_err_exit() do { \
  dprintf(DEBUG_tcg, "TCGBIOS: TPM malfunctioning (line %d).\n", __LINE__); \
  goto err_exit; \
} while (0)

..so that the line number of the actual problem is output.


//Peter



More information about the SeaBIOS mailing list