Re: [PATCH 2/2] dmi_scan: Refactor dmi_scan_machine(),{smbios,dmi}_present()

From: tmhikaru
Date: Sun Feb 17 2013 - 01:56:08 EST


On Sat, Feb 16, 2013 at 06:02:22PM +0000, Ben Hutchings wrote:
> 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@xxxxxxxxxxxxxxx>
> ---
> This file mixes up __iomem and regular pointers a lot, and this patch
> fixes some but not all of those instances. Presumably it is quite
> safe to read a BIOS image with any mov instructions the compiler
> generates, but in that case maybe we should explicitly cast away the
> __iomem qualifier in dmi_ioremap()?
>
> Tim, you might like to test that this doesn't cause a regression
> of the previous fix.

I can confirm that this works just as well as the last patch you gave me.
I'm sorry that it took me a while to reply.

Tim McGrath

Attachment: pgp00000.pgp
Description: PGP signature