[PATCH 20/36] stm class: remove conditional return with no effect
From: Sang-Heon Jeon
Date: Thu Jul 23 2026 - 14:58:34 EST
Both branches of the check return the same value, so the check has
no effect. Remove it and return the value directly.
This is the result of running the Coccinelle script from
scripts/coccinelle/misc/cond_return_no_effect.cocci.
Signed-off-by: Sang-Heon Jeon <ekffu200098@xxxxxxxxx>
---
drivers/hwtracing/stm/core.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/drivers/hwtracing/stm/core.c b/drivers/hwtracing/stm/core.c
index f48c6a8a0654..edf3d69a84a9 100644
--- a/drivers/hwtracing/stm/core.c
+++ b/drivers/hwtracing/stm/core.c
@@ -602,17 +602,11 @@ static ssize_t notrace
stm_write(struct stm_device *stm, struct stm_output *output,
unsigned int chan, const char *buf, size_t count, struct stm_source_data *source)
{
- int err;
-
/* stm->pdrv is serialized against policy_mutex */
if (!stm->pdrv)
return -ENODEV;
- err = stm->pdrv->write(stm->data, output, chan, buf, count, source);
- if (err < 0)
- return err;
-
- return err;
+ return stm->pdrv->write(stm->data, output, chan, buf, count, source);
}
static ssize_t stm_char_write(struct file *file, const char __user *buf,
--
2.43.0