Re: [PATCH] device_attributes: add sysfs_attr_init() for dynamicattributes

From: Dmitry Torokhov
Date: Mon Mar 22 2010 - 02:40:40 EST


Hi Wolfram,

On Mon, Mar 22, 2010 at 07:21:17AM +0100, Wolfram Sang wrote:
> Made necessary by 6992f5334995af474c2b58d010d08bc597f0f2fe.
>
> Found by this semantic patch:
>
> @ init @
> type T;
> identifier A;
> @@
>
> T {
> ...
> struct device_attribute A;
> ...
> };
>
> @ main extends init @
> expression E;
> statement S;
> identifier err;
> T *name;
> @@
>
> ... when != sysfs_attr_init(&name->A.attr);
> (
> + sysfs_attr_init(&name->A.attr);
> if (device_create_file(E, &name->A))
> S
> |
> + sysfs_attr_init(&name->A.attr);
> err = device_create_file(E, &name->A);
> )
>
> While reviewing, I put the initialization to apropriate places.
>

My standard question - are all of these need to be dynamically
allocated?

Thanks.

--
Dmitry
--
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/