Re: [PATCH v4 05/12] efi: export more efi table variable to sysfs

From: Borislav Petkov
Date: Tue Nov 26 2013 - 03:50:51 EST


On Tue, Nov 26, 2013 at 01:57:50PM +0800, Dave Young wrote:
> diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c
> index 2e2fbde..5d85956 100644
> --- a/drivers/firmware/efi/efi.c
> +++ b/drivers/firmware/efi/efi.c
> @@ -32,6 +32,9 @@ struct efi __read_mostly efi = {
> .hcdp = EFI_INVALID_TABLE_ADDR,
> .uga = EFI_INVALID_TABLE_ADDR,
> .uv_systab = EFI_INVALID_TABLE_ADDR,
> + .fw_vendor = EFI_INVALID_TABLE_ADDR,
> + .runtime = EFI_INVALID_TABLE_ADDR,
> + .config_table = EFI_INVALID_TABLE_ADDR,

See what I mean with alignment?

Now this config_table thing sticks out and completely destroys the
balance in the universe.

:-)

> };
> EXPORT_SYMBOL(efi);
>
> @@ -71,13 +74,54 @@ static ssize_t systab_show(struct kobject *kobj,
> static struct kobj_attribute efi_attr_systab =
> __ATTR(systab, 0400, systab_show, NULL);
>
> +static ssize_t fw_vendor_show(struct kobject *kobj,
> + struct kobj_attribute *attr, char *buf)
> +{
> + return sprintf(buf, "0x%lx\n", efi.fw_vendor);
> +}
> +
> +static ssize_t runtime_show(struct kobject *kobj,
> + struct kobj_attribute *attr, char *buf)
> +{
> + return sprintf(buf, "0x%lx\n", efi.runtime);
> +}
> +
> +static ssize_t config_table_show(struct kobject *kobj,
> + struct kobj_attribute *attr, char *buf)
> +{
> + return sprintf(buf, "0x%lx\n", efi.config_table);
> +}

Those are sooo similar, it's like the macro SHOW writes itself.

--
Regards/Gruss,
Boris.

Sent from a fat crate under my desk. Formatting is fine.
--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/