From patchwork Mon Apr 15 19:34:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13630636 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6A748C00A94 for ; Mon, 15 Apr 2024 19:38:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=xNjicHf+zsceSbuh7TRHBb+cIGNS/vI0TUFLfXM8B9U=; b=Q7kjiECdREW+57 UQcE6RqcM0yH6gTkv18ng08nqG7hPWxAEGs/i21UdQXq8oiA3wjdRvQ0HjzLCOCnUnYbv0IL8uLOI mxux2N8TGfxvwyNNK9+kREnZPtH4LZywbgswAX0Ngi3vf/O422v57M1IGLHn6p3fHIZrSsVx/4g4E HyEb/XlyQej+y94PiN0p669ESH22xGMUmPEIZya/WcDun64DJbMToYfEEZXim3Db9wqwJyWy2MWqm QGttd83ciTCXswCy5GAVBtUIXCqfQEVX/NtQHv3+7jRlIMknaHu5bVVdb284Ep/HGI8DDZsz3Jph/ BzMrff02vNBG0Zukdd1w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS9i-00000009eAY-2e8W; Mon, 15 Apr 2024 19:38:18 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS6Z-00000009cIS-24Jp for linux-arm-kernel@bombadil.infradead.org; Mon, 15 Apr 2024 19:35:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=LUBi0S9+ghcjER4xO9v0racZxhYV4zff+IOh7tdBF3Y=; b=M1ZxqYOzbRMkwvuwAIzPIFQIKy o73neqj8fMO9o+JXvKVEKPRXrfaSEsGXL3BLgRxFZ6/bvHALHT8c+GM6ZZ8fBwBrfM2F1AA1TLhvH tdyCN5jquRmweRr6JZxdtUP5fWOQx8nVqG4BZF6FHTWbH/NB92tvFsCJhapepbcyw5RQy+fRZAUNa SEHFEtE+cYcdgMQPq3Xz2+qIT6UC4Ets1/svkFzoao2TaEc+E6CcKdyRed2K5jHURXa9h68OIwbuL LNhdSreCJw8mb6GLozDwrR7qWghX0JEL2PfG6LqCC1TcZrI+C8dsd2JuhXSylM8c/MBzj2jrU8h6z 8MMJbbKA==; Received: from mail-qk1-x72d.google.com ([2607:f8b0:4864:20::72d]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS6T-0000000AikN-2il4 for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 19:35:01 +0000 Received: by mail-qk1-x72d.google.com with SMTP id af79cd13be357-78d61a6229bso247229385a.0 for ; Mon, 15 Apr 2024 12:34:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713209696; x=1713814496; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=LUBi0S9+ghcjER4xO9v0racZxhYV4zff+IOh7tdBF3Y=; b=XYY6D/EOMyD5Xl5MJDrtkwuYiqbGLSGhoZGoN5QnisiSDAz68C66D8TgRqAQbhVJqb 2Zhj7t6fzkYvYx2ERmIU/00QliHyRFneT2O1q1WztOW//FAEoW4boaH7dKo9gFn53JcN 49e6Z1/Bmoaqvb+p5hued8KRy7sH5cng0u5e4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713209696; x=1713814496; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LUBi0S9+ghcjER4xO9v0racZxhYV4zff+IOh7tdBF3Y=; b=Q1jEey9eMMA3jlsYnKUrs7T26PAOrYa1u+1Xqnai+++CoM7x4NCablgPqM9EUIcRoi VLg4Aqf9S+evXqlnCfMKadDZaFhiaUhQgKEjouW6gCs/G3dctn7EOxL0L84WtEZaYcPS pYmy5bcVyIoa6UriPukrOjsZi3JErU2ohCMM8EHp+Nyam8RswcYKXEpQxTmhCM8AGy5P pldM2qaq9CkfC8t9Kl2VdpHevlgK6xmIp2Alon0DZRf+dBT53cV6hmnM6p0KlCC73kXW Rk+dblx/Zii/sWJmUMgDRNfTWYF2Kh0NLWeBYXWQRA5+UUhiQz51GPdaD8ylxLxaMBvX JjTw== X-Forwarded-Encrypted: i=1; AJvYcCVrv3NtgbqxK6xm4EufQZk+UA/w/LOYZ5PMZV7VOypKfRkqxREJDL/lzp7vt3JXD0WiLov5IENtxGIBkMlwNnxGjAE0G9d+Zfz/dtYIiEzdgKEL4IU= X-Gm-Message-State: AOJu0Yxo+DwOmDgw3U0FrOU5PTrlkAX5dlqXZUC2DREdfeRRkIoA4XQj foE/DOhzi5krIGPQr+4UOzW8MJkF/ktwjzTc7O1g0rSKCU2jHSnFJ7b933IW+Q== X-Google-Smtp-Source: AGHT+IENHla9VOs9zol9LIJSv1150+DgeHz4OsMQu2kACgbSSAPw34HTPzLa823VVZ1Js6TnsSST2Q== X-Received: by 2002:ae9:ec08:0:b0:78e:df14:19dc with SMTP id h8-20020ae9ec08000000b0078edf1419dcmr4888734qkg.20.1713209696184; Mon, 15 Apr 2024 12:34:56 -0700 (PDT) Received: from denia.c.googlers.com (114.152.245.35.bc.googleusercontent.com. [35.245.152.114]) by smtp.gmail.com with ESMTPSA id s26-20020ae9f71a000000b0078d3b54eb76sm6718055qkg.78.2024.04.15.12.34.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:34:55 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 15 Apr 2024 19:34:42 +0000 Subject: [PATCH 25/35] media: venus: Use the correct div_ function MIME-Version: 1.0 Message-Id: <20240415-fix-cocci-v1-25-477afb23728b@chromium.org> References: <20240415-fix-cocci-v1-0-477afb23728b@chromium.org> In-Reply-To: <20240415-fix-cocci-v1-0-477afb23728b@chromium.org> To: Martin Tuma , Mauro Carvalho Chehab , Laurent Pinchart , Hans Verkuil , Hugues Fruchet , Alain Volmat , Maxime Coquelin , Alexandre Torgue , Paul Kocialkowski , Greg Kroah-Hartman , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Sakari Ailus , Thierry Reding , Jonathan Hunter , Sowjanya Komatineni , Luca Ceresoli , Matthias Brugger , AngeloGioacchino Del Regno , Hans Verkuil , Sergey Kozlov , Abylay Ospan , Ezequiel Garcia , Dmitry Osipenko , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio , Benjamin Mugnier , Sylvain Petinot , Jacopo Mondi , Kieran Bingham , Laurent Pinchart , =?utf-8?q?Ni?= =?utf-8?q?klas_S=C3=B6derlund?= , Pavel Machek Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-staging@lists.linux.dev, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, Ricardo Ribalda X-Mailer: b4 0.12.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240415_203458_657339_F3782ABC X-CRM114-Status: GOOD ( 13.25 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org us_per_frame does not fit in u32 Found with cocci: drivers/media/platform/qcom/venus/venc.c:418:1-7: WARNING: do_div() does a 64-by-32 division, please consider using div64_u64 instead. Signed-off-by: Ricardo Ribalda --- drivers/media/platform/qcom/venus/venc.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c index 3ec2fb8d9fab..de06e1712d09 100644 --- a/drivers/media/platform/qcom/venus/venc.c +++ b/drivers/media/platform/qcom/venus/venc.c @@ -393,7 +393,7 @@ static int venc_s_parm(struct file *file, void *fh, struct v4l2_streamparm *a) struct venus_inst *inst = to_inst(file); struct v4l2_outputparm *out = &a->parm.output; struct v4l2_fract *timeperframe = &out->timeperframe; - u64 us_per_frame, fps; + u64 us_per_frame; if (a->type != V4L2_BUF_TYPE_VIDEO_OUTPUT && a->type != V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) @@ -414,11 +414,8 @@ static int venc_s_parm(struct file *file, void *fh, struct v4l2_streamparm *a) if (!us_per_frame) return -EINVAL; - fps = (u64)USEC_PER_SEC; - do_div(fps, us_per_frame); - + inst->fps = div64_u64(USEC_PER_SEC, us_per_frame); inst->timeperframe = *timeperframe; - inst->fps = fps; return 0; }