From: Steven Rostedt <rostedt@goodmis.org>
To: Alex Shi <alex.shi@linaro.org>
Cc: linux-kernel@vger.kernel.org,
linux-rt-users <linux-rt-users@vger.kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Carsten Emde <C.Emde@osadl.org>,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
John Kacur <jkacur@redhat.com>,
Paul Gortmaker <paul.gortmaker@windriver.com>,
Julia Cartwright <julia@ni.com>,
Daniel Wagner <daniel.wagner@siemens.com>,
tom.zanussi@linux.intel.com
Subject: Re: [PATCH RT 03/10] random: avoid preempt_disable()ed section
Date: Mon, 27 Nov 2017 21:18:53 -0500 [thread overview]
Message-ID: <20171127211853.0fb09380@vmware.local.home> (raw)
In-Reply-To: <584fdcad-9afe-fb19-04dd-46358a04fc17@linaro.org>
On Fri, 24 Nov 2017 14:26:40 +0800
Alex Shi <alex.shi@linaro.org> 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);
next prev parent reply other threads:[~2017-11-28 2:18 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-23 5:33 [PATCH RT 00/10] Linux 4.4.97-rt111-rc2 Steven Rostedt
2017-11-23 5:33 ` [PATCH RT 01/10] timer/hrtimer: check properly for a running timer Steven Rostedt
2017-11-23 5:33 ` [PATCH RT 02/10] rtmutex: Make lock_killable work Steven Rostedt
2017-11-23 5:33 ` [PATCH RT 03/10] random: avoid preempt_disable()ed section Steven Rostedt
2017-11-24 6:26 ` Alex Shi
2017-11-28 2:18 ` Steven Rostedt [this message]
2017-11-23 5:33 ` [PATCH RT 04/10] sched: Prevent task state corruption by spurious lock wakeup Steven Rostedt
2017-11-23 5:33 ` [PATCH RT 05/10] sched: Remove TASK_ALL Steven Rostedt
2017-11-23 5:33 ` [PATCH RT 06/10] sched/migrate disable: handle updated task-mask mg-dis section Steven Rostedt
2017-11-23 5:33 ` [PATCH RT 08/10] fs: convert two more BH_Uptodate_Lock related bitspinlocks Steven Rostedt
2017-11-23 5:33 ` [PATCH RT 09/10] md/raid5: do not disable interrupts Steven Rostedt
2017-11-23 5:33 ` [PATCH RT 10/10] Linux 4.4.97-rt111-rc2 Steven Rostedt
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=20171127211853.0fb09380@vmware.local.home \
--to=rostedt@goodmis.org \
--cc=C.Emde@osadl.org \
--cc=alex.shi@linaro.org \
--cc=bigeasy@linutronix.de \
--cc=daniel.wagner@siemens.com \
--cc=jkacur@redhat.com \
--cc=julia@ni.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-users@vger.kernel.org \
--cc=paul.gortmaker@windriver.com \
--cc=tglx@linutronix.de \
--cc=tom.zanussi@linux.intel.com \
/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