Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757253AbdIHV4R (ORCPT ); Fri, 8 Sep 2017 17:56:17 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:21166 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757069AbdIHV4P (ORCPT ); Fri, 8 Sep 2017 17:56:15 -0400 USER-AGENT: NeoMutt/20170113 (1.7.2) MIME-Version: 1.0 Message-ID: <20170908193806.tgqxfltnalkuyawz@mwanda> Date: Fri, 8 Sep 2017 19:38:06 +0000 (UTC) From: Dan Carpenter To: Badhri Jagan Sridharan Cc: devel@driverdev.osuosl.org, Greg Kroah-Hartman , LKML , Guenter Roeck Subject: Re: [PATCH 1/2] staging: typec: tcpm: Validate source and sink caps References: <20170908012214.19047-1-Badhri@google.com> <20170908093404.7dfikzfgrcytvbp7@mwanda> In-Reply-To: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Source-IP: aserv0021.oracle.com [141.146.126.233] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 928 Lines: 25 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