Re: [PATCH v2] x86/CPU/AMD: use default_groups in kobj_type

From: Yazen Ghannam
Date: Mon Jan 17 2022 - 16:52:50 EST


On Thu, Jan 06, 2022 at 11:35:37AM +0100, Greg Kroah-Hartman wrote:
> There are currently 2 ways to create a set of sysfs files for a
> kobj_type, through the default_attrs field, and the default_groups
> field. Move the AMD mce sysfs code to use default_groups field which
> has been the preferred way since aa30f47cf666 ("kobject: Add support for
> default attribute groups to kobj_type") so that we can soon get rid of
> the obsolete default_attrs field.
>
> Cc: Tony Luck <tony.luck@xxxxxxxxx>
> Cc: Borislav Petkov <bp@xxxxxxxxx>
> Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
> Cc: Ingo Molnar <mingo@xxxxxxxxxx>
> Cc: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>
> Cc: x86@xxxxxxxxxx
> Cc: "H. Peter Anvin" <hpa@xxxxxxxxx>
> Cc: linux-edac@xxxxxxxxxxxxxxx
> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

Tested-by: Yazen Ghannam <yazen.ghannam@xxxxxxx>

> ---
> v2: fix up direct pointers through the kobj_type to the default_attrs
> The logic here still isn't all that nice, ideally the is_visible()
> callback for the attribute group should be used instead as that is
> what it is for.
>

I'll check that out. Thanks!

-Yazen