* [PATCH trival -resend 2/2] lib: clean up put_cpu_var usage
2016-09-27 15:42 [PATCH trival -resend 1/2] bpf: clean up put_cpu_var usage Shaohua Li
@ 2016-09-27 15:42 ` Shaohua Li
2016-09-27 23:16 ` Tejun Heo
2016-09-28 2:10 ` David Miller
2016-09-27 23:02 ` [PATCH trival -resend 1/2] bpf: " Alexei Starovoitov
` (2 subsequent siblings)
3 siblings, 2 replies; 7+ messages in thread
From: Shaohua Li @ 2016-09-27 15:42 UTC (permalink / raw)
To: linux-kernel, netdev; +Cc: David S . Miller, akpm, Tejun Heo
put_cpu_var takes the percpu data, not the data returned from
get_cpu_var.
This doesn't change the behavior.
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Shaohua Li <shli@fb.com>
---
lib/random32.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/random32.c b/lib/random32.c
index a309235..fa594b1 100644
--- a/lib/random32.c
+++ b/lib/random32.c
@@ -81,7 +81,7 @@ u32 prandom_u32(void)
u32 res;
res = prandom_u32_state(state);
- put_cpu_var(state);
+ put_cpu_var(net_rand_state);
return res;
}
@@ -128,7 +128,7 @@ void prandom_bytes(void *buf, size_t bytes)
struct rnd_state *state = &get_cpu_var(net_rand_state);
prandom_bytes_state(state, buf, bytes);
- put_cpu_var(state);
+ put_cpu_var(net_rand_state);
}
EXPORT_SYMBOL(prandom_bytes);
--
2.9.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH trival -resend 2/2] lib: clean up put_cpu_var usage
2016-09-27 15:42 ` [PATCH trival -resend 2/2] lib: " Shaohua Li
@ 2016-09-27 23:16 ` Tejun Heo
2016-09-28 2:10 ` David Miller
1 sibling, 0 replies; 7+ messages in thread
From: Tejun Heo @ 2016-09-27 23:16 UTC (permalink / raw)
To: Shaohua Li; +Cc: linux-kernel, netdev, David S . Miller, akpm
On Tue, Sep 27, 2016 at 08:42:42AM -0700, Shaohua Li wrote:
> put_cpu_var takes the percpu data, not the data returned from
> get_cpu_var.
>
> This doesn't change the behavior.
>
> Cc: Tejun Heo <tj@kernel.org>
> Signed-off-by: Shaohua Li <shli@fb.com>
Acked-by: Tejun Heo <tj@kernel.org>
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH trival -resend 2/2] lib: clean up put_cpu_var usage
2016-09-27 15:42 ` [PATCH trival -resend 2/2] lib: " Shaohua Li
2016-09-27 23:16 ` Tejun Heo
@ 2016-09-28 2:10 ` David Miller
1 sibling, 0 replies; 7+ messages in thread
From: David Miller @ 2016-09-28 2:10 UTC (permalink / raw)
To: shli; +Cc: linux-kernel, netdev, akpm, tj
From: Shaohua Li <shli@fb.com>
Date: Tue, 27 Sep 2016 08:42:42 -0700
> put_cpu_var takes the percpu data, not the data returned from
> get_cpu_var.
>
> This doesn't change the behavior.
>
> Cc: Tejun Heo <tj@kernel.org>
> Signed-off-by: Shaohua Li <shli@fb.com>
Applied.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH trival -resend 1/2] bpf: clean up put_cpu_var usage
2016-09-27 15:42 [PATCH trival -resend 1/2] bpf: clean up put_cpu_var usage Shaohua Li
2016-09-27 15:42 ` [PATCH trival -resend 2/2] lib: " Shaohua Li
@ 2016-09-27 23:02 ` Alexei Starovoitov
2016-09-27 23:15 ` Tejun Heo
2016-09-28 2:10 ` David Miller
3 siblings, 0 replies; 7+ messages in thread
From: Alexei Starovoitov @ 2016-09-27 23:02 UTC (permalink / raw)
To: Shaohua Li
Cc: linux-kernel, netdev, David S . Miller, akpm, Tejun Heo,
Alexei Starovoitov
On Tue, Sep 27, 2016 at 08:42:41AM -0700, Shaohua Li wrote:
> put_cpu_var takes the percpu data, not the data returned from
> get_cpu_var.
>
> This doesn't change the behavior.
>
> Cc: Tejun Heo <tj@kernel.org>
> Cc: Alexei Starovoitov <ast@kernel.org>
> Signed-off-by: Shaohua Li <shli@fb.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH trival -resend 1/2] bpf: clean up put_cpu_var usage
2016-09-27 15:42 [PATCH trival -resend 1/2] bpf: clean up put_cpu_var usage Shaohua Li
2016-09-27 15:42 ` [PATCH trival -resend 2/2] lib: " Shaohua Li
2016-09-27 23:02 ` [PATCH trival -resend 1/2] bpf: " Alexei Starovoitov
@ 2016-09-27 23:15 ` Tejun Heo
2016-09-28 2:10 ` David Miller
3 siblings, 0 replies; 7+ messages in thread
From: Tejun Heo @ 2016-09-27 23:15 UTC (permalink / raw)
To: Shaohua Li
Cc: linux-kernel, netdev, David S . Miller, akpm, Alexei Starovoitov
On Tue, Sep 27, 2016 at 08:42:41AM -0700, Shaohua Li wrote:
> put_cpu_var takes the percpu data, not the data returned from
> get_cpu_var.
>
> This doesn't change the behavior.
>
> Cc: Tejun Heo <tj@kernel.org>
> Cc: Alexei Starovoitov <ast@kernel.org>
> Signed-off-by: Shaohua Li <shli@fb.com>
Acked-by: Tejun Heo <tj@kernel.org>
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH trival -resend 1/2] bpf: clean up put_cpu_var usage
2016-09-27 15:42 [PATCH trival -resend 1/2] bpf: clean up put_cpu_var usage Shaohua Li
` (2 preceding siblings ...)
2016-09-27 23:15 ` Tejun Heo
@ 2016-09-28 2:10 ` David Miller
3 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2016-09-28 2:10 UTC (permalink / raw)
To: shli; +Cc: linux-kernel, netdev, akpm, tj, ast
From: Shaohua Li <shli@fb.com>
Date: Tue, 27 Sep 2016 08:42:41 -0700
> put_cpu_var takes the percpu data, not the data returned from
> get_cpu_var.
>
> This doesn't change the behavior.
>
> Cc: Tejun Heo <tj@kernel.org>
> Cc: Alexei Starovoitov <ast@kernel.org>
> Signed-off-by: Shaohua Li <shli@fb.com>
Applied.
^ permalink raw reply [flat|nested] 7+ messages in thread