Skip to content
Commit 79bae42d authored by Ben Hutchings's avatar Ben Hutchings Committed by Linus Torvalds
Browse files

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.

[artem.savkov@gmail.com: use proper buf type in dmi_present()]
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
Reported-by: default avatarTim McGrath <tmhikaru@gmail.com>
Tested-by: default avatarTim Mcgrath <tmhikaru@gmail.com>
Cc: Zhenzhong Duan <zhenzhong.duan@oracle.com>
Signed-off-by: default avatarArtem Savkov <artem.savkov@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent c1d025e2
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment