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]
Date:	Mon, 13 Aug 2012 16:07:50 +0200
From:	Linus Walleij <linus.walleij@...aro.org>
To:	Richard Genoud <richard.genoud@...il.com>
Cc:	Jiri Kosina <trivial@...nel.org>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] trivial: pinctrl core: remove extraneous code lines

On Fri, Aug 10, 2012 at 4:53 PM, Richard Genoud
<richard.genoud@...il.com> wrote:

> In function pinctrl_get_locked, pointer p is returned on error, and also
> return on no_error.
> So, we just return it with no error test.
>
> It's pretty the same in function pinctrl_lookup_state_locked: state is
> returned in every case, so we drop the error test and just return state.
>
> Signed-off-by: Richard Genoud <richard.genoud@...il.com>

Applied. While I sort of agree with Stephen on the point of the
second hunk being cleaner as it was, it's no big deal so whatever.

I took this opportunity to cut some parens tho:

@@ -657,11 +657,7 @@ static struct pinctrl *pinctrl_get_locked(struct
device *dev)
        if (p != NULL)
                return ERR_PTR(-EBUSY);

-       p = create_pinctrl(dev);
-       if (IS_ERR(p))
-               return p;
-
-       return p;
+       return create_pinctrl(dev);
 }

 /**
@@ -738,11 +734,8 @@ static struct pinctrl_state
*pinctrl_lookup_state_locked(struct pinctrl *p,
                        dev_dbg(p->dev, "using pinctrl dummy state (%s)\n",
                                name);
                        state = create_state(p, name);
-                       if (IS_ERR(state))
-                               return state;
-               } else {
-                       return ERR_PTR(-ENODEV);
-               }
+               } else
+                       state = ERR_PTR(-ENODEV);
        }


Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ