]> git.karo-electronics.de Git - karo-tx-linux.git/commit
dmi_scan: refactor dmi_scan_machine(), {smbios,dmi}_present()
authorBen Hutchings <ben@decadent.org.uk>
Sun, 10 Mar 2013 10:54:54 +0000 (21:54 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 12 Mar 2013 03:56:35 +0000 (14:56 +1100)
commit94a5c45d3de54e2f1750cb7625f33ab2df2be8fb
treed9dd0ae958105651853e542cb099c46bca4dc3ca
parent8138deb872fb39b20b236929dbdf9ac0df609b04
dmi_scan: refactor dmi_scan_machine(), {smbios,dmi}_present()

Move the calls to memcpy_fromio() up into the loop in dmi_scan_machine(),
and move the signature checks back down into dmi_decode().  We need to
check at 16-byte intervals but keep a 32-byte buffer for an SMBIOS entry,
so shift the buffer after each iteration.

Merge smbios_present() into dmi_present(), so we look for an SMBIOS
signature at the beginning of the given buffer and then for a DMI
signature at an offset of 16 bytes.

Reported-by: Tim McGrath <tmhikaru@gmail.com>
Tested-by: Tim Mcgrath <tmhikaru@gmail.com>
Cc: Zhenzhong Duan <zhenzhong.duan@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/firmware/dmi_scan.c