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

From: Dave Young
Date: Tue Nov 26 2013 - 04:14:24 EST


On 11/26/13 at 09:50am, Borislav Petkov wrote:
> 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?

Yes, I see. As for this segment I would not like change the previous code
just because of this reason

>
> 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.

Ok, will add a macro for the above functions..

Thanks for review
Dave
--
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/