Re: [PATCH v5 2/3] tpm: enhance read_log_of() to support Physical TPM event log

From: Jarkko Sakkinen
Date: Thu Nov 24 2016 - 16:07:57 EST


On Wed, Nov 23, 2016 at 12:27:36PM -0500, Nayna Jain wrote:
> - memcpy(log->bios_event_log, __va(*basep), *sizep);
> + if (of_property_match_string(np, "compatible", "IBM,vtpm") < 0)
> + memcpy(chip->log.bios_event_log, __va(be64_to_cpup(basep)),
> + log_size);
> + else
> + memcpy(chip->log.bios_event_log, __va(*basep), log_size);


This does not look good. You should be able rearrange your code in a way
that you only have only one memcpy call.

/Jarkko