From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932142AbdK1CS7 convert rfc822-to-8bit (ORCPT ); Mon, 27 Nov 2017 21:18:59 -0500 Received: from smtprelay0080.hostedemail.com ([216.40.44.80]:34922 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932114AbdK1CS5 (ORCPT ); Mon, 27 Nov 2017 21:18:57 -0500 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::::::::::::::,RULES_HIT:41:152:355:379:541:599:800:960:968:973:988:989:1260:1277:1311:1313:1314:1345:1359:1431:1437:1513:1515:1516:1518:1521:1534:1542:1593:1594:1711:1730:1747:1777:1792:2393:2553:2559:2562:2895:3138:3139:3140:3141:3142:3353:3622:3865:3867:3870:3871:4362:4605:5007:6261:7875:7901:9040:10004:10400:10848:10967:11026:11232:11658:11914:12043:12438:12555:12740:12895:13161:13229:14180:14181:14659:14721:21060:21080:21451:21627:30054:30070:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: wound36_4de388215c751 X-Filterd-Recvd-Size: 3779 Date: Mon, 27 Nov 2017 21:18:53 -0500 From: Steven Rostedt To: Alex Shi Cc: linux-kernel@vger.kernel.org, linux-rt-users , Thomas Gleixner , Carsten Emde , Sebastian Andrzej Siewior , John Kacur , Paul Gortmaker , Julia Cartwright , Daniel Wagner , tom.zanussi@linux.intel.com Subject: Re: [PATCH RT 03/10] random: avoid preempt_disable()ed section Message-ID: <20171127211853.0fb09380@vmware.local.home> In-Reply-To: <584fdcad-9afe-fb19-04dd-46358a04fc17@linaro.org> References: <20171123053341.174002403@goodmis.org> <20171123053433.594374450@goodmis.org> <584fdcad-9afe-fb19-04dd-46358a04fc17@linaro.org> X-Mailer: Claws Mail 3.15.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 24 Nov 2017 14:26:40 +0800 Alex Shi wrote: > Hi Steve, > > I just build the patches, a build error found here: > > drivers/char/random.c: In function ‘get_random_int’: > drivers/char/random.c:1816:7: error: assignment from incompatible > pointer type [-Werror=incompatible-pointer-types] > hash = &get_locked_var(hash_entropy_int_lock, get_random_int_hash); > ^ > drivers/char/random.c: In function ‘get_random_long’: > drivers/char/random.c:1838:7: error: assignment from incompatible > pointer type [-Werror=incompatible-pointer-types] > hash = &get_locked_var(hash_entropy_int_lock, get_random_int_hash); > ^ > > > - hash = get_cpu_var(get_random_int_hash); > > + hash = &get_locked_var(hash_entropy_int_lock, get_random_int_hash); > ^ > Is this a extra '&' which need to remove? > > > > > hash[0] += current->pid + jiffies + random_get_entropy(); > > md5_transform(hash, random_int_secret); > > ret = hash[0]; > > - put_cpu_var(get_random_int_hash); > > + put_locked_var(hash_entropy_int_lock, get_random_int_hash); > > > > return ret; > > } > > @@ -1833,12 +1835,12 @@ unsigned long get_random_long(void) > > if (arch_get_random_long(&ret)) > > return ret; > > > > - hash = get_cpu_var(get_random_int_hash); > > + hash = &get_locked_var(hash_entropy_int_lock, get_random_int_hash); > ^ > Ditto Thanks! I made the following update. I forgot to check for warnings in the build. :-/ -- Steve diff --git a/drivers/char/random.c b/drivers/char/random.c index b41745c5962c..46c0e27cf27f 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -1813,7 +1813,7 @@ unsigned int get_random_int(void) if (arch_get_random_int(&ret)) return ret; - hash = &get_locked_var(hash_entropy_int_lock, get_random_int_hash); + hash = get_locked_var(hash_entropy_int_lock, get_random_int_hash); hash[0] += current->pid + jiffies + random_get_entropy(); md5_transform(hash, random_int_secret); @@ -1835,7 +1835,7 @@ unsigned long get_random_long(void) if (arch_get_random_long(&ret)) return ret; - hash = &get_locked_var(hash_entropy_int_lock, get_random_int_hash); + hash = get_locked_var(hash_entropy_int_lock, get_random_int_hash); hash[0] += current->pid + jiffies + random_get_entropy(); md5_transform(hash, random_int_secret);