lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CACPK8XeYaRkgWfG33+3ohCPKupqCay0jPp85hdt-XybWvM1eRA@mail.gmail.com>
Date:   Tue, 23 Feb 2021 11:18:28 +0000
From:   Joel Stanley <joel@....id.au>
To:     dingsenjie@....com
Cc:     Brendan Higgins <brendanhiggins@...gle.com>,
        Benjamin Herrenschmidt <benh@...nel.crashing.org>,
        Andrew Jeffery <andrew@...id.au>,
        OpenBMC Maillist <openbmc@...ts.ozlabs.org>,
        Linux ARM <linux-arm-kernel@...ts.infradead.org>,
        linux-aspeed <linux-aspeed@...ts.ozlabs.org>,
        linux-i2c@...r.kernel.org,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        dingsenjie <dingsenjie@...ong.com>
Subject: Re: [PATCH] i2c/busses:remove unneeded variable: "ret"

On Tue, 23 Feb 2021 at 08:04, <dingsenjie@....com> wrote:
>
> From: dingsenjie <dingsenjie@...ong.com>
>
> remove unneeded variable: "ret".
>
> Signed-off-by: dingsenjie <dingsenjie@...ong.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
>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ