public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Prashant Malani <pmalani@chromium.org>
To: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Cc: linux-kernel@vger.kernel.org, Benson Leung <bleung@chromium.org>,
	Enric Balletbo i Serra <enric.balletbo@collabora.com>,
	Guenter Roeck <groeck@chromium.org>
Subject: Re: [PATCH 6/7] platform/chrome: cros_ec_typec: Parse partner PD ID VDOs
Date: Wed, 28 Oct 2020 13:11:35 -0700	[thread overview]
Message-ID: <20201028201135.GA3913249@google.com> (raw)
In-Reply-To: <20201028131633.GA2026875@kuha.fi.intel.com>

Hi Heikki,

Thanks a lot for reviewing the patch!

On Wed, Oct 28, 2020 at 03:16:33PM +0200, Heikki Krogerus wrote:
> > +
> > +	/* Copy the remaining identity VDOs till a maximum of 6. */
> > +	for (i = 3; i < sop_disc->identity_count && i < VDO_MAX_OBJECTS; i++)
> > +		port->p_identity.vdo[i - 3] = sop_disc->discovery_vdo[i];
> 
> Why do you need to put the product type VDOs in reverse order?

The Chrome EC returns all the Identity VDOs as an array of 6 VDOs (the
discovery_vdo[] array). The first three entries are assigned to the
pd_identity.{id_header,cert_stat,product} members.

This for loop assigns the next three discovery_vdo entries (i.e indices
3-5) to pd_identity.vdo[0-2] respectively.

The "i-3" is because discovery_vdo[3] corresponds to pd_identity.vdo[0]
and so on.

Does that help to clarify the for loop?

Best regards,

Prashant

  parent reply	other threads:[~2020-10-29  1:22 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-21 20:53 [PATCH 0/7] platform/chrome: cros_ec_typec: Register partner PD information Prashant Malani
2020-10-21 20:53 ` [PATCH 1/7] platform/chrome: cros_ec_typec: Relocate set_port_params_v*() functions Prashant Malani
2020-10-21 20:53 ` [PATCH 2/7] platform/chrome: cros_ec_typec: Fix remove partner logic Prashant Malani
2020-10-21 20:53 ` [PATCH 3/7] platform/chrome: cros_ec_typec: Clear partner identity on device removal Prashant Malani
2020-10-21 20:53 ` [PATCH 4/7] platform/chrome: cros_ec: Import Type C host commands Prashant Malani
2020-10-21 20:53 ` [PATCH 5/7] platform/chrome: cros_ec_typec: Introduce TYPEC_STATUS Prashant Malani
2020-10-21 22:54   ` kernel test robot
2020-10-21 23:50     ` Prashant Malani
2020-10-27 14:27   ` kernel test robot
2020-10-27 14:27   ` [RFC PATCH] platform/chrome: cros_ec_typec: cros_typec_cmds_supported() can be static kernel test robot
2020-10-27 17:52   ` [PATCH 5/7] platform/chrome: cros_ec_typec: Introduce TYPEC_STATUS kernel test robot
2020-10-21 20:53 ` [PATCH 6/7] platform/chrome: cros_ec_typec: Parse partner PD ID VDOs Prashant Malani
     [not found]   ` <20201028131633.GA2026875@kuha.fi.intel.com>
2020-10-28 20:11     ` Prashant Malani [this message]
2020-10-30 13:25       ` Heikki Krogerus
2020-10-21 20:53 ` [PATCH 7/7] platform/chrome: cros_ec_typec: Register partner altmodes Prashant Malani
     [not found]   ` <20201028131732.GB2026875@kuha.fi.intel.com>
2020-10-29 22:11     ` Prashant Malani

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201028201135.GA3913249@google.com \
    --to=pmalani@chromium.org \
    --cc=bleung@chromium.org \
    --cc=enric.balletbo@collabora.com \
    --cc=groeck@chromium.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox