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: <20170908193806.tgqxfltnalkuyawz@mwanda>
Date:   Fri, 8 Sep 2017 19:38:06 +0000 (UTC)
From:   Dan Carpenter <dan.carpenter@...cle.com>
To:     Badhri Jagan Sridharan <badhri@...gle.com>
Cc:     devel@...verdev.osuosl.org,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        LKML <linux-kernel@...r.kernel.org>,
        Guenter Roeck <linux@...ck-us.net>
Subject: Re: [PATCH 1/2] staging: typec: tcpm: Validate source and sink caps

On Fri, Sep 08, 2017 at 10:27:27AM -0700, Badhri Jagan Sridharan wrote:
> >> +
> >> +     for (i = 1; i < nr_pdo; i++) {
> >> +             if (pdo_type(pdo[i]) < pdo_type(pdo[i - 1])) {
> >> +                     tcpm_log_force(port,
> >> +                                    " err:PDOs should be in the following order: Fixed; Battery; Variable. pdo index:%u"
> >> +                                    , i);
> >> +                     return -EINVAL;
> >> +             } else if (pdo_type(pdo[i]) == pdo_type(pdo[i - 1])) {
> >
> > The else statement isn't needed. Pull this in one indent level.
> 
> Just to clarify, you are suggesting,
> "if (pdo_type(pdo[i]) == pdo_type(pdo[i - 1]))"
> instead of "else if (pdo_type(pdo[i]) == pdo_type(pdo[i - 1]))"
> right ?
> 

Sorry.  My bad.  We can't pull it in an indent level.

Thanks for answering the rest of my questions as well.  It's clear to
me now.

regards,
dan carpenter

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ