lkml.org 
[lkml]   [2021]   [Feb]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] i2c/busses:remove unneeded variable: "ret"
On Tue, 23 Feb 2021 at 08:04, <dingsenjie@163.com> wrote:
>
> From: dingsenjie <dingsenjie@yulong.com>
>
> remove unneeded variable: "ret".
>
> Signed-off-by: dingsenjie <dingsenjie@yulong.com>

Thanks for the patch. Instead of removing the unused variable, I think
the code could be improved to return error codes when the recovery
fails.

Cheers,

Joel

> ---
> drivers/i2c/busses/i2c-aspeed.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-aspeed.c b/drivers/i2c/busses/i2c-aspeed.c
> index 724bf30..efad900 100644
> --- a/drivers/i2c/busses/i2c-aspeed.c
> +++ b/drivers/i2c/busses/i2c-aspeed.c
> @@ -175,7 +175,6 @@ struct aspeed_i2c_bus {
> static int aspeed_i2c_recover_bus(struct aspeed_i2c_bus *bus)
> {
> unsigned long time_left, flags;
> - int ret = 0;
> u32 command;
>
> spin_lock_irqsave(&bus->lock, flags);
> @@ -232,7 +231,7 @@ static int aspeed_i2c_recover_bus(struct aspeed_i2c_bus *bus)
> out:
> spin_unlock_irqrestore(&bus->lock, flags);
>
> - return ret;
> + return 0;
>
> reset_out:
> spin_unlock_irqrestore(&bus->lock, flags);
> --
> 1.9.1
>
>

\
 
 \ /
  Last update: 2021-02-23 12:20    [W:0.031 / U:20.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site