Skip to contentSkip to conversation

Remove write-only variable from pktgen_thread

PATCH In review Pavel Emelyanov 3 participants 3 messages Aug 29, 2007 – Aug 31, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Remove write-only variable from pktgen_thread

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.

---

net/core/pktgen.c +0 -0
index 3a3154e..93695c2 100644
@@ -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;
Acked-by on v1 1/1
#1 lore raw

Pavel Emelianov [[email protected]] 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 <[email protected]>

Good observation that its not being used :-)

| 
| ---
| 
| 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;
maintainer
#2 lore raw

From: [email protected]
Date: Wed, 29 Aug 2007 14:33:56 -0700

Quoted 11 lines

Pavel Emelianov [[email protected]] 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 <[email protected]>

Good observation that its not being used :-)

Patch applied, thanks.