]> 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>
Tue, 26 Mar 2013 23:25:10 +0000 (10:25 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 4 Apr 2013 06:12:31 +0000 (17:12 +1100)
commit7ce79380d1c082fff51f8dd5f559fea97d20ff07
treeefa30e9863d128beea622f8c78353302fddb7692
parent0bbcf6534e38f3d1f1c0a71f1ab7e83db8866e93
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.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
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