lkml.org 
[lkml]   [2018]   [Jul]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 3/6] crypto: Add Qcom prng driver
Hi Stephan,

On 03-07-18, 15:28, Stephan Mueller wrote:
> Am Dienstag, 3. Juli 2018, 08:04:31 CEST schrieb Vinod Koul:
> > +static int qcom_rng_read(struct qcom_rng *rng, void *data, size_t max)
> > +{
> > + size_t currsize = 0;
> > + u32 *retdata = data;
>
> How can you be sure that this cast is appropriate? I.e. how is it guaranteed
> that data is 4-byte aligned?

While reading we check the alignment:

/* make sure we stay on 32bit boundary */
if ((max - currsize) < WORD_SZ)
break;

> Also, the data variable in qcom_rng_generate is a u8 -- shouldn't this type be
> used instead of a void?

That does make sense to me. IIRC the read is for a byte. I will check
this and update it

Thanks for the quick review
--
~Vinod

\
 
 \ /
  Last update: 2018-07-04 06:11    [W:1.646 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site