From: clabbe.montjoie@gmail.com (LABBE Corentin)
To: linus-amlogic@lists.infradead.org
Subject: [PATCH 1/3] char: hw_random: Add Amlogic Meson Hardware Random Generator
Date: Fri, 3 Jun 2016 11:07:58 +0200 [thread overview]
Message-ID: <20160603090758.GA7299@Red> (raw)
In-Reply-To: <1464943621-18278-2-git-send-email-narmstrong@baylibre.com>
Hello
I have some minor comments below
> +config HW_RANDOM_MESON
> + tristate "Amlogic Meson Random Number Generator support"
> + depends on HW_RANDOM && ARCH_MESON
Perhaps you could change to:
depends on HW_RANDOM
depends on ARCH_MESON || COMPILE_TEST
> +
> +static int meson_rng_read(struct hwrng *rng, void *buf, size_t max, bool wait)
> +{
> + struct meson_rng_data *data =
> + container_of(rng, struct meson_rng_data, rng);
> +
> + *(u32 *)buf = readl_relaxed(data->base + RNG_DATA);
> +
> + return sizeof(u32);
> +}
I think you need a test for max < sizeof(u32)
Regards
LABBE Corentin
WARNING: multiple messages have this Message-ID (diff)
From: LABBE Corentin <clabbe.montjoie@gmail.com>
To: Neil Armstrong <narmstrong@baylibre.com>
Cc: Matt Mackall <mpm@selenic.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
linux-arm-kernel@lists.infradead.org,
linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org,
linux-crypto@vger.kernel.org
Subject: Re: [PATCH 1/3] char: hw_random: Add Amlogic Meson Hardware Random Generator
Date: Fri, 3 Jun 2016 11:07:58 +0200 [thread overview]
Message-ID: <20160603090758.GA7299@Red> (raw)
In-Reply-To: <1464943621-18278-2-git-send-email-narmstrong@baylibre.com>
Hello
I have some minor comments below
> +config HW_RANDOM_MESON
> + tristate "Amlogic Meson Random Number Generator support"
> + depends on HW_RANDOM && ARCH_MESON
Perhaps you could change to:
depends on HW_RANDOM
depends on ARCH_MESON || COMPILE_TEST
> +
> +static int meson_rng_read(struct hwrng *rng, void *buf, size_t max, bool wait)
> +{
> + struct meson_rng_data *data =
> + container_of(rng, struct meson_rng_data, rng);
> +
> + *(u32 *)buf = readl_relaxed(data->base + RNG_DATA);
> +
> + return sizeof(u32);
> +}
I think you need a test for max < sizeof(u32)
Regards
LABBE Corentin
WARNING: multiple messages have this Message-ID (diff)
From: clabbe.montjoie@gmail.com (LABBE Corentin)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/3] char: hw_random: Add Amlogic Meson Hardware Random Generator
Date: Fri, 3 Jun 2016 11:07:58 +0200 [thread overview]
Message-ID: <20160603090758.GA7299@Red> (raw)
In-Reply-To: <1464943621-18278-2-git-send-email-narmstrong@baylibre.com>
Hello
I have some minor comments below
> +config HW_RANDOM_MESON
> + tristate "Amlogic Meson Random Number Generator support"
> + depends on HW_RANDOM && ARCH_MESON
Perhaps you could change to:
depends on HW_RANDOM
depends on ARCH_MESON || COMPILE_TEST
> +
> +static int meson_rng_read(struct hwrng *rng, void *buf, size_t max, bool wait)
> +{
> + struct meson_rng_data *data =
> + container_of(rng, struct meson_rng_data, rng);
> +
> + *(u32 *)buf = readl_relaxed(data->base + RNG_DATA);
> +
> + return sizeof(u32);
> +}
I think you need a test for max < sizeof(u32)
Regards
LABBE Corentin
next prev parent reply other threads:[~2016-06-03 9:07 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-03 8:46 [PATCH 0/3] hw_random: Add Amlogic Meson SoCs Random Genenerator driver Neil Armstrong
2016-06-03 8:46 ` Neil Armstrong
2016-06-03 8:46 ` Neil Armstrong
2016-06-03 8:46 ` [PATCH 1/3] char: hw_random: Add Amlogic Meson Hardware Random Generator Neil Armstrong
2016-06-03 8:46 ` Neil Armstrong
2016-06-03 8:46 ` Neil Armstrong
2016-06-03 8:46 ` Neil Armstrong
2016-06-03 9:07 ` LABBE Corentin [this message]
2016-06-03 9:07 ` LABBE Corentin
2016-06-03 9:07 ` LABBE Corentin
2016-06-03 8:47 ` [PATCH 2/3] dt-bindings: hwrng: Add Amlogic Meson Hardware Random Generator bindings Neil Armstrong
2016-06-03 8:47 ` Neil Armstrong
2016-06-03 8:47 ` Neil Armstrong
2016-06-06 14:10 ` Rob Herring
2016-06-06 14:10 ` Rob Herring
2016-06-06 14:10 ` Rob Herring
2016-06-03 8:47 ` [PATCH 3/3] ARM64: dts: meson-gxbb: Add Hardware Random Generator node Neil Armstrong
2016-06-03 8:47 ` Neil Armstrong
2016-06-03 8:47 ` Neil Armstrong
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=20160603090758.GA7299@Red \
--to=clabbe.montjoie@gmail.com \
--cc=linus-amlogic@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.