Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1653476lqp; Mon, 15 Apr 2024 12:44:25 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXgzyvKgfxQBjUYjryQaucPztiZoOoygeB3/s0LwerJ7E7xr5OEouNI/vnfMqcVTkwFMrqESnSzII+nvbxJpKnn4yqLHaS83SIk89fIdw== X-Google-Smtp-Source: AGHT+IERpznSAN/z41akBCQPJTJsKgeintFpCoL+vbY9RV8VSWfyiXci1noog94N5/Q5n+FzP9au X-Received: by 2002:a05:6808:4e:b0:3c5:dd52:fd6f with SMTP id v14-20020a056808004e00b003c5dd52fd6fmr12488641oic.31.1713210265129; Mon, 15 Apr 2024 12:44:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713210265; cv=pass; d=google.com; s=arc-20160816; b=DUKe24XOnJgu1rbGbxtUwpgg95caU+/tYIqxnjECWtNJq62D+3d2fpDqy6BAdEESGG j0BnmNTZXjBqO0rbRIJT5LnaQGIt+uXks5e9PMgH0OLUAr+7q2t6RrMegd2r9mzjbVUE ybJDrVMs4ONAqSztrnmvceODCl2zUiAa9y1Cozz1nL3u5+7UptIQQ7DnxAyqSwekKJ3j bnJs2bWy8zgsmv+EpxaL6c4JOKu/TVDT249DBXMI4C3dkxE5rmAS1/9E9z+FXSv/OMsN bli1DZiMHYXPYydmx4Hbc8CjWfg0oneSRILtKouRlLAtzSKVclqpUk8akYow+gdD3L/A XPIA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=LUBi0S9+ghcjER4xO9v0racZxhYV4zff+IOh7tdBF3Y=; fh=kGGCpTp0VwJ/lO7s3vhZ3TNxdgxwq7LjsSyehSkNllY=; b=zyY6YT472yhYBWh0iowW+Qn/r8wWIGox3J7SVDDku46G3D4xefte+W7i1HF5rMztPe DHU4IYlQdtnSxkg0XN6okUFsmaoV//7ymcOgXCfnhWtgd3BLcJeuiAGYxV1Z6uFvfJQo Bn+vyxBhaBu4OuG0W7JVY1+YaMaRBi9YYZ0r3FaOqdK+r6MZy32Z3LeCjS7SljUkNBcu EhG34bK2HPivxKcxFuyct5AVFVHQttbSTQKerAtSTg4RfxV0tJR9SY1Z9uop5O/tdDQl v+nL3Ie7+9aE/r7AJMNjktHv68vzYx+u2qB8QxD2ZmoWOlfhg/nTVFCPMizNUJNM3Ykl 0lPw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=SO82mOYD; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-145807-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145807-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id n15-20020a05622a040f00b0043447a995b1si10849521qtx.336.2024.04.15.12.44.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:44:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-145807-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=SO82mOYD; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-145807-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145807-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id C58AA1C20BAC for ; Mon, 15 Apr 2024 19:44:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E6D0D165FC5; Mon, 15 Apr 2024 19:35:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="SO82mOYD" Received: from mail-qk1-f181.google.com (mail-qk1-f181.google.com [209.85.222.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 357DE160887 for ; Mon, 15 Apr 2024 19:34:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713209700; cv=none; b=jguGfJIPrNSqGhvghR+j5p8AWNcQ/+siiHNh3fioW2p/Wp/nTHXtLuxP5B+g+PvYdticx58J/RrsL5ffE0PkX7V2LxdJIt91miNqnaw8bLQ+YvwBDbR5IPBMOvLuwAjj8QL3As28As58Kpc42FThpXwYKF2Mj3DW2tveagk3hqk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713209700; c=relaxed/simple; bh=xLgrZZRlgHue6M9OsvJFWob4LMm7t7pNYu1OWpjQXlI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=LyoFspNGmDuuzjyxnDAFnXIe8ASyO94rhmSk+SE0d3ZSdH9WuEhrXdhSDPmMAjsInXjZET0mo5s7sMW2KTSVl1vQg67FtYd8n7rEk3Xkm/6ByACpClY6g12rKJZPYpJWRc2E8gi2V9rHSQye7H1mr4MswlFaMx6E/QjZK129ImU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=SO82mOYD; arc=none smtp.client-ip=209.85.222.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-qk1-f181.google.com with SMTP id af79cd13be357-78d61a6229bso247229285a.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=vger.kernel.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=SO82mOYDZw/UKakxnQuTFkklz4l2bqLfzMNsNZxhPfrWnvs78i5QXu0tuG8APBtV4L Ut7FdGWF/e+NeELAA82rM56O7kIvrlMCvZdjzXhH5aCbsN9+Z8Asggpf+NweU/OMjy9d CpJZkTdLXvRC410dH3UAV0vRUyn44OVUMQbGs= 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=TAqcIvfxZ6culZcJowyoevGX0Tye219SmmCteb7DVqf7qZyhUUHEg14F3Sx6YJwFJQ 2Z89VVpdvlgZkPsGt6SxAsa+49gJuWc3WP0XPSK6XUADE5xdmMRFnBur4Nlv+hKhmd7R 94A/4jRVQe7kGOuQpHc+IgE3DOGcgVfyVAWQm8hXoxCQw7Fi4185zUIhu+mUcTxSLBG6 H41stua+0/vvduBwlJ+yaGkgQzjxrx9+TLbVaDtHP/4eof8BGum8GpVFyh0TE37s218r DI7CgFOFwdN1lYY3pXvT1OFJ38aECBl9cunioBsm5F2CqJLb1jhX6u0iPB6sDCr0Pgvh 3tFA== X-Forwarded-Encrypted: i=1; AJvYcCVhpDpEvzB2Uwvu5fhLuwQHQ2humHYx50726zGTbsEJj59TkhiyCIEeiCixDJI+g6bi+W3sIOU4zpCGTY9kb7Tp8H8qCfvIrZIRYBgR X-Gm-Message-State: AOJu0YxTU421Cmc39dNBOxC0X1R4wRSA8KdO0xbrKJdVYGgZwAWdnwmY cPUrqLi2klSo+wvdpS+em/OKY34bsE0NyKLKHUJcVYyIvU4vc4xnkQNMMZCukQ== 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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?Niklas_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 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; } -- 2.44.0.683.g7961c838ac-goog