Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3705449imm; Mon, 2 Jul 2018 04:13:46 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcHk9G07vBiU34RwZX+C1Hm9/WAGsofAe2cRTP6WUqZfIruPopE7Xu2gAKtuSZOfmPfNnFU X-Received: by 2002:a62:3f44:: with SMTP id m65-v6mr17296509pfa.98.1530530026567; Mon, 02 Jul 2018 04:13:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530530026; cv=none; d=google.com; s=arc-20160816; b=TBmMUBd+lhHAYtb2VKpcFeh0+peOLNQqmvDlYtpmPuVMYYSm2/KvINe/B9EVx40/ZL QUnbGDNA+yfTNE2InA+QsCsrYl9P5wmFfMjBQgCAJw2f3HQFifXjvfYRCcF85FRfd8+D 5Ffknpgg2COtKIzQfnyQrzlJduC8XbrmFByhtw1fDwuObkosA/y3RICdqCHGz3N3DULJ T5U/uuv/K9ZAXmUEqjnAxIbQ/vufUIxjsmAcyOAH18IF7jjA+BZj4iKSxAcI7XE3sgfP Y4UGiLfiiV+JEChLZXFHL1IYv4VTks2UE6WGQpPiGPv/fSfdiNaAarqiy/TG6JpF3yZS METg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=EbEYDKvJQJO2HBj2i9sGl6Eh/82MVpfJrr3AUwNRZFg=; b=B9b2GTviEKabUsdPbmw8comqtC2fu85AOjt2cR20qxoQMlPN4zSBGEPoidyiqzc2mb mBfZdbO6ocjvZb/p03J76J8Zq5+oPYwJpdDCie5aPd7ApAmZHAib+EZVw89QCH6M+GoQ 67A/EUuOO20fyvI9L3y6+IyQi9n31IpI8eJZ3PyaQbcKek7RJdvVyYNd7hDnPRcp1GbO shYrhqjXzfTliZB2VGiyR2v1JkB34C29haYPWLxX2v6EV8dC2wC+RGMERPjKPradhn7k utRoFSUHIPf7Q8x0hSaM8YWs6p4tRS8lpbLcoWE9IQGg9IPdB8RVgxvW0SsPGLZLFGbs ZoWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hRUSoyWn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 89-v6si15963076plf.224.2018.07.02.04.13.32; Mon, 02 Jul 2018 04:13:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hRUSoyWn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754583AbeGBJ7P (ORCPT + 99 others); Mon, 2 Jul 2018 05:59:15 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:40588 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754559AbeGBJ7L (ORCPT ); Mon, 2 Jul 2018 05:59:11 -0400 Received: by mail-wr0-f193.google.com with SMTP id t6-v6so2565336wrn.7 for ; Mon, 02 Jul 2018 02:59:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=EbEYDKvJQJO2HBj2i9sGl6Eh/82MVpfJrr3AUwNRZFg=; b=hRUSoyWnc55a9h+GPZBKQGbzBupJvzwraRn9r45NI+ZKuNL9IaePqA/pCI3vfwMr+p /abaL9vvd3fpxOqgi7bohME2cTbfsaKWGEMrRctMgNfziQo945s+TQxLBVDYtURDdEsE L6pYqQfGK7z2xMHxkH07purj1jz4DtMr808AY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=EbEYDKvJQJO2HBj2i9sGl6Eh/82MVpfJrr3AUwNRZFg=; b=Fo5r8hd/dgYn1dsG31i2TmajqZ8Z9tpInMXT2QubqUYEC1U0XoBVeXb+BrhFcLP72C iWvaghEhxWL37Wq4XblBI0WViJN7wZjnCr041UGd5ps4njzsH6FFh3aMI73vLIwR132c 44mxXii5ZRDDN/ApyxfsggJyrWaCibz8vTlXZBldP7k+Xaq7dzcI+rzWjUc1gFKDN4Wy 0OThl6il7WYG4dMW978186CIXuCIVoMpKmMj594T67nyPC6hYDUKW/gy+kEWl5BSJYzi lo6uxh/Y6lElxkmJCwAeyzPAaIs3CXRGp6dMa2hH/aNRNHfiRVuJdva7Wa1Ab0fn5hgD at3Q== X-Gm-Message-State: APt69E2mSLxDHNVTY3e5I0ABFk/TL2X6t8Ky0N/g2Px/kZq36BRTSeNk g2xFUD6i9OyrBCPwWFYKQGVyLg== X-Received: by 2002:adf:e50f:: with SMTP id j15-v6mr8525939wrm.111.1530525550135; Mon, 02 Jul 2018 02:59:10 -0700 (PDT) Received: from [192.168.27.209] ([37.157.136.206]) by smtp.googlemail.com with ESMTPSA id 75-v6sm2502515wmn.22.2018.07.02.02.59.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Jul 2018 02:59:09 -0700 (PDT) Subject: Re: [PATCH v2 12/29] venus: add common capability parser To: Tomasz Figa Cc: Mauro Carvalho Chehab , Hans Verkuil , Linux Media Mailing List , Linux Kernel Mailing List , linux-arm-msm , vgarodia@codeaurora.org References: <20180515075859.17217-1-stanimir.varbanov@linaro.org> <20180515075859.17217-13-stanimir.varbanov@linaro.org> <13c7aec1-2bb9-f449-6b7d-7ec93be4ec71@linaro.org> From: Stanimir Varbanov Message-ID: <30d141b6-dffa-bf6a-dae8-79595c966a23@linaro.org> Date: Mon, 2 Jul 2018 12:59:07 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Tomasz, On 07/02/2018 12:23 PM, Tomasz Figa wrote: > On Thu, May 31, 2018 at 4:06 PM Tomasz Figa wrote: >> >> On Thu, May 31, 2018 at 1:21 AM Stanimir Varbanov >> wrote: >>> >>> Hi Tomasz, >>> >>> On 05/24/2018 05:16 PM, Tomasz Figa wrote: >>>> Hi Stanimir, >>>> >>>> On Tue, May 15, 2018 at 5:08 PM Stanimir Varbanov < > [snip] >>>> >>>>> + break; >>>>> + } >>>>> + >>>>> + word++; >>>>> + words_count--; >>>> >>>> If data is at |word + 1|, shouldn’t we increment |word| by |1 + |data >>>> size||? >>> >>> yes, that could be possible but the firmware packets are with variable >>> data length and don't want to make the code so complex. >>> >>> The idea is to search for HFI_PROPERTY_PARAM* key numbers. Yes it is not >>> optimal but this enumeration is happen only once during driver probe. >>> >> >> Hmm, do we have a guarantee that we will never find a value that >> matches HFI_PROPERTY_PARAM*, but would be actually just some data >> inside the payload? > > Ping? OK, you are right there is guarantee that we not mixing keywords and data. I can make parse_* functions to return how words they consumed and increment 'word' pointer with consumed words. -- regards, Stan