Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3787569imm; Mon, 2 Jul 2018 05:41:57 -0700 (PDT) X-Google-Smtp-Source: ADUXVKK95WAj+fPN1R5VtRZ3OWiObkr9SZqeLQRK2kjHlcmqxmMMGdcCny4Tsf55LrAUE7BfpI3i X-Received: by 2002:a17:902:3281:: with SMTP id z1-v6mr25947504plb.226.1530535317866; Mon, 02 Jul 2018 05:41:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530535317; cv=none; d=google.com; s=arc-20160816; b=A+4+dI4lH0snNBJgq55NSeSJkVwyIScAVvWNorMgN/3PZiJcqjxv7ZlP+PYKHYhHdD sBpr3l5NicCEKiPbPwAoJSZq+AkTK0x+Q7On1w9tniOzGdhYm0hDbKGcDdfxIzPfeiPQ 65dpQ1Q215k+0a8CfMFbrTKwGUrwn/Sx+41zi+EKr7vLQoZFj+PgcfmkFvdtTJb0kFSD PyO6Qfca5BZY1WRdnyoW0LbmGLnJVNvVeviKUoodrZYOwaNKY99t/YuWkzwkpW+PyY54 5CNuif59p7+TFyp+ACthKwdnTcMNClprH0suWGNQB4b6Sk0EaKDkpS7g4JgpDs8UvySM OW7g== 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=dV8eoZD6dWlXqtY72bE97JsOy5IYJNdX18WFyHMfNR4=; b=c95Ax7XKNHLwks/z2yQNjsCprF+RVlq56Q8tjebQm4N4PxWLmc1HUmln0rHBrP9Bxh HeoMlV9vYMGTVCTzmuIYTYXwAop7TC9YlZvn2VhwUM+V8ShGMn6Ore80r7CYdPj7ZzRk h5HcbDshvkLjZl4UWhGsp6RpfToz3EB46YXeFgTBenajWFkOj9ItcsR9+tGIJMZpIaMU Eg0gtbAcSPXyctIC0uVgaSLY1NjOAc6Uw685eifrYecbiTfEOasBwh5bJV9IMxp9IZyL WQlHcr/5ehTNx3Z2rj6Y5zbbFF7oEUWFyt70F2sBa3ZB9eO9aZqgc1OFUl67bH9RWpwD +8sQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DZ0vvZw5; 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 c2-v6si13754016pgp.134.2018.07.02.05.41.43; Mon, 02 Jul 2018 05:41:57 -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=DZ0vvZw5; 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 S934030AbeGBLAz (ORCPT + 99 others); Mon, 2 Jul 2018 07:00:55 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:45618 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932092AbeGBLAx (ORCPT ); Mon, 2 Jul 2018 07:00:53 -0400 Received: by mail-wr0-f193.google.com with SMTP id u7-v6so15077696wrn.12 for ; Mon, 02 Jul 2018 04:00:53 -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=dV8eoZD6dWlXqtY72bE97JsOy5IYJNdX18WFyHMfNR4=; b=DZ0vvZw5peXDYk3JsZ64S01Z5bP43YERa3n7eZr+Saf1jmusTw3KqnDKFk6GtXgfv0 yNMZjvvREeTdij9qQuX2d8xwgWiDGT7A8hLls7AtersrolLTL79KG8+QoHal9WvMpXW7 84AyYWQVP07REELGWP4tBoOeQr2GauC7YUiNs= 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=dV8eoZD6dWlXqtY72bE97JsOy5IYJNdX18WFyHMfNR4=; b=gqvsO2kkiNZgyprXmjL4OuDupiMrN9P7yL9vSBmA5XZ6u3HMY8XRrZaEo9p9z2IOre FBJDm8Xr5c4RRNZU6+VhpyFTFJZEj+91Np3TOQJOVzKUo4riV7XhqnHs1Kh88xhj8Atw ukDscIBO0HObhGfp0TAIBLLQc08sGGdYFB2KLzN4QatT6/QMI4BQm2/vQu2JgqjblX9M MGxl/ksawigjjBuJs0Y3eq0mfquyGpRbu7bW98gFOycws/Es7If8SkJ6YlEG9doChArp ZJ0ilrGG7zTJ4sJ4t09MwDBlMj0dv8tmD2LWvcpyw2Ye9Vq4rcc54ebnFu3+nMQgr28n xdvA== X-Gm-Message-State: APt69E166HkX5aqdG5PtU2XfZ71xP08WvSJnl7z4mNXkJNC0O0gbEB+n DS+KuZbeTksR9+KhH1O1Q2G86g== X-Received: by 2002:adf:c00b:: with SMTP id z11-v6mr18530064wre.268.1530529252307; Mon, 02 Jul 2018 04:00:52 -0700 (PDT) Received: from [192.168.27.209] ([37.157.136.206]) by smtp.googlemail.com with ESMTPSA id e126-v6sm13972966wmd.43.2018.07.02.04.00.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Jul 2018 04:00:51 -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> <30d141b6-dffa-bf6a-dae8-79595c966a23@linaro.org> From: Stanimir Varbanov Message-ID: Date: Mon, 2 Jul 2018 14:00:49 +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 01:05 PM, Tomasz Figa wrote: > On Mon, Jul 2, 2018 at 6:59 PM Stanimir Varbanov > wrote: >> >> 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 > > Did the auto-correction engine in my head got this correctly as "no > guarantee"? :) yes, your engine works better than my :) > >> data. I can make parse_* functions to return how words they consumed and >> increment 'word' pointer with consumed words. > > Yes, that or maybe just returning the pointer to the first word after > consumed data. Most of the looping functions already seem to have this > value, so it would have to be just returned. (vs having to subtract > from the start pointer) One possible issue could be with not parsed params, there I have to increment with one because the read data size is unknown. -- regards, Stan