Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp259380pxx; Thu, 29 Oct 2020 01:46:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyRx68CKZwhB81cjZqiLReK13OpocIBB+moZAPtIu6dAJAAsYT+Dy8d0Mb83xNa6npMO/AM X-Received: by 2002:a17:906:6453:: with SMTP id l19mr2998816ejn.366.1603961193783; Thu, 29 Oct 2020 01:46:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603961193; cv=none; d=google.com; s=arc-20160816; b=rHHvHY/oTY8t4tRIXdt6GYoC1lTkHZZnky/CE3NowUfYt9A0hlOFCV4IHEZsDMTAMe v0AiwmoIXWfngjXZVhRKf8IFu/DEJ6dggC1QqKYP3PUZoC6ony2y3c8xl2NVxqjvUwJo liKSC8pEe7HrDHQ8Wo8jNgJa99WNvaY12xot72phYBQhyGmlnjXK44E7AF1FPiip4dzQ ChDcmMw9uQps5zb3FripFsKBjtR2B05+Z63jYZLsEEs1Ti4wDWFUULEmXyynKv2tK8jC TdqjmX+4vDId0scLVnQvCVrQMUlVs/JApq9Ur8Sfwtok3Qhl9ISuA/FrB7y7m1ov2gN5 Iflw== 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:dkim-signature; bh=tKIGBxSmn3rugAetd5KJVZleOctBFQ6YAeyg0+yYtzE=; b=ZLdfvOEaoSbb8+u5uy37gO9r0WJ4/K+BwJfovYADD9a3iloMbstAR2XirCIqAlSV1w 0KCOwgjUtHgcTc7L+WkvGr0zFVJV3wfGwx+JRInzRozKPpFfYPxX2SXuSdy4tj06Qvsb p6LOc0aYjpBjeK7X8N8qNVE3+hchSFrrk0r47rGHY0Xci5JdWqqQmJoA31YnexUykUuE DWUGEQg8kGl1I+jwAj3Nj0qdEN5hiF3ty5ZZZUu0JvELRwFkCUISwDVg56aBY58sfnqL DQR1h2xy5O+A8ovRZXN9ee85KxZhlktzpR4rhsFErjZssWoTrMLZfgU9M+xM9umTavzF 8QGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=hLp75HXJ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o6si2239456edi.560.2020.10.29.01.46.12; Thu, 29 Oct 2020 01:46:33 -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; dkim=pass header.i=@chromium.org header.s=google header.b=hLp75HXJ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732767AbgJ2BWM (ORCPT + 99 others); Wed, 28 Oct 2020 21:22:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729634AbgJ1WEz (ORCPT ); Wed, 28 Oct 2020 18:04:55 -0400 Received: from mail-il1-x143.google.com (mail-il1-x143.google.com [IPv6:2607:f8b0:4864:20::143]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F831C0613CF for ; Wed, 28 Oct 2020 15:04:55 -0700 (PDT) Received: by mail-il1-x143.google.com with SMTP id p10so1066341ile.3 for ; Wed, 28 Oct 2020 15:04:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=tKIGBxSmn3rugAetd5KJVZleOctBFQ6YAeyg0+yYtzE=; b=hLp75HXJoi1yVHo2at7snNjLCNnkf4+5rvP+rOIxyDFecNu+TcGWs7XcvBLLyeiVWS ObEdXXZwd+pRAPOf0hAobEAQBun9Ep55XE0GPdpGMg/JnvKjKFuSl5XUk4GybIBi69Jv QjhQG1Lnnywc4X/29FZnymNiTtNLhbEYaDAo4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=tKIGBxSmn3rugAetd5KJVZleOctBFQ6YAeyg0+yYtzE=; b=jSOSiGDq/gL2t4vokY2R90PC0PKlgxL5On8WIzE3UhpySbe9MVGgIsm4Aa9Fmfsw+l LFdK4tAwsl6LX0sx7c1wT+19ToOexcxuVhluhEHYKTf586hebKAeZhVbeNt/9YCLoLJ5 C52TaNz0lskW084isCfeWBQdAhOcmH5U6sUs3g0eT0nuR99jVnr47aUZrV+QFGu8L4bp E10lytwVFANjDjy0ZHLMZ3nrXb1p45qYePokAWsGlhqy7zsvaLSwYV4siSgpNDeVhYP9 RMvq/iM/0TJ4JMWfnkZVV3atgjbBRS6/Sut59iPQ9JMLR5UkwnVlEU58gICOdViDQ0le 7nWw== X-Gm-Message-State: AOAM530EH7u1X4EJkeKdx5JYvdPHNTtBSn5oe6SJNC5xCMWApNQKH/SP LWl6tnMg+uFjnUka6NkTOTrX8xJ858xk0Q== X-Received: by 2002:a63:6c09:: with SMTP id h9mr953122pgc.214.1603915897192; Wed, 28 Oct 2020 13:11:37 -0700 (PDT) Received: from google.com ([2620:15c:202:201:a28c:fdff:fef0:49dd]) by smtp.gmail.com with ESMTPSA id n6sm222409pjj.34.2020.10.28.13.11.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Oct 2020 13:11:36 -0700 (PDT) Date: Wed, 28 Oct 2020 13:11:35 -0700 From: Prashant Malani To: Heikki Krogerus 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: <20201028201135.GA3913249@google.com> References: <20201021205317.708008-1-pmalani@chromium.org> <20201021205317.708008-7-pmalani@chromium.org> <20201028131633.GA2026875@kuha.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201028131633.GA2026875@kuha.fi.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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