Kevin O'Connor wrote:
+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.
I find goto's out of macros to be confusing, so would prefer to avoid that.
Fine, there are other ways to accomplish the same thing.
If there is a desire to shrink the number of error messages
There is a desire to make error messages more useful. The original patch outputs the line number at the error label, ie. always the same line number for a function, regardless of what caused the error. My suggestion instead outputs the line number at/before the goto. I should also have added %s __func__ there. //Peter