efi: Introduce efi_md_typeattr_format()
authorLaszlo Ersek <lersek@redhat.com>
Wed, 3 Sep 2014 11:32:20 +0000 (13:32 +0200)
committerMatt Fleming <matt.fleming@intel.com>
Fri, 3 Oct 2014 17:41:00 +0000 (18:41 +0100)
commit98d2a6ca14520904a47c46258d3bad02ffcd3f96
tree2e99450987824c4e55c3e8c52365ccf28f722aae
parent9c97e0bdd4b4ae44577a1b1ec949e782084e9a78
efi: Introduce efi_md_typeattr_format()

At the moment, there are three architectures debug-printing the EFI memory
map at initialization: x86, ia64, and arm64. They all use different format
strings, plus the EFI memory type and the EFI memory attributes are
similarly hard to decode for a human reader.

Introduce a helper __init function that formats the memory type and the
memory attributes in a unified way, to a user-provided character buffer.

The array "memory_type_name" is copied from the arm64 code, temporarily
duplicating it. The (otherwise optional) braces around each string literal
in the initializer list are dropped in order to match the kernel coding
style more closely. The element size is tightened from 32 to 20 bytes
(maximum actual string length + 1) so that we can derive the field width
from the element size.

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
[ Dropped useless 'register' keyword, which compiler will ignore ]
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
drivers/firmware/efi/efi.c
include/linux/efi.h
This page took 0.025369 seconds and 5 git commands to generate.