Breaks the redundant loop in kernel/marker.c
PATCH 1/1 Breaks the redundant loop in kernel/marker.c
--- kernel/marker.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)
kernel/marker.c +1 -2
@@ -836,8 +836,6 @@ void *marker_get_private_data(const char *name, marker_probe_func *probe,if (!e->ptype) {if (num ==0 && e->single.func == probe)return e->single.probe_private; -else -break ; }else {struct marker_probe_closure *closure;int match =0 ;
@@ -849,6 +847,7 @@ void *marker_get_private_data(const char *name, marker_probe_func *probe,return closure[i].probe_private; } } +break ; } }return ERR_PTR (-ENOENT );
Signature · 1 line
1.5.5.3
Quoted 19 lines · Zhaolei
Signed-off-by Zhao Lei <[email protected]>--- kernel/marker.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)kernel/marker.c +0
-2@@ -836,8 +836,6 @@ void *marker_get_private_data(const char *name, marker_probe_func *probe,if (!e->ptype) {if (num ==0 && e->single.func == probe)return e->single.probe_private; -else -break ; }else {struct marker_probe_closure *closure;int match =0 ;
kernel/marker.c void *marker_get_private_data(const char *name, marker_probe_func *probe, · line 853
Quoted 7 lines
kernel/marker.c +1
-0@@ -849,6 +847,7 @@ void *marker_get_private_data(const char *name, marker_probe_func *probe,return closure[i].probe_private; } } +break ; } }return ERR_PTR (-ENOENT );
hm, could you describe the necessity of this patch some more? This has the change to change behavior, which might even be a bugfix: is there any chance that the closure-loop in the e->ptype != NULL branch does not exit? Before your patch we'd continue the iteration - which _probably_ does not lead to any more matches (e->name is supposed to be unique).
Ingo
Quoted 5 lines · Ingo Molnar
hm, could you describe the necessity of this patch some more? This has the change to change behavior, which might even be a bugfix: is there any chance that the closure-loop in the
e->ptype!= NULL branch does not exit? Before your patch we'd continue the iteration - which _probably_ does not lead to any more matches (e->nameis supposed to be unique).
Because e->name is unique in list, we don't need to continue the iteration after matched.
This is a cleanup.
--- kernel/marker.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)
kernel/marker.c +1 -2
@@ -836,8 +836,6 @@ void *marker_get_private_data(const char *name, marker_probe_func *probe,if (!e->ptype) {if (num ==0 && e->single.func == probe)return e->single.probe_private; -else -break ; }else {struct marker_probe_closure *closure;int match =0 ;
@@ -849,6 +847,7 @@ void *marker_get_private_data(const char *name, marker_probe_func *probe,return closure[i].probe_private; } } +break ; } }return ERR_PTR (-ENOENT );
Signature · 1 line
1.5.5.3
Quoted 10 lines · Zhaolei
Quoted 5 lines · Ingo Molnar
hm, could you describe the necessity of this patch some more? This has the change to change behavior, which might even be a bugfix: is there any chance that the closure-loop in the
e->ptype!= NULL branch does not exit? Before your patch we'd continue the iteration - which _probably_ does not lead to any more matches (e->nameis supposed to be unique).Because
e->nameis unique in list, we don't need to continue the iteration after matched.
This is a cleanup.
ok - it's useful to point this out in the changelog. You can use the "Impact:" header we started using recently:
Impact: cleanup, no functionality changed
See for example this upstream commit:
| commit 07454bfff151d2465ada809bbaddf3548cc1097c | Author: Thomas Gleixner <[email protected]> | Date: Sat Oct 4 10:51:07 2008 +0200 | | clockevents: check broadcast tick device not the clock events device | | Impact: jiffies increment too fast.
Mathieu, any objections against the patch?
Ingo
Mathieu Desnoyers
Acked-byQuoted 29 lines · * Ingo Molnar ([email protected]) wrote:
Quoted 10 lines · Zhaolei
Quoted 5 lines · Ingo Molnar
hm, could you describe the necessity of this patch some more? This has the change to change behavior, which might even be a bugfix: is there any chance that the closure-loop in the
e->ptype!= NULL branch does not exit? Before your patch we'd continue the iteration - which _probably_ does not lead to any more matches (e->nameis supposed to be unique).Because
e->nameis unique in list, we don't need to continue the iteration after matched.
This is a cleanup.ok - it's useful to point this out in the changelog. You can use the "Impact:" header we started using recently:
Impact: cleanup, no functionality changed
See for example this upstream commit:
| commit 07454bfff151d2465ada809bbaddf3548cc1097c | Author: Thomas Gleixner <[email protected]> | Date: Sat Oct 4 10:51:07 2008 +0200 | | clockevents: check broadcast tick device not the clock events device | | Impact: jiffies increment too fast.
Quoted 3 lines
Mathieu, any objections against the patch?
Ingo
It looks all good with an extended changelog.
Thanks,
Mathieu
Signature · 2 lines
Mathieu Desnoyers OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
PATCH v2 1/1 Breaks the redundant loop in kernel/marker.c
Because e->name is unique in list, we don't need to continue the iteration after matched.
Impact: cleanup, no functionality changed
--- kernel/marker.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)
kernel/marker.c +1 -2
@@ -848,8 +848,6 @@ void *marker_get_private_data(const char *name, marker_probe_func *probe,if (!e->ptype) {if (num ==0 && e->single.func == probe)return e->single.probe_private; -else -break ; }else {struct marker_probe_closure *closure;int match =0 ;
@@ -861,6 +859,7 @@ void *marker_get_private_data(const char *name, marker_probe_func *probe,return closure[i].probe_private; } } +break ; } }return ERR_PTR (-ENOENT );
Signature · 1 line
1.5.5.3
Ingo Molnar
AppliedQuoted 9 lines · Zhaolei
Because
e->nameis unique in list, we don't need to continue the iteration after matched.Impact: cleanup, no functionality changed
Signed-off-by Zhao Lei <[email protected]>--- kernel/marker.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)
applied to tip/tracing/markers, thanks! (also added Mathieu's ack)
Ingo