From: Thorsten Blum <blum@kernel.org>
To: Hadar Gat <hadar.gat@arm.com>,
Olivia Mackall <olivia@selenic.com>,
Herbert Xu <herbert@gondor.apana.org.au>
Cc: Thorsten Blum <blum@kernel.org>,
linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2] hwrng: cctrng - drop redundant initializations
Date: Thu, 1 Oct 2026 17:06:04 +0200 [thread overview]
Message-ID: <20261001150603.143696-3-blum@kernel.org> (raw)
The variables are reassigned before their initial values are read - drop
the redundant initializations.
Signed-off-by: Thorsten Blum <blum@kernel.org>
---
Changes in v2:
- Missed two redundant initializations
- v1: https://lore.kernel.org/r/20260930200139.110437-4-blum@kernel.org/
---
drivers/char/hw_random/cctrng.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/char/hw_random/cctrng.c b/drivers/char/hw_random/cctrng.c
index 51290ea345c3..be35f058f37a 100644
--- a/drivers/char/hw_random/cctrng.c
+++ b/drivers/char/hw_random/cctrng.c
@@ -91,7 +91,7 @@ static int cc_trng_pm_get(struct device *dev)
static void cc_trng_pm_put_suspend(struct device *dev)
{
- int rc = 0;
+ int rc;
rc = pm_runtime_put_autosuspend(dev);
if (rc)
@@ -208,7 +208,7 @@ static int cctrng_read(struct hwrng *rng, void *data, size_t max, bool wait)
struct cctrng_drvdata *drvdata = (struct cctrng_drvdata *)rng->priv;
struct device *dev = &(drvdata->pdev->dev);
u32 *buf = (u32 *)drvdata->circ.buf;
- size_t copied = 0;
+ size_t copied;
size_t cnt_w;
size_t size;
size_t left;
@@ -268,7 +268,7 @@ static int cctrng_read(struct hwrng *rng, void *data, size_t max, bool wait)
static void cc_trng_hw_trigger(struct cctrng_drvdata *drvdata)
{
- u32 tmp_smpl_cnt = 0;
+ u32 tmp_smpl_cnt;
struct device *dev = &(drvdata->pdev->dev);
dev_dbg(dev, "cctrng hw trigger.\n");
@@ -309,8 +309,8 @@ static void cc_trng_hw_trigger(struct cctrng_drvdata *drvdata)
static void cc_trng_compwork_handler(struct work_struct *w)
{
- u32 isr = 0;
- u32 ehr_valid = 0;
+ u32 isr;
+ u32 ehr_valid;
struct cctrng_drvdata *drvdata =
container_of(w, struct cctrng_drvdata, compwork);
struct device *dev = &(drvdata->pdev->dev);
@@ -453,7 +453,7 @@ static int cctrng_probe(struct platform_device *pdev)
{
struct cctrng_drvdata *drvdata;
struct device *dev = &pdev->dev;
- int rc = 0;
+ int rc;
u32 val;
int irq;
next reply other threads:[~2026-10-01 15:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-01 15:06 Thorsten Blum [this message]
2026-10-08 8:30 ` [PATCH v2] hwrng: cctrng - drop redundant initializations Herbert Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261001150603.143696-3-blum@kernel.org \
--to=blum@kernel.org \
--cc=hadar.gat@arm.com \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=olivia@selenic.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.