Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp200917lqo; Thu, 16 May 2024 03:58:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUb6GzwWM07pJu9wfqDCnRM/+25xT4DoJDS1bVcQ8ajOyKYDcNg2hwmC7IeH1ETLpCjNTJqBjSj2wouaSQkhpsn8WEv7U3w3TAciH9YkA== X-Google-Smtp-Source: AGHT+IGXB5TAriXzX3G3o+FSyL0C0FQ2TiLAhvx/X2iOBboVXvhdSaiFas7C6XkmA0tRSvJ3XI+z X-Received: by 2002:a17:90b:1258:b0:2b8:f5f1:10d9 with SMTP id 98e67ed59e1d1-2b8f5f1131cmr11009633a91.0.1715857133754; Thu, 16 May 2024 03:58:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715857133; cv=pass; d=google.com; s=arc-20160816; b=u60j2jvomtJoJ5O2sm8zH/VJ/qbMt+XwhPtC17bksf9chwDE/IBgdgytuGJfTGsddA 2xzljyEqelGwR+ZG2lEp8NDESnjZuF5EzFYMuU1ma6W7uCwlTBKZV+PGeWIHVmmY6MZT Wj4gWBNdTrymdd4C6Oxn+rlFlVjHKkEUnHjn+1IiPaekqr2+DIViQUc9htauXYsg2mna kcAAvGffkhcbODeNN33AH+nDMhEbDREEVA8BDXUzB0/fnl5l8KWJskIw1t0mfhiReOh+ 3lqZWSD5EQczVMGx/wCQvWrwjTZrFmOZQnc+qlwrnGM4x9pYQ5vnZx1Z7u50o+DlkOk6 dU+Q== 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=BGm4j+MAQe7qfEJLKK5z2ee+wgmO36NawXxM+a6a8nA=; fh=lCdqOcNalLIxgcp/evUPqLJle7cSabgGJpNHfVVR2Io=; b=YkX7M9DFjHhKQygtLRnQH43QVsW5hdS8n9rEPj1K8RqGZAS3t1eXNDAdhoFqfOiK5o EqocM2P1vQX5Zy3CpJR+SdcfGVt2ZlB19OsU2GnzFdn/q2UNeOCxRa4hKqfwjQ+Zw8AE U2lvykIyy/PaitR6kcXI69nckWSnDHLplf/dZ3GN6VAGRdfdKRkmXWTDyhhaMhJUq/vQ 8UprBpF65P2r1VICNUgcYNLkMUqcCqr0N9d2RTsjIPZnEQPnhrCbBQt4B9tezSZvwCjF xjNyhY1NPESvKsAqurlwYjw8+N07czoethS1qpuz0BpfAfx58Z/6SXHzpULlNzU82eKv +ylg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@denx.de header.s=phobos-20191101 header.b=xsKg0yQD; arc=pass (i=1 spf=pass spfdomain=denx.de dkim=pass dkdomain=denx.de dmarc=pass fromdomain=denx.de); spf=pass (google.com: domain of linux-crypto+bounces-4204-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4204-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=denx.de Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2b628868771si17394329a91.12.2024.05.16.03.58.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 May 2024 03:58:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto+bounces-4204-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@denx.de header.s=phobos-20191101 header.b=xsKg0yQD; arc=pass (i=1 spf=pass spfdomain=denx.de dkim=pass dkdomain=denx.de dmarc=pass fromdomain=denx.de); spf=pass (google.com: domain of linux-crypto+bounces-4204-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4204-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=denx.de 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id CF778B25083 for ; Thu, 16 May 2024 10:55:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C96D0145349; Thu, 16 May 2024 10:55:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=denx.de header.i=@denx.de header.b="xsKg0yQD" X-Original-To: linux-crypto@vger.kernel.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E691C143C56 for ; Thu, 16 May 2024 10:55:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=85.214.62.61 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715856929; cv=none; b=twy8x2BpZ1xAZ3laq7w6S2uSXeP6kDYEQTJ3gO2nSBUwS+BWVg3LzA++AuDbG/y6W5jHa3/RnECxLZ3TdtXMyCWg6R2PNHZMkBfYd4/k9oSnWzQO5CVeYVwp9G2Wg8Ng97369srER3J8JIG4mJl5CeIUBSY2HPREbIKXKzMKtNg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715856929; c=relaxed/simple; bh=1BQrR/D4/ofBTHHDkcwbt24he94YKvQFBsyQwJRtu8g=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=kD5yOijxvXSijrAH4H3PYb/VAtH+NYKjcGRWuMOQ3CQIzuz42U+qyko5nla915F3VEUA8BPUeOJegA2RM6eEMQZKMrUPIu+kIK4SJaOPn+24EfDhD/KVykpa5RQ6qzJI3ezLHOZh6l2vWXwWjS7T2+P/+Fm30/qMYigCkX6W9VM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=denx.de; spf=pass smtp.mailfrom=denx.de; dkim=pass (2048-bit key) header.d=denx.de header.i=@denx.de header.b=xsKg0yQD; arc=none smtp.client-ip=85.214.62.61 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=denx.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=denx.de Received: from [127.0.0.1] (p578adb1c.dip0.t-ipconnect.de [87.138.219.28]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 31B3188080; Thu, 16 May 2024 12:55:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1715856925; bh=BGm4j+MAQe7qfEJLKK5z2ee+wgmO36NawXxM+a6a8nA=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=xsKg0yQDBLIMUsiKakUMaV7SAhce4/DrXzOWuX+f3NJe7msr2rsA9OeJwSeHn9zcf 8cFO/1nGDh/1GdgADV3RN7zE2dKFrGXNthYMFOGKiIQiCNmLIwwATB9UbYT0NbvEUg tDLdWhudVfW0H+IM+iS2jzBLdv3ZGc3ZlzGn8jx0S1fgkKhlEh3qTXJl9PyMoGosNz /r8c91iE7TIVSDyJPU2JJrR6FV1v7e5R14hblgF+fdR4V1Focki0H0WsaOQ17ZmqCT JRh41rX/rpdImixcgoxn+oI8jKE9sQD8kqVpDhEa4QEBF5YSnrNFcak7Fh7dUqf7El VtZP4nhnb3j7A== Message-ID: <404122b2-75fe-4da6-8167-fb98eba7f941@denx.de> Date: Thu, 16 May 2024 12:52:22 +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: Gatien CHEVALLIER , linux-crypto@vger.kernel.org Cc: =?UTF-8?Q?Uwe_Kleine-K=C3=B6nig?= , Alexandre Torgue , Herbert Xu , Maxime Coquelin , Olivia Mackall , Rob Herring , Yang Yingliang , kernel@dh-electronics.com, linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com References: <20240516012210.128307-1-marex@denx.de> <20240516012210.128307-2-marex@denx.de> <1e2da893-efff-4f7c-9842-a9484e4c2230@foss.st.com> Content-Language: en-US From: Marek Vasut In-Reply-To: <1e2da893-efff-4f7c-9842-a9484e4c2230@foss.st.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean 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.