lkml.org 
[lkml]   [2015]   [Sep]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v2 3/7] hwrng: core: Simplify RNG switching from sysfs
Date
>>>>> "Lee" == Lee Jones <lee.jones@linaro.org> writes:

> If we attempt to use sysfs to change the current RNG in the usual
> way i.e. issuing something like:

> `echo 8a8a000.rng > /sys/devices/virtual/misc/hw_random/rng_current`

> ... it will fail because the code doesn't currently take the '\n'
> into consideration. Well, now it does.

> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> ---
> drivers/char/hw_random/core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

> diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c
> index da8faf7..2d4a969 100644
> --- a/drivers/char/hw_random/core.c
> +++ b/drivers/char/hw_random/core.c
> @@ -323,7 +323,7 @@ static ssize_t hwrng_attr_current_store(struct device *dev,
> return -ERESTARTSYS;
> err = -ENODEV;
> list_for_each_entry(rng, &rng_list, list) {
> - if (strcmp(rng->name, buf) == 0) {
> + if (sysfs_streq(rng->name, buf)) {

Looks good.

Acked-by: Peter Korsgaard <peter@korsgaard.com>

--
Venlig hilsen,
Peter Korsgaard


\
 
 \ /
  Last update: 2015-09-17 16:21    [W:0.243 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site