Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp79603imw; Thu, 7 Jul 2022 21:48:19 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sK8rVBAOWtFZ2YOwZf0aiQ7rWKB2UonS2upaTQjDFrb74fPv3GNl0kZrGkhZgkAciGWWww X-Received: by 2002:aa7:d389:0:b0:43a:56c0:c863 with SMTP id x9-20020aa7d389000000b0043a56c0c863mr2166972edq.373.1657255699415; Thu, 07 Jul 2022 21:48:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657255699; cv=none; d=google.com; s=arc-20160816; b=oHqPjGZVo4T7D1bBFjfxrFz7PmGhAo5NnSsIZTp1ravgE2IhD8vKlRqgfKPw2L+3a5 n+SKI1yWkjmuYkPIOB+Css0FlBZ7I00sQy76f8FnMNML6wqEQXDdWdMC/rW9s036YQpo sAaJEOPxLZPo5f9gDblJfB/WQpQtv7hSstjS8UGYVcdBY1okqFADauBkriooN5RUTqqJ 9OHCfHfE/ybKzRmtTrRzGm9d2iAjS2TH9p0BUvlYYfm4E7vk6SFqiKMhvu4ozDscxDzM Qq3+SYAVS623ncFeaqpFqzCsKCRCuN9/j5wjKCGhQELIo5TfVPFnYTyDQBXQPG3Igxpc 38LA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=/TH1DEH3ugKVlgLwwZhwhLtP7cgOEydE2KiN+E9aH/A=; b=lEyaDV7xm9oXb4dT4UST5Fp7iC9dc1M/vc2Se33OHcINWfHLC2ritUiKxysZXlj17c 3XUSQJtyEApuFMZQagGOAjEyy4baRB4MoFn85HMlV7BMS5+mkBna9hdtkkdDiq/9cP4g t/4x0fb4B15k7pHfsDvvHvnxE6YxACEIzLW91AIyy2X5B0G6wf7XV55ECaFPho2UOLmE epIzkLCFWKkxePB9V8b580j8zwZFYbd88TplNHBzDWzo5FtvRF4/ai0ZagEd+lTX+iBs SZsiZNAprk3LtSQS/gt7vRlih7CmMtnn8SKSX+fr2dUDEWOUazO2mcprPTwDrRlOC9AI hDPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=MUYvvC0z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hg2-20020a1709072cc200b0072a6779a9afsi22566155ejc.249.2022.07.07.21.47.51; Thu, 07 Jul 2022 21:48:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=MUYvvC0z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S235631AbiGHEp7 (ORCPT + 99 others); Fri, 8 Jul 2022 00:45:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237019AbiGHEp4 (ORCPT ); Fri, 8 Jul 2022 00:45:56 -0400 Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com [IPv6:2607:f8b0:4864:20::82b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FF46261E for ; Thu, 7 Jul 2022 21:45:54 -0700 (PDT) Received: by mail-qt1-x82b.google.com with SMTP id r2so5157124qtx.6 for ; Thu, 07 Jul 2022 21:45:54 -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; bh=/TH1DEH3ugKVlgLwwZhwhLtP7cgOEydE2KiN+E9aH/A=; b=MUYvvC0zBGI32l5G5tdnDbzHons4WfJEL3AqGOV8mpLskmYbv5/nGC1s1BJxGYmPMP IlrbpNnXmYA13jWrlfMiGXOj0AQhUtaERuEXKr3+yTgOmWZih1r7kX5v2wNW/h5aRdji 98wa7fkAZnnwwB8wJUULC8vGNgkkz6/JWAC78= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=/TH1DEH3ugKVlgLwwZhwhLtP7cgOEydE2KiN+E9aH/A=; b=Oj1cxlF+KGaEO5VqPTQ4wcccKKAm0G8TnmIMoGdcSbZJRArbZqeQ8Dypfla61U+hcT Dqsr67CtLBfg41uDH3fvzqwbpEy3VklMIcZ8bpSxeOZskm0EMgHfFSRKRK/FGLjUa+9t JzvCkF4dJ68r6/JpS1qhWf8bf+Gv+6Of4CtmlFxnte+y8lcozAFjRixkI9D/m1uwjVOw mZaDTP+fyZ9HvwgI6LJF5fyr6h71YJJ42PctczuCW8wn5uC4DjCmaJoT9GGndYkcJQ29 fLlDcX5VYPygY+NuYU5fzAgUskzrvaTURIUjde4HzvBceNWNOSQIzy2rAvZCR7w+psG+ EKXw== X-Gm-Message-State: AJIora9fLo1Cxb3pXIipZ/+8aIxvBaKSf9kNW0a1sNsyH93w3230shlR VLcmdr8sTAEz9GZeBhM6x6EgJ09nMqJ2nwLX X-Received: by 2002:a05:6214:19cc:b0:472:f402:5ba4 with SMTP id j12-20020a05621419cc00b00472f4025ba4mr1194910qvc.46.1657255553419; Thu, 07 Jul 2022 21:45:53 -0700 (PDT) Received: from mail-yb1-f170.google.com (mail-yb1-f170.google.com. [209.85.219.170]) by smtp.gmail.com with ESMTPSA id u5-20020a37ab05000000b006b4748535a1sm10005855qke.16.2022.07.07.21.45.49 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 07 Jul 2022 21:45:49 -0700 (PDT) Received: by mail-yb1-f170.google.com with SMTP id g4so36029710ybg.9 for ; Thu, 07 Jul 2022 21:45:49 -0700 (PDT) X-Received: by 2002:a25:1583:0:b0:668:e74a:995f with SMTP id 125-20020a251583000000b00668e74a995fmr1662451ybv.1.1657255548819; Thu, 07 Jul 2022 21:45:48 -0700 (PDT) MIME-Version: 1.0 References: <20220706182657.210650-1-ezequiel@vanguardiasur.com.ar> <20220706182657.210650-9-ezequiel@vanguardiasur.com.ar> In-Reply-To: <20220706182657.210650-9-ezequiel@vanguardiasur.com.ar> From: Tomasz Figa Date: Fri, 8 Jul 2022 13:45:35 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 8/8] videobuf2: Remove vb2_find_timestamp() To: Ezequiel Garcia Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Hans Verkuil , Marek Szyprowski Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Ezequiel, On Thu, Jul 7, 2022 at 3:27 AM Ezequiel Garcia wrote: > > Now that we've transitioned all users to vb2_find_buffer API, > remove the unused vb2_find_timestamp(). > > Signed-off-by: Ezequiel Garcia > --- > .../media/common/videobuf2/videobuf2-v4l2.c | 12 ++++----- > include/media/videobuf2-v4l2.h | 26 +------------------ > 2 files changed, 7 insertions(+), 31 deletions(-) > > diff --git a/drivers/media/common/videobuf2/videobuf2-v4l2.c b/drivers/media/common/videobuf2/videobuf2-v4l2.c > index 075d24ebf44c..a9696442dfba 100644 > --- a/drivers/media/common/videobuf2/videobuf2-v4l2.c > +++ b/drivers/media/common/videobuf2/videobuf2-v4l2.c > @@ -625,18 +625,18 @@ static const struct vb2_buf_ops v4l2_buf_ops = { > .copy_timestamp = __copy_timestamp, > }; > > -int vb2_find_timestamp(const struct vb2_queue *q, u64 timestamp, > - unsigned int start_idx) > +struct vb2_buffer *vb2_find_buffer(struct vb2_queue *q, u64 timestamp) > { > unsigned int i; > > - for (i = start_idx; i < q->num_buffers; i++) > + for (i = 0; i < q->num_buffers; i++) > if (q->bufs[i]->copied_timestamp && > q->bufs[i]->timestamp == timestamp) > - return i; > - return -1; > + return vb2_get_buffer(q, i); > + > + return NULL; > } > -EXPORT_SYMBOL_GPL(vb2_find_timestamp); > +EXPORT_SYMBOL_GPL(vb2_find_buffer); > > /* > * vb2_querybuf() - query video buffer information > diff --git a/include/media/videobuf2-v4l2.h b/include/media/videobuf2-v4l2.h > index 7f9ae5b39b78..5a845887850b 100644 > --- a/include/media/videobuf2-v4l2.h > +++ b/include/media/videobuf2-v4l2.h > @@ -62,22 +62,6 @@ struct vb2_v4l2_buffer { > #define to_vb2_v4l2_buffer(vb) \ > container_of(vb, struct vb2_v4l2_buffer, vb2_buf) > > -/** > - * vb2_find_timestamp() - Find buffer with given timestamp in the queue > - * > - * @q: pointer to &struct vb2_queue with videobuf2 queue. > - * @timestamp: the timestamp to find. > - * @start_idx: the start index (usually 0) in the buffer array to start > - * searching from. Note that there may be multiple buffers > - * with the same timestamp value, so you can restart the search > - * by setting @start_idx to the previously found index + 1. > - * > - * Returns the buffer index of the buffer with the given @timestamp, or > - * -1 if no buffer with @timestamp was found. > - */ > -int vb2_find_timestamp(const struct vb2_queue *q, u64 timestamp, > - unsigned int start_idx); > - > /** > * vb2_find_buffer() - Find a buffer with given timestamp > * > @@ -86,15 +70,7 @@ int vb2_find_timestamp(const struct vb2_queue *q, u64 timestamp, > * > * Returns the buffer with the given @timestamp, or NULL if not found. > */ > -static inline struct vb2_buffer *vb2_find_buffer(struct vb2_queue *q, > - u64 timestamp) > -{ > - int index = vb2_find_timestamp(q, timestamp, 0); > - > - if (index < 0) > - return NULL; > - return vb2_get_buffer(q, index); > -} > +struct vb2_buffer *vb2_find_buffer(struct vb2_queue *q, u64 timestamp); Was there any specific reason to add it as an inline initially rather than just having it close to the final shape from the very beginning? Sorry for being picky, but I find it more difficult to review this way. Best regards, Tomasz > > int vb2_querybuf(struct vb2_queue *q, struct v4l2_buffer *b); > > -- > 2.34.3 >