Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3784961imm; Mon, 2 Jul 2018 05:38:51 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLYFXT6XpOn1oJi5WB1hRsC6qiV1VvoyAOWRURBFGTrSQMtmd8zPUHnX0cO1dPvn02InCcx X-Received: by 2002:a65:4389:: with SMTP id m9-v6mr21581582pgp.383.1530535131116; Mon, 02 Jul 2018 05:38:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530535131; cv=none; d=google.com; s=arc-20160816; b=zz4qKyS7jWELAOORvne8EC2MnvQc7P/uOBcuH5lWmfiU5owKMRj1sYvOjhUNNgN6rQ ZwQRtIIoSFBiiqEf8HdMsKZOQ3oVQr8dpUTQLf5hKQirsuY0x0FD1sONSiLLW4zMyjMD QtRJX3f3BDQvZpMBIIUUjVWszDxb32FapI6vdkspCqnnXB2ulyKlhN9oZ4uAl9H7n5rQ oxRGw+A6hlU+6rFkBR2i1K1GnxIDYreco/xi8D1gJtX4i7KN35zoNnZlnn2Docro9/Oo 7ActqveitD3IEx2uhPNoRpr/WcZwD4naqUvaYi69ftolPihhCwLBqK1/Nxcedb3p1pPJ +1Bw== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature:arc-authentication-results; bh=yQU3tMuDY/bQf/TtO/3eYfVyACOBjWH33SHhTUiRlyA=; b=jOd0W1jPs0W/d8h5m71XhVhclaYUGoOcuivcBnTXOF/U++RC2cnuJM4pHnTHV4zgJt Zh7XJBUKJjj3ytWZCjsWwa4sKl8b4eVURM72yHfU7U83QWHP/evrxGRTBBjjwhSqwTSO MFi0Zlj1qCZSiW0WBiWS2rYUEsoTRvPGO4iuIpuTjhePrHVScc2CUBokGmZJDq5ltMcj rDI1HrD4Crxc+NrAW+/y36MlmcKCNdxVzYkoBTijPHbByMYK09X0DSeCf0rSMcmYvMeB 1ndtNo9VkN9GYXCPw8wbfTirIfKu8ksOgKVoGzK8HylgoRPsyJ//M5/F6T+tcKfD63vJ zEQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=nOapH71t; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r87-v6si2613651pfj.331.2018.07.02.05.38.36; Mon, 02 Jul 2018 05:38:51 -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=@chromium.org header.s=google header.b=nOapH71t; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964902AbeGBKFq (ORCPT + 99 others); Mon, 2 Jul 2018 06:05:46 -0400 Received: from mail-yb0-f195.google.com ([209.85.213.195]:36490 "EHLO mail-yb0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933969AbeGBKFl (ORCPT ); Mon, 2 Jul 2018 06:05:41 -0400 Received: by mail-yb0-f195.google.com with SMTP id s1-v6so4892784ybk.3 for ; Mon, 02 Jul 2018 03:05:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=yQU3tMuDY/bQf/TtO/3eYfVyACOBjWH33SHhTUiRlyA=; b=nOapH71tLALTkIfMbrHwtPY7R/N8sm503YvGCSzGlrP0amse0Cnraw1sV4YTnIQsmF ldP+iuU9ChR++iocNtor51S1KE2vrBehz+vJ88auAkmLBI/DEJBUkfzG9KPFnf606Knd jkjEbb2QS6FcYVB0UIq4DGJUZ6/NvUzRXM/Ys= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=yQU3tMuDY/bQf/TtO/3eYfVyACOBjWH33SHhTUiRlyA=; b=insaOdPAiPHD7DxTRLlsP4yfdBVOUlIR+SPu6T2jMc0o9hGIQ20wGOvEyOok3wbq82 OomVCuUf1iu7Tf8XlY2xZv6055qAwNOkeBaNU3yHkiYn59B1JN/wWMRS/ueFhG4j0fI1 55TC2LiuwjOwBHNWyPowrRQHnr2x1b9IWkqybJp6GIv5Bf/YpNACjyZfMmqwy98ktKCw VScpy6dK8ZcosRoLwsBbPMU54dJHKRBLOf5hi204XAQ/5kczct6uGk5b5pWbImH7QkVv vTmukhwW6LvylTekzM5WQyoRJ+QgP1ywgI83RPywRYYzkhmME5FU6T5SSX2e+lKdprLM /5ww== X-Gm-Message-State: APt69E0CN7U0RxfMUb4XeHfbrbmZjkiULXybpPOsRF/sHcJ5J7tL2CUt BQC5v3aDYBp8CzHjh+JsPQcZqTf/soA= X-Received: by 2002:a25:bc09:: with SMTP id i9-v6mr13273664ybh.15.1530525940420; Mon, 02 Jul 2018 03:05:40 -0700 (PDT) Received: from mail-yb0-f178.google.com (mail-yb0-f178.google.com. [209.85.213.178]) by smtp.gmail.com with ESMTPSA id f187-v6sm887365ywa.39.2018.07.02.03.05.39 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Jul 2018 03:05:39 -0700 (PDT) Received: by mail-yb0-f178.google.com with SMTP id i9-v6so1278381ybo.5 for ; Mon, 02 Jul 2018 03:05:39 -0700 (PDT) X-Received: by 2002:a25:5386:: with SMTP id h128-v6mr12281818ybb.344.1530525938673; Mon, 02 Jul 2018 03:05:38 -0700 (PDT) MIME-Version: 1.0 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> In-Reply-To: <30d141b6-dffa-bf6a-dae8-79595c966a23@linaro.org> From: Tomasz Figa Date: Mon, 2 Jul 2018 19:05:27 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 12/29] venus: add common capability parser To: Stanimir Varbanov Cc: Mauro Carvalho Chehab , Hans Verkuil , Linux Media Mailing List , Linux Kernel Mailing List , linux-arm-msm , vgarodia@codeaurora.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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=E2=80=99t we increment |word| by |= 1 + |data > >>>> size||? > >>> > >>> yes, that could be possible but the firmware packets are with variabl= e > >>> 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"? :) > 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) Best regards, Tomasz