Received: by 10.223.176.5 with SMTP id f5csp451670wra; Wed, 7 Feb 2018 01:59:20 -0800 (PST) X-Google-Smtp-Source: AH8x226wRL1EGrnOE9Pe8X2P3NHy8xBpYLJ3jJugsXnS2vT+EsEeB5wrI2t6i6NIIbWr6LNwpyxU X-Received: by 10.101.77.195 with SMTP id q3mr4343872pgt.395.1517997560228; Wed, 07 Feb 2018 01:59:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517997560; cv=none; d=google.com; s=arc-20160816; b=0Pk2XXbSv1uz0meHFNTwg4QmfXCU1QEqq3zpVO3UvgfHY4PPkLqvSA7/h3CxE0h+4R 18gQJsk2QbyN2BCKs16Sc5KL9GDMA/aEZUrLH0AdXFb4A0JUOIPsF+M0QEnOVbuFOzZ6 Ap0+cjxVCAfbGUjJgpY1mp7ilG0379DlvkY38yFp8xTT3wJrDqPPTApDBiYh9Ik+AXA9 BDWTmaHpcKupx2yLz3sHTHI93/qM7j9bGP2G1oCXtyl/aokN4pvsuabI78fa4ig0v8Pc fT9IES7dD2GtB40gpcfbtY+MHq/IIVM5aIYlmLHX9TEZvKCAm49dWX6FFLbPM31YBtkR +yBQ== 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=QiIhgpWKYtJaXgkVtHAf/HSE9+s+1o6m/nfbb2YwSIg=; b=NHDoqYJhniTPfuBOkZblOX1FGMbGaZ/CS5VKy/qktj2GYMi8Vp1QKi9vLVkB+BSN+V i4wsCQgwHVrgRAgzWVSePfJRfTrZPtFk2gWZf2yR5KugqiNuer/L/WsVW8OztVEWmx93 bLlxPHEQl47EgCtCmcQipGfvFTnRRfjyPR//tagLag6DH6ca012C/SCr5Locqe/ECy8L mYABoyESKzQuu3fr/QrD4XsWr7m6rMtyIu2oP4A0Qe9mn2JaCVa0rW1dR4NnLUvv5ddI fHVTtiMC7pR9YqP2X0vrEl0lRwzJ7aOs2+eaCJ8k4lHyuicR5rEedg2aOe7X39bkf5wT wBDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=piwJv46z; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i1si384416pgr.255.2018.02.07.01.59.06; Wed, 07 Feb 2018 01:59:20 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=piwJv46z; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753539AbeBGJ5I (ORCPT + 99 others); Wed, 7 Feb 2018 04:57:08 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:54231 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751269AbeBGJ5H (ORCPT ); Wed, 7 Feb 2018 04:57:07 -0500 Received: by mail-wm0-f67.google.com with SMTP id t74so1995856wme.3; Wed, 07 Feb 2018 01:57:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=QiIhgpWKYtJaXgkVtHAf/HSE9+s+1o6m/nfbb2YwSIg=; b=piwJv46zDwYXM2J+JecFVRqg/SetvDGLuR69LgoAPWD5voQmTHBxE07SAlg2t4RumJ 1uV6PQuHTEPagVDQjsheKW8i9p3+FWxcu69NfdYFpl0LiaQCZkwwfmPQCUNrZY8DlCvf QA26eIz+iXzyvBqrz0Qo6XLpT4i32P7AQnz14cLX6Am3kwn7NtaCbHSsB/y3027Lw1B9 wegv4TOIsxcFEzi8TFwlwBYKFLYus1zI3ONeJ1L0yvXW+KoCU38wA/v6YEd0tDu8pdSx gWnAIIQaDKpASc8+sVKAlcEaNzZVoSc/rcZWgnsjaKf81uGenskUzg+O+qnC0cV/5EYT LNtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=QiIhgpWKYtJaXgkVtHAf/HSE9+s+1o6m/nfbb2YwSIg=; b=c4a2S1nvxB+xEp9VetaHPGluDK1NltllTk+NonftmVJxPoozG9CwGVw97RaaZoq22r JjnEFssZQyALXHjflR9IU1blTgV8bbFC7AUsdBXMR/bl+K4dVGY/HMXHPK8VgdzlFe9l 652WgNBkcHivuxk/IR4UEvxQoi2WiZrg6GL3sxKEJXpl5VlWO2OJoSyEabNdm1RhnwZb uv8YgC0uFIa88xdS4VptncDSXBYG6ZYtPlcfYVBbKqOHuIbXZ5jszLbPbuREEfIkRcJh ywaZ6pn4lsHbSaZ5M6PqeNTmr82/owINWNwZLuYR0pi9IVoK9b2VkgQvAbm9Me+YlcPj 38fA== X-Gm-Message-State: APf1xPADN+xgXvMt/7rD1E+FMTjPhhKmKO6dsU9zCZSaPyzE9ItIPfF7 kbS9q8z/nshbB/JMdzTdo4k= X-Received: by 10.28.126.138 with SMTP id z132mr4106672wmc.139.1517997421979; Wed, 07 Feb 2018 01:57:01 -0800 (PST) Received: from Red (LFbn-MAR-1-494-174.w2-15.abo.wanadoo.fr. [2.15.82.174]) by smtp.googlemail.com with ESMTPSA id 104sm807691wrl.74.2018.02.07.01.57.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Feb 2018 01:57:01 -0800 (PST) Date: Wed, 7 Feb 2018 10:56:59 +0100 From: Corentin Labbe To: Artem Savkov , herbert@gondor.apana.org.au Cc: linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] sun4i_ss_prng: fix return value of sun4i_ss_prng_generate Message-ID: <20180207095659.GA19249@Red> References: <20180206212022.1309-1-artem.savkov@gmail.com> <20180206212022.1309-2-artem.savkov@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180206212022.1309-2-artem.savkov@gmail.com> User-Agent: Mutt/1.7.2 (2016-11-26) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 06, 2018 at 10:20:21PM +0100, Artem Savkov wrote: > According to crypto/rng.h generate function should return 0 on success > and < 0 on error. > > Fixes: b8ae5c7387ad ("crypto: sun4i-ss - support the Security System PRNG") > Signed-off-by: Artem Savkov > --- > drivers/crypto/sunxi-ss/sun4i-ss-prng.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/crypto/sunxi-ss/sun4i-ss-prng.c b/drivers/crypto/sunxi-ss/sun4i-ss-prng.c > index 0d01d1624252..5754e0b92fb0 100644 > --- a/drivers/crypto/sunxi-ss/sun4i-ss-prng.c > +++ b/drivers/crypto/sunxi-ss/sun4i-ss-prng.c > @@ -52,5 +52,5 @@ int sun4i_ss_prng_generate(struct crypto_rng *tfm, const u8 *src, > > writel(0, ss->base + SS_CTL); > spin_unlock(&ss->slock); > - return dlen; > + return 0; > } > -- > 2.15.1 > According to Documentation/crypto/api-samples.rst ("Code Example For Random Number Generator Usage") you must return the length of data generated. So crypto_rng_generate/crypto_rng_get_bytes documentation in crypto/rng.h must be fixed. Herbert could you confirm ? Regards