Re: [PATCH 1/4] kobject: Provide macros to initialize 'struct kobj_attribute'

From: Thomas Weißschuh

Date: Sat May 30 2026 - 06:38:30 EST


On 2026-05-29 18:43:22+0200, Thomas Weißschuh wrote:
(...)

> diff --git a/include/linux/kobject.h b/include/linux/kobject.h
> index bcb5d4e32001..975a5361fb60 100644
> --- a/include/linux/kobject.h
> +++ b/include/linux/kobject.h
> @@ -144,6 +144,28 @@ struct kobj_attribute {
> const char *buf, size_t count);
> };
>
> +#define __KOBJ_ATTR(_name, _mode, _show, _store) { \
> + .attr = { .name = __stringify(_name), \
> + .mode = VERIFY_OCTAL_PERMISSIONS(_mode) }, \
> + .show = _show, \
> + .store = _store, \
> +}
> +
> +#define __KOBJ_ATTR_RO_MODE(_name, _mode) { \
> + __KOBJ_ATTR(_name, _mode, _name##_show, NULL)

Sashiko correctly noticed the spurious '{' above.
Could you fix this when applying? Otherwise I'll fix it up for the next
revision, pending on your further feedback.


Thomas