* [PATCH 1/3] backports: devcoredump: make patch apply
@ 2017-02-06 12:39 Johannes Berg
2017-02-06 12:39 ` [PATCH 2/3] backports: restrict group_attr spatch properly Johannes Berg
2017-02-06 12:39 ` [PATCH 3/3] backports: support class_groups Johannes Berg
0 siblings, 2 replies; 6+ messages in thread
From: Johannes Berg @ 2017-02-06 12:39 UTC (permalink / raw)
To: backports; +Cc: Johannes Berg
From: Johannes Berg <johannes.berg@intel.com>
Just make the patch apply again - the next commits
will auto-generate the necessary backport code.
Change-Id: I2b25ccbaadf1d49b9fdd229b3eaf1ecb7a9cf9ce
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
patches/backport-adjustments/devcoredump.patch | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/patches/backport-adjustments/devcoredump.patch b/patches/backport-adjustments/devcoredump.patch
index b840adc145f7..315ffd57e3bf 100644
--- a/patches/backport-adjustments/devcoredump.patch
+++ b/patches/backport-adjustments/devcoredump.patch
@@ -62,7 +62,7 @@
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)
.dev_groups = devcd_dev_groups,
+#endif
- .class_attrs = devcd_class_attrs,
+ .class_groups = devcd_class_groups,
};
@@ -270,6 +281,11 @@ void dev_coredumpm(struct device *dev, s
--
2.9.3
--
To unsubscribe from this list: send the line "unsubscribe backports" in
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/3] backports: restrict group_attr spatch properly
2017-02-06 12:39 [PATCH 1/3] backports: devcoredump: make patch apply Johannes Berg
@ 2017-02-06 12:39 ` Johannes Berg
2017-02-06 22:22 ` Arend Van Spriel
2017-02-06 12:39 ` [PATCH 3/3] backports: support class_groups Johannes Berg
1 sibling, 1 reply; 6+ messages in thread
From: Johannes Berg @ 2017-02-06 12:39 UTC (permalink / raw)
To: backports; +Cc: Johannes Berg
From: Johannes Berg <johannes.berg@intel.com>
Change-Id: I8881dab783fe69a85f833c96f0a4abd3ab062e84
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
.../0001-group-attr/0001-group_attr_class.cocci | 18 ++++++++++++------
.../generic/0001-group-attr/0002-group_attr_bus.cocci | 19 ++++++++++++-------
2 files changed, 24 insertions(+), 13 deletions(-)
diff --git a/patches/collateral-evolutions/generic/0001-group-attr/0001-group_attr_class.cocci b/patches/collateral-evolutions/generic/0001-group-attr/0001-group_attr_class.cocci
index ea2e7039f50c..a9c84651eedc 100644
--- a/patches/collateral-evolutions/generic/0001-group-attr/0001-group_attr_class.cocci
+++ b/patches/collateral-evolutions/generic/0001-group-attr/0001-group_attr_class.cocci
@@ -33,9 +33,15 @@ declarer name ATTRIBUTE_GROUPS;
ATTRIBUTE_GROUPS(group);
-@ class_group depends on attribute_group @
+@script:python attribute_groups_name@
+group << attribute_group.group;
+groups;
+@@
+coccinelle.groups = group + "_groups"
+
+@ class_group @
identifier group_class;
-expression groups;
+identifier attribute_groups_name.groups;
fresh identifier group_dev_attr = attribute_group.group ## "_dev_attrs";
@@
@@ -47,9 +53,9 @@ struct class group_class = {
+#endif
};
-@ attribute_group_mod depends on attribute_group && class_group @
+@ attribute_group_mod depends on class_group @
declarer name ATTRIBUTE_GROUPS_BACKPORT;
-identifier group;
+identifier attribute_group.group;
@@
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)
@@ -59,10 +65,10 @@ ATTRIBUTE_GROUPS(group);
+ATTRIBUTE_GROUPS_BACKPORT(group);
+#endif
-@ class_registering depends on class_group && attribute_group_mod @
+@ class_registering @
identifier class_register, ret;
identifier class_group.group_class;
-fresh identifier group_class_init = "init_" ## attribute_group_mod.group ## "_attrs";
+fresh identifier group_class_init = "init_" ## attribute_group.group ## "_attrs";
@@
(
diff --git a/patches/collateral-evolutions/generic/0001-group-attr/0002-group_attr_bus.cocci b/patches/collateral-evolutions/generic/0001-group-attr/0002-group_attr_bus.cocci
index b01da875083b..c19e9d7f3eda 100644
--- a/patches/collateral-evolutions/generic/0001-group-attr/0002-group_attr_bus.cocci
+++ b/patches/collateral-evolutions/generic/0001-group-attr/0002-group_attr_bus.cocci
@@ -31,9 +31,15 @@ declarer name ATTRIBUTE_GROUPS;
ATTRIBUTE_GROUPS(group);
-@ bus_group depends on attribute_group @
+@script:python attribute_groups_name@
+group << attribute_group.group;
+groups;
+@@
+coccinelle.groups = group + "_groups"
+
+@ bus_group @
identifier group_bus;
-expression groups;
+identifier attribute_groups_name.groups;
fresh identifier group_dev_attr = attribute_group.group ## "_dev_attrs";
@@
@@ -45,9 +51,9 @@ struct bus_type group_bus = {
+#endif
};
-@ attribute_group_mod depends on attribute_group && bus_group @
+@ attribute_group_mod depends on bus_group @
declarer name ATTRIBUTE_GROUPS_BACKPORT;
-identifier group;
+identifier attribute_group.group;
@@
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)
@@ -57,10 +63,10 @@ ATTRIBUTE_GROUPS(group);
+ATTRIBUTE_GROUPS_BACKPORT(group);
+#endif
-@ bus_registering depends on bus_group && attribute_group_mod @
+@ bus_registering @
identifier bus_register, ret;
identifier bus_group.group_bus;
-fresh identifier group_bus_init = "init_" ## attribute_group_mod.group ## "_attrs";
+fresh identifier group_bus_init = "init_" ## attribute_group.group ## "_attrs";
@@
(
@@ -70,4 +76,3 @@ fresh identifier group_bus_init = "init_" ## attribute_group_mod.group ## "_attr
+ group_bus_init();
ret = bus_register(&group_bus);
)
-
--
2.9.3
--
To unsubscribe from this list: send the line "unsubscribe backports" in
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/3] backports: support class_groups
2017-02-06 12:39 [PATCH 1/3] backports: devcoredump: make patch apply Johannes Berg
2017-02-06 12:39 ` [PATCH 2/3] backports: restrict group_attr spatch properly Johannes Berg
@ 2017-02-06 12:39 ` Johannes Berg
2017-02-06 22:36 ` Arend Van Spriel
1 sibling, 1 reply; 6+ messages in thread
From: Johannes Berg @ 2017-02-06 12:39 UTC (permalink / raw)
To: backports; +Cc: Johannes Berg
From: Johannes Berg <johannes.berg@intel.com>
Add a new semantic patch just like for dev_groups to
support class_groups.
Change-Id: I114e1a6ed8db901b3aa738a5052721d1da45cae4
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
.../0001-group-attr/0003-class_groups.cocci | 54 ++++++++++++++++++++++
1 file changed, 54 insertions(+)
create mode 100644 patches/collateral-evolutions/generic/0001-group-attr/0003-class_groups.cocci
diff --git a/patches/collateral-evolutions/generic/0001-group-attr/0003-class_groups.cocci b/patches/collateral-evolutions/generic/0001-group-attr/0003-class_groups.cocci
new file mode 100644
index 000000000000..a4694dd75763
--- /dev/null
+++ b/patches/collateral-evolutions/generic/0001-group-attr/0003-class_groups.cocci
@@ -0,0 +1,54 @@
+/* see upstream commit ced6473e74867 */
+
+@ attribute_group @
+identifier group;
+declarer name ATTRIBUTE_GROUPS;
+@@
+
+ATTRIBUTE_GROUPS(group);
+
+@script:python attribute_groups_name@
+group << attribute_group.group;
+groups;
+@@
+coccinelle.groups = group + "_groups"
+
+@ class_group @
+identifier group_class;
+identifier attribute_groups_name.groups;
+fresh identifier group_dev_attr = attribute_group.group ## "_dev_attrs";
+@@
+
+struct class group_class = {
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)
+ .class_groups = groups,
++#else
++ .class_attrs = group_dev_attr,
++#endif
+};
+
+@ attribute_group_mod depends on class_group @
+declarer name ATTRIBUTE_GROUPS_BACKPORT;
+identifier attribute_group.group;
+@@
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)
+ATTRIBUTE_GROUPS(group);
++#else
++#define BP_ATTR_GRP_STRUCT class_attribute
++ATTRIBUTE_GROUPS_BACKPORT(group);
++#endif
+
+@ class_registering @
+identifier class_register, ret;
+identifier class_group.group_class;
+fresh identifier group_class_init = "init_" ## attribute_group.group ## "_attrs";
+@@
+
+(
++ group_class_init();
+ return class_register(&group_class);
+|
++ group_class_init();
+ ret = class_register(&group_class);
+)
--
2.9.3
--
To unsubscribe from this list: send the line "unsubscribe backports" in
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 2/3] backports: restrict group_attr spatch properly
2017-02-06 12:39 ` [PATCH 2/3] backports: restrict group_attr spatch properly Johannes Berg
@ 2017-02-06 22:22 ` Arend Van Spriel
0 siblings, 0 replies; 6+ messages in thread
From: Arend Van Spriel @ 2017-02-06 22:22 UTC (permalink / raw)
To: Johannes Berg, backports; +Cc: Johannes Berg
On 6-2-2017 13:39, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
Maybe explain what went wrong here. I had email discussion with Julia
about this one (on cocci list), but glad you picked it up ;-)
Regards,
Arend
> Change-Id: I8881dab783fe69a85f833c96f0a4abd3ab062e84
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
> ---
> .../0001-group-attr/0001-group_attr_class.cocci | 18 ++++++++++++------
> .../generic/0001-group-attr/0002-group_attr_bus.cocci | 19 ++++++++++++-------
> 2 files changed, 24 insertions(+), 13 deletions(-)
>
> diff --git a/patches/collateral-evolutions/generic/0001-group-attr/0001-group_attr_class.cocci b/patches/collateral-evolutions/generic/0001-group-attr/0001-group_attr_class.cocci
> index ea2e7039f50c..a9c84651eedc 100644
> --- a/patches/collateral-evolutions/generic/0001-group-attr/0001-group_attr_class.cocci
> +++ b/patches/collateral-evolutions/generic/0001-group-attr/0001-group_attr_class.cocci
> @@ -33,9 +33,15 @@ declarer name ATTRIBUTE_GROUPS;
>
> ATTRIBUTE_GROUPS(group);
>
> -@ class_group depends on attribute_group @
> +@script:python attribute_groups_name@
> +group << attribute_group.group;
> +groups;
> +@@
> +coccinelle.groups = group + "_groups"
> +
> +@ class_group @
> identifier group_class;
> -expression groups;
> +identifier attribute_groups_name.groups;
> fresh identifier group_dev_attr = attribute_group.group ## "_dev_attrs";
> @@
>
> @@ -47,9 +53,9 @@ struct class group_class = {
> +#endif
> };
>
> -@ attribute_group_mod depends on attribute_group && class_group @
> +@ attribute_group_mod depends on class_group @
> declarer name ATTRIBUTE_GROUPS_BACKPORT;
> -identifier group;
> +identifier attribute_group.group;
> @@
>
> +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)
> @@ -59,10 +65,10 @@ ATTRIBUTE_GROUPS(group);
> +ATTRIBUTE_GROUPS_BACKPORT(group);
> +#endif
>
> -@ class_registering depends on class_group && attribute_group_mod @
> +@ class_registering @
> identifier class_register, ret;
> identifier class_group.group_class;
> -fresh identifier group_class_init = "init_" ## attribute_group_mod.group ## "_attrs";
> +fresh identifier group_class_init = "init_" ## attribute_group.group ## "_attrs";
> @@
>
> (
> diff --git a/patches/collateral-evolutions/generic/0001-group-attr/0002-group_attr_bus.cocci b/patches/collateral-evolutions/generic/0001-group-attr/0002-group_attr_bus.cocci
> index b01da875083b..c19e9d7f3eda 100644
> --- a/patches/collateral-evolutions/generic/0001-group-attr/0002-group_attr_bus.cocci
> +++ b/patches/collateral-evolutions/generic/0001-group-attr/0002-group_attr_bus.cocci
> @@ -31,9 +31,15 @@ declarer name ATTRIBUTE_GROUPS;
>
> ATTRIBUTE_GROUPS(group);
>
> -@ bus_group depends on attribute_group @
> +@script:python attribute_groups_name@
> +group << attribute_group.group;
> +groups;
> +@@
> +coccinelle.groups = group + "_groups"
> +
> +@ bus_group @
> identifier group_bus;
> -expression groups;
> +identifier attribute_groups_name.groups;
> fresh identifier group_dev_attr = attribute_group.group ## "_dev_attrs";
> @@
>
> @@ -45,9 +51,9 @@ struct bus_type group_bus = {
> +#endif
> };
>
> -@ attribute_group_mod depends on attribute_group && bus_group @
> +@ attribute_group_mod depends on bus_group @
> declarer name ATTRIBUTE_GROUPS_BACKPORT;
> -identifier group;
> +identifier attribute_group.group;
> @@
>
> +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)
> @@ -57,10 +63,10 @@ ATTRIBUTE_GROUPS(group);
> +ATTRIBUTE_GROUPS_BACKPORT(group);
> +#endif
>
> -@ bus_registering depends on bus_group && attribute_group_mod @
> +@ bus_registering @
> identifier bus_register, ret;
> identifier bus_group.group_bus;
> -fresh identifier group_bus_init = "init_" ## attribute_group_mod.group ## "_attrs";
> +fresh identifier group_bus_init = "init_" ## attribute_group.group ## "_attrs";
> @@
>
> (
> @@ -70,4 +76,3 @@ fresh identifier group_bus_init = "init_" ## attribute_group_mod.group ## "_attr
> + group_bus_init();
> ret = bus_register(&group_bus);
> )
> -
>
--
To unsubscribe from this list: send the line "unsubscribe backports" in
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 3/3] backports: support class_groups
2017-02-06 12:39 ` [PATCH 3/3] backports: support class_groups Johannes Berg
@ 2017-02-06 22:36 ` Arend Van Spriel
2017-02-07 6:29 ` Johannes Berg
0 siblings, 1 reply; 6+ messages in thread
From: Arend Van Spriel @ 2017-02-06 22:36 UTC (permalink / raw)
To: Johannes Berg, backports; +Cc: Johannes Berg
On 6-2-2017 13:39, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
>
> Add a new semantic patch just like for dev_groups to
> support class_groups.
>
> Change-Id: I114e1a6ed8db901b3aa738a5052721d1da45cae4
Does it make sense to keep the Change-Id: things here?
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
> ---
> .../0001-group-attr/0003-class_groups.cocci | 54 ++++++++++++++++++++++
> 1 file changed, 54 insertions(+)
> create mode 100644 patches/collateral-evolutions/generic/0001-group-attr/0003-class_groups.cocci
>
> diff --git a/patches/collateral-evolutions/generic/0001-group-attr/0003-class_groups.cocci b/patches/collateral-evolutions/generic/0001-group-attr/0003-class_groups.cocci
> new file mode 100644
> index 000000000000..a4694dd75763
> --- /dev/null
> +++ b/patches/collateral-evolutions/generic/0001-group-attr/0003-class_groups.cocci
> @@ -0,0 +1,54 @@
> +/* see upstream commit ced6473e74867 */
> +
> +@ attribute_group @
> +identifier group;
> +declarer name ATTRIBUTE_GROUPS;
> +@@
> +
> +ATTRIBUTE_GROUPS(group);
> +
> +@script:python attribute_groups_name@
> +group << attribute_group.group;
> +groups;
> +@@
> +coccinelle.groups = group + "_groups"
> +
> +@ class_group @
> +identifier group_class;
> +identifier attribute_groups_name.groups;
> +fresh identifier group_dev_attr = attribute_group.group ## "_dev_attrs";
So how will this work wrt naming scheme. Can we be sure all class_attrs
occurrences in the files we copy are named as such, ie. with _dev_attrs
post-fix?
Regards,
Arend
--
To unsubscribe from this list: send the line "unsubscribe backports" in
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 3/3] backports: support class_groups
2017-02-06 22:36 ` Arend Van Spriel
@ 2017-02-07 6:29 ` Johannes Berg
0 siblings, 0 replies; 6+ messages in thread
From: Johannes Berg @ 2017-02-07 6:29 UTC (permalink / raw)
To: Arend Van Spriel, backports
> > Change-Id: I114e1a6ed8db901b3aa738a5052721d1da45cae4
>
> Does it make sense to keep the Change-Id: things here?
Not really. But eventually I got lazy. I've now removed the auto-
generation for my tree, which means I'll have to add it manually
internally, but whatever :)
> > +@ class_group @
> > +identifier group_class;
> > +identifier attribute_groups_name.groups;
> > +fresh identifier group_dev_attr = attribute_group.group ##
> > "_dev_attrs";
>
> So how will this work wrt naming scheme. Can we be sure all
> class_attrs occurrences in the files we copy are named as such, ie.
> with _dev_attrs post-fix?
No no, that's not what happens here. The _dev_attrs postfix is
generated by the ATTRIBUTE_GROUPS_BACKPORT() macro.
johannes
--
To unsubscribe from this list: send the line "unsubscribe backports" in
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2017-02-07 6:29 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-06 12:39 [PATCH 1/3] backports: devcoredump: make patch apply Johannes Berg
2017-02-06 12:39 ` [PATCH 2/3] backports: restrict group_attr spatch properly Johannes Berg
2017-02-06 22:22 ` Arend Van Spriel
2017-02-06 12:39 ` [PATCH 3/3] backports: support class_groups Johannes Berg
2017-02-06 22:36 ` Arend Van Spriel
2017-02-07 6:29 ` Johannes Berg
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.