[PATCH] Remove write-only variable from pktgen_thread

Subsystems: networking [general], the rest

STALE6949d

3 messages, 3 authors, 2007-08-31 · open the first message on its own page

[PATCH] Remove write-only variable from pktgen_thread

From: Pavel Emelyanov <hidden>
Date: 2007-08-29 13:25:54

The pktgen_thread.pid is set to current->pid and is never used
after this. So remove this at all.

Found during isolating the explicit pid/tgid usage.

Signed-off-by: Pavel Emelyanov <redacted>

---
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 3a3154e..93695c2 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -380,7 +380,6 @@ struct pktgen_thread {
 	/* Field for thread to receive "posted" events terminate, stop ifs etc. */
 
 	u32 control;
-	int pid;
 	int cpu;
 
 	wait_queue_head_t queue;
@@ -3462,8 +3461,6 @@ static int pktgen_thread_worker(void *ar
 
 	init_waitqueue_head(&t->queue);
 
-	t->pid = current->pid;
-
 	pr_debug("pktgen: starting pktgen/%d:  pid=%d\n", cpu, task_pid_nr(current));
 
 	max_before_softirq = t->max_before_softirq;

Re: [PATCH] Remove write-only variable from pktgen_thread

From: <hidden>
Date: 2007-08-29 21:34:18

Pavel Emelianov [xemul@openvz.org] wrote:
| The pktgen_thread.pid is set to current->pid and is never used
| after this. So remove this at all.
| 
| Found during isolating the explicit pid/tgid usage.
| 
| Signed-off-by: Pavel Emelyanov [off-list ref]

Good observation that its not being used :-)

Acked-by: Sukadev Bhattiprolu <redacted>
| 
| ---
| 
| diff --git a/net/core/pktgen.c b/net/core/pktgen.c
| index 3a3154e..93695c2 100644
| --- a/net/core/pktgen.c
| +++ b/net/core/pktgen.c
| @@ -380,7 +380,6 @@ struct pktgen_thread {
| 	/* Field for thread to receive "posted" events terminate, stop ifs 
| 	etc. */
| 
| 	u32 control;
| -	int pid;
| 	int cpu;
| 
| 	wait_queue_head_t queue;
| @@ -3462,8 +3461,6 @@ static int pktgen_thread_worker(void *ar
| 
| 	init_waitqueue_head(&t->queue);
| 
| -	t->pid = current->pid;
| -
| 	pr_debug("pktgen: starting pktgen/%d:  pid=%d\n", cpu, 
| 	task_pid_nr(current));
| 
| 	max_before_softirq = t->max_before_softirq;

Re: [PATCH] Remove write-only variable from pktgen_thread

From: David Miller <davem@davemloft.net>
Date: 2007-08-31 05:47:16

From: sukadev@us.ibm.com
Date: Wed, 29 Aug 2007 14:33:56 -0700
Pavel Emelianov [xemul@openvz.org] wrote:
| The pktgen_thread.pid is set to current->pid and is never used
| after this. So remove this at all.
| 
| Found during isolating the explicit pid/tgid usage.
| 
| Signed-off-by: Pavel Emelyanov [off-list ref]

Good observation that its not being used :-)

Acked-by: Sukadev Bhattiprolu <redacted>
Patch applied, thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help