Re: [PATCH v2] nvmem: meson-mx-efuse: allow reading data smaller than word_size

From: Srinivas Kandagatla
Date: Tue Aug 06 2019 - 06:03:44 EST




On 27/07/2019 20:34, Martin Blumenstingl wrote:
Some Amlogic boards store the Ethernet MAC address inside the eFuse. The
Ethernet MAC address uses 6 bytes. The existing logic in
meson_mx_efuse_read() would write beyond the end of the data buffer when
trying to read data with a size that is not aligned to word_size (4
bytes on Meson8, Meson8b and Meson8m2).

Calculate the remaining data to copy inside meson_mx_efuse_read() so
reading 6 bytes doesn't write beyond the end of the data buffer.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@xxxxxxxxxxxxxx>
---

Applied Thanks,
Srini