]> 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>
Wed, 20 Mar 2013 04:07:49 +0000 (15:07 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 22 Mar 2013 04:33:27 +0000 (15:33 +1100)
commitcbde4d72f5b4fd7bfd0243cf726ef8c50a3cff80
treeb195e68d3331c44fbd9239c94bf5ed05546a1c49
parenta7eaf8d383112974b72e8c6d47f8211709364930
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