Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp226293lqo; Thu, 16 May 2024 04:48:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUNapzFVbMtBOQvD/DJB6jCCf2Ny9yj3R0Rbs8hggkfsVDltsrasSEaQ7ZDwW4Fp8kSjm1CWNAYIgDZAHacykos7XDXSwUsTNQo2nVoZA== X-Google-Smtp-Source: AGHT+IHPUATEjKLe/OKZI7eXXB0GdbaqhY3oQjwKBD4eYzr473fimWuZfF4U9EPuf9YZWuL/IauT X-Received: by 2002:a17:906:d159:b0:a59:a977:a15b with SMTP id a640c23a62f3a-a5a2d680d23mr1145257666b.68.1715860137489; Thu, 16 May 2024 04:48:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715860137; cv=pass; d=google.com; s=arc-20160816; b=sZtzwVjjFcNuKSbCpqoUCFn/Gpzef6UxzegcmP+LCGKFx60+s8PXnY5Yea0XCU3a9M DO4sf6eXLvm/QYYxmtaFj/Qg5miagjY4aWAmiBMApLC9/H97mDpJezVWWocMP9Lp0j1c 7Pn0DHf+vouI4tSTombA5r6iLVBbLSmjIMXMUs4STgbFDauW75HJwE4mWNnWa+gFqChj HlXUkHCSxijwRHXNdlV6xWh6idlFi6q+g4anwKsilUjjw5rwmFZjrTJnhKKaoLvCBeBg PAd6eqaB3/JQa1i5e3LCnaQJiIRGpSl1DNM3c5Svm8PwB1UDwAI/zBY5BED0aOF3I1CC 0UXQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=FyX+6EeX2zYSgDjp5p8BhJzA6/x8bIKgkLN30SXYigU=; fh=2BOf/mn0d/zdscwgtxJEJ9q6i3LtHiyapVRJqYd0lkE=; b=ttPprfLmlX0xM+7PLy3p23OdhGqNpYXXFcxOqnTLkfR0OlLrJwYZiwvpu+F3RHix+l 485kopKTAR3bEC652H8KkJJEUezXg85GfuHt7aPGWPfeL4KP+dnq0X4PZkvCxBpBrzUj RqmT4mkKCkhXzqFWL/4GftX+CrbOn/GstNsKN4/f993BT5f/dHGYb5uOcPbCFUiYHupA +a9MhpFGlmcSNIxkBIj8P2r9PJn2JUe+zrCgxDQz0MBIVH6y3G1rRObagotblh/PjHJo ZIPeHqcZrrix8+YK1PPhaMbHDKEAfX/VqlJz3fD5Terw4D5LlSwJH9PzaZl8l6sOWhU8 +hDg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=swyyqX7O; arc=pass (i=1 spf=pass spfdomain=foss.st.com dkim=pass dkdomain=foss.st.com dmarc=pass fromdomain=foss.st.com); spf=pass (google.com: domain of linux-crypto+bounces-4207-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4207-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a17b21b93si827909566b.364.2024.05.16.04.48.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 May 2024 04:48:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto+bounces-4207-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=swyyqX7O; arc=pass (i=1 spf=pass spfdomain=foss.st.com dkim=pass dkdomain=foss.st.com dmarc=pass fromdomain=foss.st.com); spf=pass (google.com: domain of linux-crypto+bounces-4207-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4207-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 395EB1F232CF for ; Thu, 16 May 2024 11:48:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A8F32145A01; Thu, 16 May 2024 11:48:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=foss.st.com header.i=@foss.st.com header.b="swyyqX7O" X-Original-To: linux-crypto@vger.kernel.org Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [185.132.182.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 869951459E2 for ; Thu, 16 May 2024 11:48:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.132.182.106 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715860131; cv=none; b=uKJHQl/vQSDvJuh0YQ9UbFqYPfTjuzcd2RRuM9ILj+kFWJG1mCmqhIkI3HMhZOcKE/SrGckuOaqkDKShoIwpg+8kOuog4CIZKvKWeEIiKoospFcLRgyhcc3svfMWNRQzdeVuZaFQRN7824hiSVs5dGg9EgW/kD865pQYv4BDXCM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715860131; c=relaxed/simple; bh=w2O7BmCT8tbRCqTEeX1EUl+Wlb/ivOo9ljHrj0hMsM0=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=MPh4JfJLtFKZHFkQGnoliKjZ8+r2RxvBImN4lHcP8afC4F5VarueSODjJdk2cQhX53507OYTXLMSIrPEP5cHfTwuk7mtwqlIWRerMFhM2yp04kdsTQ8cRm/ozv5I9VPOC6sMchTC0OPL4ZHYwSoQR5h4y5LD2QxBostP9kLnmOc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=foss.st.com; spf=pass smtp.mailfrom=foss.st.com; dkim=pass (2048-bit key) header.d=foss.st.com header.i=@foss.st.com header.b=swyyqX7O; arc=none smtp.client-ip=185.132.182.106 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=foss.st.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=foss.st.com Received: from pps.filterd (m0288072.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 44G75xZv015041; Thu, 16 May 2024 13:48:08 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h= message-id:date:mime-version:subject:to:cc:references:from :in-reply-to:content-type:content-transfer-encoding; s= selector1; bh=FyX+6EeX2zYSgDjp5p8BhJzA6/x8bIKgkLN30SXYigU=; b=sw yyqX7OpzrgCwcEqYkUTPKAjdJuxzbZPKbyE/oSVpph7W+q+0MkUL7kp3Y4iXOMQ3 ztZOX1efIXcDNYfD97e7KrJLT0rYXt976vy4NfE++5iyjg96+IufoX36K5akdCnp z2EGTfWBr5RLGLb/Wgicz7q+qfxUaE4iED5byimWT1Kevv5+BcgfwOoLNpVJUYCI x2X6mTdsYmgdC/IdS0hD5h+HTQ+HJBCUkPRmzMnrnjVcTUAIc3DceUD/dxG1FZSV eP9Cwcakx53NrZcWOuaRVX9X1o0/G/x5b6HDZbSL0AGjoQliCSKoHR+ZUxvOVtqd BzMsMl+dvvNGiecIWvOw== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3y4sxv5ehv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 16 May 2024 13:48:08 +0200 (MEST) Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 033AC4002D; Thu, 16 May 2024 13:48:01 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node1.st.com [10.75.129.69]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id E7E8F218604; Thu, 16 May 2024 13:47:14 +0200 (CEST) Received: from [10.48.87.204] (10.48.87.204) by SHFDAG1NODE1.st.com (10.75.129.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 16 May 2024 13:47:14 +0200 Message-ID: <8ec4286e-3477-4fcd-8176-5c3a6606f0a1@foss.st.com> Date: Thu, 16 May 2024 13:47:13 +0200 Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/2] hwrng: stm32 - cache device pointer in struct stm32_rng_private To: Marek Vasut , CC: =?UTF-8?Q?Uwe_Kleine-K=C3=B6nig?= , Alexandre Torgue , Herbert Xu , Maxime Coquelin , Olivia Mackall , Rob Herring , Yang Yingliang , , , References: <20240516012210.128307-1-marex@denx.de> <20240516012210.128307-2-marex@denx.de> <1e2da893-efff-4f7c-9842-a9484e4c2230@foss.st.com> <404122b2-75fe-4da6-8167-fb98eba7f941@denx.de> Content-Language: en-US From: Gatien CHEVALLIER In-Reply-To: <404122b2-75fe-4da6-8167-fb98eba7f941@denx.de> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SHFCAS1NODE2.st.com (10.75.129.73) To SHFDAG1NODE1.st.com (10.75.129.69) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.650,FMLib:17.11.176.26 definitions=2024-05-16_05,2024-05-15_01,2023-05-22_02 On 5/16/24 12:52, Marek Vasut wrote: > On 5/16/24 11:37 AM, Gatien CHEVALLIER wrote: > > Hi, > >>> diff --git a/drivers/char/hw_random/stm32-rng.c >>> b/drivers/char/hw_random/stm32-rng.c >>> index 6dec4adc49853..00012e6e4ccc8 100644 >>> --- a/drivers/char/hw_random/stm32-rng.c >>> +++ b/drivers/char/hw_random/stm32-rng.c >>> @@ -70,6 +70,7 @@ struct stm32_rng_config { >>>   struct stm32_rng_private { >>>       struct hwrng rng; >>> +    struct device *dev; >>>       void __iomem *base; >>>       struct clk *clk; >>>       struct reset_control *rst; >>> @@ -99,7 +100,7 @@ struct stm32_rng_private { >>>    */ >>>   static int stm32_rng_conceal_seed_error_cond_reset(struct >>> stm32_rng_private *priv) >>>   { >>> -    struct device *dev = (struct device *)priv->rng.priv; >>> +    struct device *dev = priv->dev; >>>       u32 sr = readl_relaxed(priv->base + RNG_SR); >>>       u32 cr = readl_relaxed(priv->base + RNG_CR); >>>       int err; >>> @@ -171,7 +172,7 @@ static int stm32_rng_conceal_seed_error(struct >>> hwrng *rng) >>>   { >>>       struct stm32_rng_private *priv = container_of(rng, struct >>> stm32_rng_private, rng); >>> -    dev_dbg((struct device *)priv->rng.priv, "Concealing seed >>> error\n"); >>> +    dev_dbg(priv->dev, "Concealing seed error\n"); >>>       if (priv->data->has_cond_reset) >>>           return stm32_rng_conceal_seed_error_cond_reset(priv); >>> @@ -187,7 +188,7 @@ static int stm32_rng_read(struct hwrng *rng, void >>> *data, size_t max, bool wait) >>>       int retval = 0, err = 0; >>>       u32 sr; >>> -    retval = pm_runtime_resume_and_get((struct device >>> *)priv->rng.priv); >>> +    retval = pm_runtime_resume_and_get(priv->dev); >>>       if (retval) >>>           return retval; >>> @@ -206,7 +207,7 @@ static int stm32_rng_read(struct hwrng *rng, void >>> *data, size_t max, bool wait) >>>                                      sr, sr, >>>                                      10, 50000); >>>               if (err) { >>> -                dev_err((struct device *)priv->rng.priv, >>> +                dev_err(priv->dev, >>>                       "%s: timeout %x!\n", __func__, sr); >> >> Nit: Fits in one line > > The limit is now 100 instead of 80 chars, right ? > > btw I found one more and fixed it. Yes it is, thanks