backports: restrict group_attr spatch properly
authorJohannes Berg <johannes.berg@intel.com>
Mon, 6 Feb 2017 11:26:05 +0000 (12:26 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 7 Feb 2017 06:29:51 +0000 (07:29 +0100)
commit60d26f6a22d4aac8154b8fef48fbe8d6a1a1138a
treefb291f9f45d45e17dbebce0db88e7c9e1eed76dc
parent4d5c30521362ce258d152b45061a70b69a05305d
backports: restrict group_attr spatch properly

In cases where there are multiple instances of the ATTRIBUTE_GROUPS()
macro, or an instance thereof with a .dev_groups that doesn't actually
use it (like in devcoredump.c), the spatch wasn't correctly restricted
to make sure the two belong together, and thus made some completely
wrong modifications, linking an ATTRIBUTE_GROUPS() to a .dev_attrs it
didn't belong to at all.

Fix this by making sure that the ATTRIBUTE_GROUPS() instance and use
for .dev_groups match. This needs python indirection to create the
symbol name that ATTRIBUTE_GROUPS() creates in the C code.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
patches/collateral-evolutions/generic/0001-group-attr/0001-group_attr_class.cocci
patches/collateral-evolutions/generic/0001-group-attr/0002-group_attr_bus.cocci