[PATCH v2 2/2] arm: mach-snapdrgon: misc: Simplify msm_generate_mac_addr()

Tom Rini trini at konsulko.com
Fri Sep 3 00:41:37 CEST 2021


On Tue, Aug 03, 2021 at 12:12:38PM +0200, Stephan Gerhold wrote:

> The logic in msm_generate_mac_addr() was originally taken from the LK
> bootloader where the serial number is a string and must be parsed first.
> However, in U-Boot msm_board_serial() returns an u32 and
> msm_generate_mac_addr() has quite complicated code that will first
> print it as a hex string and then immediately parse it again.
> 
> What this function actually does at the end is to put the serial number
> encoded as big endian (the order used for the hex string) into the u8 *mac.
> Use put_unaligned_be32() to do that with bit shifts instead of going
> through the string format.
> 
> This should be slightly more efficient and cleaner but does not result
> in any functional difference.
> 
> Cc: Ramon Fried <rfried.dev at gmail.com>
> Signed-off-by: Stephan Gerhold <stephan at gerhold.net>
> Reviewed-by: Ramon Fried <rfried.dev at gmail.com>

Applied to u-boot/next, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210902/d807355f/attachment.sig>


More information about the U-Boot mailing list