From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933632AbcI0Pmw (ORCPT ); Tue, 27 Sep 2016 11:42:52 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:54599 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932947AbcI0Pmo (ORCPT ); Tue, 27 Sep 2016 11:42:44 -0400 From: Shaohua Li To: , CC: "David S . Miller" , , Tejun Heo Subject: [PATCH trival -resend 2/2] lib: clean up put_cpu_var usage Date: Tue, 27 Sep 2016 08:42:42 -0700 Message-ID: <935eea817a8d13d9223e09b4ca11e0508aee8437.1474990741.git.shli@fb.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <7ffd1960225e024a738e4c372f091bb49096e294.1474990741.git.shli@fb.com> References: <7ffd1960225e024a738e4c372f091bb49096e294.1474990741.git.shli@fb.com> X-FB-Internal: Safe MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-09-27_06:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org put_cpu_var takes the percpu data, not the data returned from get_cpu_var. This doesn't change the behavior. Cc: Tejun Heo Signed-off-by: Shaohua Li --- 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