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] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75Vf+UVMS1WOQ3KB8DiSB5KD2oFQs5ZmJ5yDPi=3i4uZVRg@mail.gmail.com>
Date:   Fri, 31 Jan 2020 17:57:34 +0200
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Calvin Johnson <calvin.johnson@....com>
Cc:     linux.cj@...il.com, Jon Nettleton <jon@...id-run.com>,
        Russell King - ARM Linux <linux@...linux.org.uk>,
        Makarand Pawagi <makarand.pawagi@....com>,
        cristian.sovaiala@....com, laurentiu.tudor@....com,
        ioana.ciornei@....com, V.Sethi@....com, pankaj.bansal@....com,
        "Rajesh V . Bikkina" <rajesh.bikkina@....com>,
        Calvin Johnson <calvin.johnson@....nxp.com>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Dmitry Torokhov <dmitry.torokhov@...il.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
        "Rafael J. Wysocki" <rafael@...nel.org>,
        Sakari Ailus <sakari.ailus@...ux.intel.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v1 5/7] device property: Introduce fwnode_phy_is_fixed_link()

On Fri, Jan 31, 2020 at 5:38 PM Calvin Johnson <calvin.johnson@....com> wrote:
>
> From: Calvin Johnson <calvin.johnson@....nxp.com>
>
> Introduce fwnode_phy_is_fixed_link() function that an Ethernet driver
> can call on its PHY phandle to find out whether it's a fixed link PHY
> or not.

> +/*
> + * fwnode_phy_is_fixed_link()
> + */

Please, do a full kernel doc description.

> +bool fwnode_phy_is_fixed_link(struct fwnode_handle *fwnode)
> +{
> +       struct fwnode_handle *fixed_node;
> +       int len, err;
> +       const char *managed;
> +
> +       fixed_node = fwnode_get_named_child_node(fwnode, "fixed-link");
> +       if (fixed_node)
> +               return fixed_node;
> +
> +       err = fwnode_property_read_string(fixed_node, "managed", &managed);

> +       if (err == 0 && strcmp(managed, "auto") != 0)
> +               return true;
> +
> +       return false;

Maybe other way around?

  if (err)
    return false;

  return !strcmp(managed, "auto");

?

Same pattern perhaps for the patch where you introduce fwnode_get_phy_mode().

> +}

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ