drivers/hwtracing/coresight/coresight-tmc-core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
The variable 'ret' is initialized to 0, never modified, and returned
directly. Remove it and return 0 explicitly.
Signed-off-by: Elsanti <santiagojoseleal27@gmail.com>
---
drivers/hwtracing/coresight/coresight-tmc-core.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/hwtracing/coresight/coresight-tmc-core.c b/drivers/hwtracing/coresight/coresight-tmc-core.c
index 36599c431be6..e29012c451c5 100644
--- a/drivers/hwtracing/coresight/coresight-tmc-core.c
+++ b/drivers/hwtracing/coresight/coresight-tmc-core.c
@@ -401,7 +401,6 @@ static ssize_t tmc_crashdata_read(struct file *file, char __user *data,
static int tmc_crashdata_release(struct inode *inode, struct file *file)
{
- int ret = 0;
unsigned long flags;
struct tmc_resrv_buf *rbuf;
struct tmc_drvdata *drvdata = container_of(file->private_data,
@@ -414,7 +413,7 @@ static int tmc_crashdata_release(struct inode *inode, struct file *file)
raw_spin_unlock_irqrestore(&drvdata->spinlock, flags);
dev_dbg(&drvdata->csdev->dev, "%s: released\n", __func__);
- return ret;
+ return 0;
}
static const struct file_operations tmc_crashdata_fops = {
--
2.53.0
On Sat, 28 Feb 2026 18:23:44 -0400, Elsanti wrote:
> The variable 'ret' is initialized to 0, never modified, and returned
> directly. Remove it and return 0 explicitly.
>
>
Applied, thanks!
[1/1] drivers/hwtracing/coresight: remove unneeded variable in tmc_crashdata_release()
https://git.kernel.org/coresight/c/061c39a17136
Best regards,
--
Suzuki K Poulose <suzuki.poulose@arm.com>
On Sat, Feb 28, 2026 at 06:23:44PM -0400, Elsanti wrote:
> The variable 'ret' is initialized to 0, never modified, and returned
> directly. Remove it and return 0 explicitly.
>
> Signed-off-by: Elsanti <santiagojoseleal27@gmail.com>
Reviewed-by: Leo Yan <leo.yan@arm.com>
> ---
> drivers/hwtracing/coresight/coresight-tmc-core.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/hwtracing/coresight/coresight-tmc-core.c b/drivers/hwtracing/coresight/coresight-tmc-core.c
> index 36599c431be6..e29012c451c5 100644
> --- a/drivers/hwtracing/coresight/coresight-tmc-core.c
> +++ b/drivers/hwtracing/coresight/coresight-tmc-core.c
> @@ -401,7 +401,6 @@ static ssize_t tmc_crashdata_read(struct file *file, char __user *data,
>
> static int tmc_crashdata_release(struct inode *inode, struct file *file)
> {
> - int ret = 0;
> unsigned long flags;
> struct tmc_resrv_buf *rbuf;
> struct tmc_drvdata *drvdata = container_of(file->private_data,
> @@ -414,7 +413,7 @@ static int tmc_crashdata_release(struct inode *inode, struct file *file)
> raw_spin_unlock_irqrestore(&drvdata->spinlock, flags);
>
> dev_dbg(&drvdata->csdev->dev, "%s: released\n", __func__);
> - return ret;
> + return 0;
> }
>
> static const struct file_operations tmc_crashdata_fops = {
> --
> 2.53.0
>
>
© 2016 - 2026 Red Hat, Inc.