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:   Thu, 14 Oct 2021 15:17:08 +0000
From:   "Nguyen, Anthony L" <anthony.l.nguyen@...el.com>
To:     "kuba@...nel.org" <kuba@...nel.org>
CC:     "Machnikowski, Maciej" <maciej.machnikowski@...el.com>,
        "richardcochran@...il.com" <richardcochran@...il.com>,
        "Mekala, SunithaX D" <sunithax.d.mekala@...el.com>,
        "davem@...emloft.net" <davem@...emloft.net>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [PATCH net-next 3/4] ice: Add support for SMA control multiplexer

On Wed, 2021-10-13 at 16:19 -0700, Jakub Kicinski wrote:
> On Tue, 12 Oct 2021 09:31:52 -0700 Tony Nguyen wrote:
> > From: Maciej Machnikowski <maciej.machnikowski@...el.com>
> > 
> > E810-T adapters have two external bidirectional SMA connectors and
> > two
> > internal unidirectional U.FL connectors. Multiplexing between U.FL
> > and
> > SMA and SMA direction is controlled using the PCA9575 expander.
> > 
> > Add support for the PCA9575 detection and control of the respective
> > pins
> > of the SMA/U.FL multiplexer using the GPIO AQ API.
> 
> > +static int
> > +ice_get_pca9575_handle(struct ice_hw *hw, u16 *pca9575_handle)
> > +{
> > +       struct ice_aqc_get_link_topo *cmd;
> > +       struct ice_aq_desc desc;
> > +       int status;
> > +       u8 idx;
> > +
> > +       if (!hw || !pca9575_handle)
> > +               return -EINVAL;
> 
> Looks like purest form of defensive programming, please drop this.
> 
> > +bool ice_is_pca9575_present(struct ice_hw *hw)
> > +{
> > +       u16 handle = 0;
> > +       int status;
> > +
> > +       if (!ice_is_e810t(hw))
> > +               return false;
> > +
> > +       status = ice_get_pca9575_handle(hw, &handle);
> > +       if (!status && handle)
> > +               return true;
> > +
> > +       return false;
> > +}
> 
>         return !status && handle;

Thanks for the review Jakub. Will make these adjustments as well as the
one from patch 4.

-Tony

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ