public inbox for linux-crypto@vger.kernel.org
 help / color / mirror / Atom feed
From: Vinod <vkoul@kernel.org>
To: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
	Matt Mackall <mpm@selenic.com>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	Arnd Bergmann <arnd@arndb.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-arm-msm@vger.kernel.org, Stephen Boyd <swboyd@chromium.org>
Subject: Re: [PATCH v2 2/2] hwrng: msm - Add support for prng v2
Date: Tue, 19 Jun 2018 18:01:28 +0530	[thread overview]
Message-ID: <20180619123128.GD13316@vkoul-mobl> (raw)
In-Reply-To: <b7543a73-e35a-c015-3bba-1e3ab3a389d5@linaro.org>

On 19-06-18, 15:11, Stanimir Varbanov wrote:

Hi Stan,

> On 06/19/2018 12:54 PM, Vinod Koul wrote:

> >  	rng->hwrng.name = KBUILD_MODNAME,
> > -	rng->hwrng.init = msm_rng_init,
> > -	rng->hwrng.cleanup = msm_rng_cleanup,
> > -	rng->hwrng.read = msm_rng_read,
> > +	rng->hwrng.read = msm_rng_read;
> > +	skip_init = (unsigned long)of_device_get_match_data(&pdev->dev);
> 
> skip_init is unsigned int, despite I think you don't need to cast it.

This is needed. of_device_get_match_data returns void *, so an explicit
cast is required for integer warning, otherwise it shows up as
-Wint-conversion warning

> >  static const struct of_device_id msm_rng_of_match[] = {
> > -	{ .compatible = "qcom,prng", },
> > +	{ .compatible = "qcom,prng", .data = (void *)0},
> > +	{ .compatible = "qcom,prng-v2", .data = (void *)1},
> 
> No need to cast. IMO it'd be better to create defines for these numbers:

again driver_data is void * and we need a cast

> 
> #define PRNG_V1	0
> #define PRNG_V2	1

That can be done. Since it is more used as flag and not version number
here to skip init, it doesn't really mean versions now

Thanks
-- 
~Vinod

  reply	other threads:[~2018-06-19 12:31 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-19  9:54 [PATCH v2 0/2] hwrng: Add support for qcpm v2 hwrng Vinod Koul
2018-06-19  9:54 ` [PATCH v2 1/2] dt-bindings: rng: Add new compatible qcom,prng-v2 Vinod Koul
2018-06-25 19:06   ` Rob Herring
2018-06-26 15:27     ` Vinod
2018-06-19  9:54 ` [PATCH v2 2/2] hwrng: msm - Add support for prng v2 Vinod Koul
2018-06-19 12:11   ` Stanimir Varbanov
2018-06-19 12:31     ` Vinod [this message]
2018-06-19 14:30   ` Herbert Xu
2018-06-20  5:58   ` Stephen Boyd
2018-06-20 13:37     ` Vinod
2018-06-22  1:22       ` Stephen Boyd
2018-06-21 15:17 ` [PATCH v2 0/2] hwrng: Add support for qcpm v2 hwrng Timur Tabi
2018-06-22  4:27   ` Vinod
2018-06-22  4:30     ` Timur Tabi
2018-06-22  4:50       ` Vinod

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=20180619123128.GD13316@vkoul-mobl \
    --to=vkoul@kernel.org \
    --cc=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpm@selenic.com \
    --cc=stanimir.varbanov@linaro.org \
    --cc=swboyd@chromium.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox