Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp1273891pxx; Fri, 30 Oct 2020 06:27:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz4bn2LscQKkJkpgOOPH53lz1fXijBp9WS3VNNkCnDjxVEVnJiFC/6PBg/ytEAfJ4LFCT7a X-Received: by 2002:a05:6402:cf:: with SMTP id i15mr2431861edu.246.1604064428430; Fri, 30 Oct 2020 06:27:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1604064428; cv=none; d=google.com; s=arc-20160816; b=HNu6g6RYt3u0qtwDlaW2HdTIh95YmRFnn0dvTaXIlCIsRb4tlSYFA0AZVWhx9ZzFr5 lwIbGxJISlfDr7vOqKRFMmhVFSmOFUudUKflMdjGR55qOM3DSPNSQ4xN/2z7Rk1k25ji UbNWfmxl/ALh2l40EU5xpggGHTPbbatFnTJmD+cnVMhDmw2x8XwZgyfNtExoVhE11TN1 4hxbqNYAK4bwFVMEWXhySa/i+yhq7XjfaCE5zWHUX9kH8f8l2kXAKCtfaIrqprKH9sgZ 1H/flJZdyr5crNTVKE24w7TX/q3AKMyG1FKU3bS86RlL2ZdtUEYS0XKBo9Lgf8Asg8lm 73Ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:ironport-sdr :ironport-sdr; bh=mOMPA9SzfBD/D64NpAXgx9EzzGOCCrBUTqTx8iHp9o8=; b=SSIEzGMmZANClTMH8frTfGdzA8OXAvxxZQuUvrAPmewWhPWQT8O0ix+/Qut4eFhQiW ser6ApcTqI1qtPqIG9R9GcBwKvQY2st5tTFuEpVM2AluN/rIR8aVbJ4HEoKdPfKON4Pw 3Tso0usIKruRKYYm0vHs02vO1EIdE568Axl5UJZDbRqbnfgZ0ZWmGZdn2CVC6XmPTcHq NFTRz3JhUJbBJBelHOywFnKaepuit1zsnhoQObHVXxR/5bkjON3MH5ONTml96ptUpR4i sN388fyV/51jn9EfirvxXK3xbthSnzdaXfzbHk5NkrJNKnfuHiYplFuWcJ4FL1Uzo/xr xNmw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qq8si3450429ejb.359.2020.10.30.06.26.44; Fri, 30 Oct 2020 06:27:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726438AbgJ3NZJ (ORCPT + 99 others); Fri, 30 Oct 2020 09:25:09 -0400 Received: from mga17.intel.com ([192.55.52.151]:27523 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725939AbgJ3NZJ (ORCPT ); Fri, 30 Oct 2020 09:25:09 -0400 IronPort-SDR: dMh+tfTkyEn8vJOTu0DuuFjBlZIG4AEUXWpvKdbk/J8TSxd2i/fSCpj/Rbd5K6EWv/eS1/3IIo QQJdzjlaElug== X-IronPort-AV: E=McAfee;i="6000,8403,9789"; a="148459395" X-IronPort-AV: E=Sophos;i="5.77,433,1596524400"; d="scan'208";a="148459395" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Oct 2020 06:25:08 -0700 IronPort-SDR: t3UcWjQfaGU4zZsAWFqdjNBHPA/JgDSVEapjeDVUDSZJGvXQNhEGhtY6X4/1aIbIWAW26XiBII jF9YYx3uwGPA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,433,1596524400"; d="scan'208";a="425344266" Received: from kuha.fi.intel.com ([10.237.72.162]) by fmsmga001.fm.intel.com with SMTP; 30 Oct 2020 06:25:05 -0700 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Fri, 30 Oct 2020 15:25:05 +0200 Date: Fri, 30 Oct 2020 15:25:05 +0200 From: Heikki Krogerus To: Prashant Malani Cc: linux-kernel@vger.kernel.org, Benson Leung , Enric Balletbo i Serra , Guenter Roeck Subject: Re: [PATCH 6/7] platform/chrome: cros_ec_typec: Parse partner PD ID VDOs Message-ID: <20201030132505.GC2333887@kuha.fi.intel.com> References: <20201021205317.708008-1-pmalani@chromium.org> <20201021205317.708008-7-pmalani@chromium.org> <20201028131633.GA2026875@kuha.fi.intel.com> <20201028201135.GA3913249@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201028201135.GA3913249@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 28, 2020 at 01:11:35PM -0700, Prashant Malani wrote: > 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? Yes. Thanks. Br, -- heikki