Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp247159rdg; Thu, 12 Oct 2023 04:47:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEmFMHJhAfNLeKTKBHf8Blmejhtv42hj/343GJvO/d09ewYpNrJUy7z0Pagls0ChyeHwqDF X-Received: by 2002:a05:6e02:1d8f:b0:34c:e6e6:80d5 with SMTP id h15-20020a056e021d8f00b0034ce6e680d5mr29073090ila.26.1697111221711; Thu, 12 Oct 2023 04:47:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697111221; cv=none; d=google.com; s=arc-20160816; b=GkMqraJ/P+LmMjar5TOE6nZ2Yfxq9Yn1k2YIvqTmhDP5DvPZVfxZFuxRTqtG8g5FQA DHdar9W6eC9mvK2wUzFtMTqXeghjqszAK2Q0UahZzyVrhlK9bfhriSQq56B5wwcVLiS5 g1qrtIfc7dV62UC+33O5COSmNJxpoMm+XL5lMADXTIw0tITKjtoNrWFq3QQz3wt2Dt7N 3QWRcCZtwW0NSGA32GcYJe7ZKM5PUVPYh2ltYJ0IZshKVOMu2AcR4vTm8ai3b1wVlLae bQcspf6nekzIgknWvWgcJZXvoAak8mJ1ZnqbNi5G2mC/1kdqf1qCbGxLM8aYDkbutGLj gHiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=sj9zEzSQKjeWdQkuGM7i4Hrn4i7fVVdzvjJAu2+KTlA=; fh=ceA81l8d2hZW6pWH7VE5TwJxtgXUzAubfWIMcikPA1M=; b=Yy+t+RbMGv0fXfsYocxXCMWLBv/GHonWUhWlIWDQeuUeFoz8iCxmya4UPDkyEsZ8Ze vsDXnIh/aFsYso1ghfAzu+7VcCR5JJ35d4Jx6r1pPIS8S4hFAND5WduN931qobskfBAR z93Lq5e5S2ZsvWejXA1SaUMvz+a8j3AghkDqHExXAFOdP2q4AhwDxK+TQm1SD80dEvS8 Dh4s1M9YBffAouI0Gjd1ys1LxNutcTjQyVGa4PcNYGHoLjT1bq2w2UqAwetF/PX4Gvzq XriVyMolyYgaaKeZSMLjpoXovuOWH2QjZorO2IACj+ejtHW+FwkDS0mMoPmeoXeZjVj5 884w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=d5VYelnd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id ct7-20020a056a000f8700b0068fbd15c036si13941035pfb.286.2023.10.12.04.47.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 04:47:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=d5VYelnd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id CA5C4822CAF9; Thu, 12 Oct 2023 04:47:00 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378323AbjJLLq4 (ORCPT + 99 others); Thu, 12 Oct 2023 07:46:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343858AbjJLLqx (ORCPT ); Thu, 12 Oct 2023 07:46:53 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88FF0A9; Thu, 12 Oct 2023 04:46:51 -0700 (PDT) Received: from benjamin-XPS-13-9310.. (unknown [IPv6:2a01:e0a:120:3210:7ae7:b86d:c19a:877e]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: benjamin.gaignard) by madras.collabora.co.uk (Postfix) with ESMTPSA id C82406607346; Thu, 12 Oct 2023 12:46:49 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1697111210; bh=cMzVFA9/TUVo9VWr/5JcyqG4OOKgwWqTUUieq9IONwI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d5VYelndvKS9apDVWUIKnJDTC/LhhIBeTGDA9MCyEcBjx8JxmZG44Z+KRW1iKezgx hT+0k31ZtmSB4GRp4XSVomidcSrV7svZFsWD9NWOU4WBgCJWkYaiy8d8flhPlgcfnD lpZKNSO0qxOfHGdufAUHhmQ2jIA+62ZbInopNcSyJVVSGWAov6DU/W2UZrBJsKn5Zb eQJ4sfBNWXAUzGS4gGpxnlFXBQC6f8ePTaDhghtE6sCwOB7nafEcvKftOkLoLaMv7H OKGeCmxpiwDqKmiR1+UvwPu3ZgIgIIQyfwJnD7Gmb4V4/1pyx5HJqa+WBBaNy0zRWA VeRQ5lAdZU/hA== From: Benjamin Gaignard To: mchehab@kernel.org, tfiga@chromium.org, m.szyprowski@samsung.com, ming.qian@nxp.com, ezequiel@vanguardiasur.com.ar, p.zabel@pengutronix.de, gregkh@linuxfoundation.org, hverkuil-cisco@xs4all.nl, nicolas.dufresne@collabora.com Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-staging@lists.linux.dev, kernel@collabora.com, Benjamin Gaignard Subject: [PATCH v11 01/56] media: videobuf2: Rename offset parameter Date: Thu, 12 Oct 2023 13:45:47 +0200 Message-Id: <20231012114642.19040-2-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231012114642.19040-1-benjamin.gaignard@collabora.com> References: <20231012114642.19040-1-benjamin.gaignard@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 12 Oct 2023 04:47:01 -0700 (PDT) Rename 'off' parameter to 'offset' to clarify the code. Signed-off-by: Benjamin Gaignard --- .../media/common/videobuf2/videobuf2-core.c | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/media/common/videobuf2/videobuf2-core.c b/drivers/media/common/videobuf2/videobuf2-core.c index 27aee92f3eea..a5e57affeb30 100644 --- a/drivers/media/common/videobuf2/videobuf2-core.c +++ b/drivers/media/common/videobuf2/videobuf2-core.c @@ -356,23 +356,23 @@ static void __setup_offsets(struct vb2_buffer *vb) { struct vb2_queue *q = vb->vb2_queue; unsigned int plane; - unsigned long off = 0; + unsigned long offset = 0; if (vb->index) { struct vb2_buffer *prev = q->bufs[vb->index - 1]; struct vb2_plane *p = &prev->planes[prev->num_planes - 1]; - off = PAGE_ALIGN(p->m.offset + p->length); + offset = PAGE_ALIGN(p->m.offset + p->length); } for (plane = 0; plane < vb->num_planes; ++plane) { - vb->planes[plane].m.offset = off; + vb->planes[plane].m.offset = offset; dprintk(q, 3, "buffer %d, plane %d offset 0x%08lx\n", - vb->index, plane, off); + vb->index, plane, offset); - off += vb->planes[plane].length; - off = PAGE_ALIGN(off); + offset += vb->planes[plane].length; + offset = PAGE_ALIGN(offset); } } @@ -2185,9 +2185,9 @@ int vb2_core_streamoff(struct vb2_queue *q, unsigned int type) EXPORT_SYMBOL_GPL(vb2_core_streamoff); /* - * __find_plane_by_offset() - find plane associated with the given offset off + * __find_plane_by_offset() - find plane associated with the given offset */ -static int __find_plane_by_offset(struct vb2_queue *q, unsigned long off, +static int __find_plane_by_offset(struct vb2_queue *q, unsigned long offset, unsigned int *_buffer, unsigned int *_plane) { struct vb2_buffer *vb; @@ -2218,7 +2218,7 @@ static int __find_plane_by_offset(struct vb2_queue *q, unsigned long off, vb = q->bufs[buffer]; for (plane = 0; plane < vb->num_planes; ++plane) { - if (vb->planes[plane].m.offset == off) { + if (vb->planes[plane].m.offset == offset) { *_buffer = buffer; *_plane = plane; return 0; @@ -2304,7 +2304,7 @@ EXPORT_SYMBOL_GPL(vb2_core_expbuf); int vb2_mmap(struct vb2_queue *q, struct vm_area_struct *vma) { - unsigned long off = vma->vm_pgoff << PAGE_SHIFT; + unsigned long offset = vma->vm_pgoff << PAGE_SHIFT; struct vb2_buffer *vb; unsigned int buffer = 0, plane = 0; int ret; @@ -2335,7 +2335,7 @@ int vb2_mmap(struct vb2_queue *q, struct vm_area_struct *vma) * Find the plane corresponding to the offset passed by userspace. This * will return an error if not MEMORY_MMAP or file I/O is in progress. */ - ret = __find_plane_by_offset(q, off, &buffer, &plane); + ret = __find_plane_by_offset(q, offset, &buffer, &plane); if (ret) goto unlock; @@ -2380,7 +2380,7 @@ unsigned long vb2_get_unmapped_area(struct vb2_queue *q, unsigned long pgoff, unsigned long flags) { - unsigned long off = pgoff << PAGE_SHIFT; + unsigned long offset = pgoff << PAGE_SHIFT; struct vb2_buffer *vb; unsigned int buffer, plane; void *vaddr; @@ -2392,7 +2392,7 @@ unsigned long vb2_get_unmapped_area(struct vb2_queue *q, * Find the plane corresponding to the offset passed by userspace. This * will return an error if not MEMORY_MMAP or file I/O is in progress. */ - ret = __find_plane_by_offset(q, off, &buffer, &plane); + ret = __find_plane_by_offset(q, offset, &buffer, &plane); if (ret) goto unlock; -- 2.39.2