All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf python: Fix redundant self-assignment in get_argument_count()
@ 2026-09-03  8:13 liujing
  2026-09-03  8:17 ` sashiko-bot
  2026-09-08 20:57 ` Arnaldo Carvalho de Melo
  0 siblings, 2 replies; 3+ messages in thread
From: liujing @ 2026-09-03  8:13 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Namhyung Kim
  Cc: Ian Rogers, linux-perf-users, linux-kernel, Liu Jing

From: Liu Jing <liujing@cmss.chinamobile.com>

In get_argument_count(), the variable code_obj is assigned to itself
before being assigned the result of PyObject_GetAttrString(). This is
a redundant self-assignment that appears to be a typo.

Fix it by removing the redundant self-assignment.

Signed-off-by: Liu Jing <liujing@cmss.chinamobile.com>
---
--- a/tools/perf/util/scripting-engines/trace-event-python.c
+++ b/tools/perf/util/scripting-engines/trace-event-python.c
@@ -165,7 +165,7 @@
 {
 	int arg_count = 0;
 
-	PyObject *code_obj = code_obj = PyObject_GetAttrString(handler, "__code__");
+	PyObject *code_obj = PyObject_GetAttrString(handler, "__code__");
 	PyErr_Clear();
 	if (code_obj) {
 		PyObject *arg_count_obj = PyObject_GetAttrString(code_obj,





^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] perf python: Fix redundant self-assignment in get_argument_count()
  2026-09-03  8:13 [PATCH] perf python: Fix redundant self-assignment in get_argument_count() liujing
@ 2026-09-03  8:17 ` sashiko-bot
  2026-09-08 20:57 ` Arnaldo Carvalho de Melo
  1 sibling, 0 replies; 3+ messages in thread
From: sashiko-bot @ 2026-09-03  8:17 UTC (permalink / raw)
  To: liujing; +Cc: linux-perf-users

> From: Liu Jing <liujing@cmss.chinamobile.com>
> 
> In get_argument_count(), the variable code_obj is assigned to itself
> before being assigned the result of PyObject_GetAttrString(). This is
> a redundant self-assignment that appears to be a typo.
> 
> Fix it by removing the redundant self-assignment.
> 
> Signed-off-by: Liu Jing <liujing@cmss.chinamobile.com>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260903081350.4676-1-liujing@cmss.chinamobile.com?part=1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] perf python: Fix redundant self-assignment in get_argument_count()
  2026-09-03  8:13 [PATCH] perf python: Fix redundant self-assignment in get_argument_count() liujing
  2026-09-03  8:17 ` sashiko-bot
@ 2026-09-08 20:57 ` Arnaldo Carvalho de Melo
  1 sibling, 0 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2026-09-08 20:57 UTC (permalink / raw)
  To: liujing
  Cc: Peter Zijlstra, Ingo Molnar, Namhyung Kim, Ian Rogers,
	linux-perf-users, linux-kernel

On Thu, Sep 03, 2026 at 04:13:50PM +0800, liujing wrote:
> From: Liu Jing <liujing@cmss.chinamobile.com>
> 
> In get_argument_count(), the variable code_obj is assigned to itself
> before being assigned the result of PyObject_GetAttrString(). This is
> a redundant self-assignment that appears to be a typo.
> 
> Fix it by removing the redundant self-assignment.

Thanks, applied to perf-tools-next, for v7.4.

- Arnaldo
 
> Signed-off-by: Liu Jing <liujing@cmss.chinamobile.com>
> ---
> --- a/tools/perf/util/scripting-engines/trace-event-python.c
> +++ b/tools/perf/util/scripting-engines/trace-event-python.c
> @@ -165,7 +165,7 @@
>  {
>  	int arg_count = 0;
>  
> -	PyObject *code_obj = code_obj = PyObject_GetAttrString(handler, "__code__");
> +	PyObject *code_obj = PyObject_GetAttrString(handler, "__code__");
>  	PyErr_Clear();
>  	if (code_obj) {
>  		PyObject *arg_count_obj = PyObject_GetAttrString(code_obj,
> 
> 
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-09-08 20:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-03  8:13 [PATCH] perf python: Fix redundant self-assignment in get_argument_count() liujing
2026-09-03  8:17 ` sashiko-bot
2026-09-08 20:57 ` Arnaldo Carvalho de Melo

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.