Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp357817imm; Tue, 3 Jul 2018 21:12:02 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfNBQBDI6j8yRtBjV8fnBeaajG8vdD5UBas3Xnmt/ibV+YNhFGtJbGTEURdxTA6L+PCwuMT X-Received: by 2002:a65:4541:: with SMTP id x1-v6mr426949pgr.26.1530677522630; Tue, 03 Jul 2018 21:12:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530677522; cv=none; d=google.com; s=arc-20160816; b=NpjX+kk46VSMAQa+yhKs4zS55SY7tJbrcrlxw5P9EKMiCbMhl/jKNglf9muow8JjeC +YR1bqlGD7nJjJtKUP0loAn6k3Sz+zZucJQCzXJ0eJGSN4UTUgnODOk0JMX5UzYg6Eub tYH5Sc5ZBhNmIfJA5XTLAnhGnkRR9zvaThG5g9HbQdqMoP0FNIFl2mb6pUjElpQhfZGm T6boQyG1uskwAHvWmCDi3vEVyqlRo0MKc64P/En20Yl/ARoVCmBg2bz1INH5o1S0lrAD Y5eoYCadTecmtMdKzYKY/av/VndD4g1J3CKv+laMMQDChBuVsLFld360gnRReKIu3VoR QduQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=k0aVyNIeJWsZcN7RnKFlBZLZY2aj79EcI3CUYyDwk0U=; b=K7J/c70Zemw+XJqG5UODjY+OjVC2GnethWeVfF6PrciCxLAjb+UzZQn4ihYTsii3g+ OzGYIr9668c3XzxyQJDXvOlJ5bcwHA0UQDcRySFZR529VBEXcfOq0JjZIPl/dSJG3zaL Ft+kmJNyliJgvd6VIazSRU3Yybopj62gqVUpGg7J9Er9y0S1GFwSLnqaOL3Kb+EuK++N xqR5zmdfxGlDHK/pPUEXDh7+X/W5fEeIrpVsNYMExxO+CqCHHPIiSSwd9qDA7gNpbNPC /Da2PapGPQWip8f259Js3SmWwq4HSpGqRQCTwtoQQxJWGXddB79XrkmG0bI1y62oVAD2 F0mQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=mEYk7iye; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b4-v6si2403221pgw.50.2018.07.03.21.11.48; Tue, 03 Jul 2018 21:12:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=mEYk7iye; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753655AbeGDELM (ORCPT + 99 others); Wed, 4 Jul 2018 00:11:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:55964 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753617AbeGDELH (ORCPT ); Wed, 4 Jul 2018 00:11:07 -0400 Received: from localhost (unknown [171.76.122.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9E85C246FD; Wed, 4 Jul 2018 04:11:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1530677467; bh=Rx/mz+J1tDUUF4Kz4bE+DhONcLWbfL5Q9EWEjVjqb6Q=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=mEYk7iyeTnN+1qCZwzc/fR3ZpeqKav7UUDzNkoK/u747h2U1y7nJxxKb0RNHIby5P 27rtmWQXZyeEGKdkC8Yr6R7t/AVW4Aut9s+/080aR6DHD8OBrMbTTO9rzyj0xfITeZ BgPLzZJbVVB0yqnjNiAKUudL2jy0Npx+ty62FozQ= Date: Wed, 4 Jul 2018 09:40:59 +0530 From: Vinod To: Stephan Mueller Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Andersson , Matt Mackall , Herbert Xu , Arnd Bergmann , Greg Kroah-Hartman , linux-arm-msm@vger.kernel.org, Stephen Boyd , Timur Tabi Subject: Re: [PATCH v3 3/6] crypto: Add Qcom prng driver Message-ID: <20180704041059.GT22377@vkoul-mobl> References: <20180703060434.19293-1-vkoul@kernel.org> <20180703060434.19293-4-vkoul@kernel.org> <2990655.vKmMgW600W@tauon.chronox.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2990655.vKmMgW600W@tauon.chronox.de> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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