From: Shaohua Li <shli@fb.com>
To: <linux-kernel@vger.kernel.org>
Cc: <akpm@linux-foundation.org>, Tejun Heo <tj@kernel.org>
Subject: [PATCH trival 2/2] lib: clean up put_cpu_var usage
Date: Mon, 26 Sep 2016 11:14:51 -0700 [thread overview]
Message-ID: <72587e0787a2eae132513e366f356ca03313303a.1474912742.git.shli@fb.com> (raw)
In-Reply-To: <1474c666552accf475fc809b3525892e1ae88bfa.1474912742.git.shli@fb.com>
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 69ed593..915982b 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
next prev parent reply other threads:[~2016-09-26 18:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-26 18:14 [PATCH trival 1/2] bpf: " Shaohua Li
2016-09-26 18:14 ` Shaohua Li [this message]
2016-09-26 23:51 ` Alexei Starovoitov
2016-09-27 10:52 ` Daniel Borkmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=72587e0787a2eae132513e366f356ca03313303a.1474912742.git.shli@fb.com \
--to=shli@fb.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®