Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1652839lqp; Mon, 15 Apr 2024 12:43:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXMH+g65/nVXOv1rg42+EE0CBvg58xUSipvDB4d3BALhHOE0UeNEws32CmT1wTnaZWQVT9mrmi/i/DvqxlsKwrqa7p3WKBoxONcrPtMdQ== X-Google-Smtp-Source: AGHT+IE1+AAeIPiqvdEaBjdel5w4xtxHasatyNxJKjVHMsDCOWSUbq88l921fTxq/Q5mCZxkMfac X-Received: by 2002:a17:902:ea10:b0:1dd:135e:2604 with SMTP id s16-20020a170902ea1000b001dd135e2604mr11875074plg.40.1713210180323; Mon, 15 Apr 2024 12:43:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713210180; cv=pass; d=google.com; s=arc-20160816; b=1DmyXHBbZGV0To438jLlhAQtmgNYzAC520gYzpXcczRwFJoa3gsvAJgm645loYbemS W/Gh/frD7xth+XHI+/t/lrd7Oks2cUAns/lBcAbpyXXXsMYO/c1uh+u+EEenbrag2Hxo yz5ix6Uo5R2qi3oK0v/kS4Di53HTBGTvmpPRJApGqUsYHihg+rZ4q+/0CIKOa+n2du26 hEO2ZU88wEXukPbbLIUW68BRlyahfdfswbFWoc9LlA4FmqsqSjczgjbfnaWF8sbuJ7gc 2YrfirQfSdF+31OO19RXRTbnXTbLjLyr7bDrxAzj6mN+nKa/Zm684p5EYuzaPeOHT00L r7xA== 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=ApRUmXHVQV4ipJPLdz2OGTOSZdnvD9pjmVa3NeYIwaE=; fh=bW7fScBtiyDzhu/C2ZWvKBMO/ZeB8FbfrA02rNebf4U=; b=SZNdt3qBrMhOhaJM2+mEJzhvHqrxM8kPHqst87obbHmefcnkGtngHCNwxHrjVeXGRL xAfl7lNfISOgRnRmkOzjG2A7sunfCBygfzSkX2WejNiBy2vJsRsfaZ6FyS58X/L1ttE+ zH/eaLd+B6Dl/waTLqD8mUETitdbhwAe7AN8exVTGs2ZS3wag2uOGq9KkdO3BVQfXfai tyu9MuCTNamVqE1sDmVaK3uyRCGdsHXK91KgtXkFQi9FU1hGxTC7RY1xskXW1XUQcaXD UXjJQmVQ8y42h3qo2ZgZRBaKCS0p8InL52b77aZeREOz+nl2MtFD/+ffqWmXIz86vdHD 7Nxw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=lIyai6wr; 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-145804-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145804-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id lm6-20020a170903298600b001e0bee74c2fsi8264560plb.68.2024.04.15.12.43.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:43:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-145804-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=lIyai6wr; 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-145804-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145804-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id BB610281D80 for ; Mon, 15 Apr 2024 19:42:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EE1F7160877; Mon, 15 Apr 2024 19:34:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="lIyai6wr" Received: from mail-oi1-f172.google.com (mail-oi1-f172.google.com [209.85.167.172]) (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 2AC0715F41E for ; Mon, 15 Apr 2024 19:34:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713209695; cv=none; b=EKFXhdmP9cf6JagYC9AYsa+50Otk+DhjYN3pBLdGiBdZ1AfgHPeNcHjjGeJGlMIdAxAmZvJDkd/Pv9PcS2petHmFBz5WAkJRQl3i2P3BS6tHnV04rjaHhpRySF2pbxZ1osoMZ6PlIwbitW88/ozV76e03yY4itXG4jNlpZ6RPhs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713209695; c=relaxed/simple; bh=3+1Bl8mh/8+eBa7Eij9anNi89S/ycWDT7MhZBO0qMzU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=j4HM1j2c+Wdz9dXyHlC7EUUpIwtITjN99KAVHSpRmVwR5Yvx60xrm070LPejkovdHaDNBrvPEOkFy7kJ10dN6i5D1ISR5h7ip0XE2LxS/BAmVOzAo5xu44zEGipHRh4i6Ybl53EQjQNFJKH4sg44yYZ22tj5UZYc+lK1s/f572E= 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=lIyai6wr; arc=none smtp.client-ip=209.85.167.172 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-oi1-f172.google.com with SMTP id 5614622812f47-3c717b7b93aso275228b6e.3 for ; Mon, 15 Apr 2024 12:34:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713209692; x=1713814492; 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=ApRUmXHVQV4ipJPLdz2OGTOSZdnvD9pjmVa3NeYIwaE=; b=lIyai6wrhkTq1KgJXWND6e7iZcGU3W5PDuicQ9o3kOu9cam4Q//AywMviobqx66UJW FY9tN8SVI1UeRsOuMQM2+tJVjWi8wjNJ3LW6NqTuUjqZ45YuMa7pgDv5WAkj1QTS2JYE KKskNvykMkRm58jLJoC6w9FB3YaP2y6n8ugSo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713209692; x=1713814492; 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=ApRUmXHVQV4ipJPLdz2OGTOSZdnvD9pjmVa3NeYIwaE=; b=aC5ELkpzM0ZQgu+Oen/ZF72vZWU34Xo1s81zKIs4pauniRfa4ZDfN1+JJhZ+q2Ze/y s4jOBQBNkfmXIjeJbTDJTNBip0KRsNDpb55TyUBl4kpSYcTwYgRiQrJ7E8Rk/P4flUd+ z9a/kBpM1OFOrm1en6U1fqYQvOuMNpEvtBHu3w7mrrm4Mj4bQHOJ7R1dtPE/Qm5VW1av SAvaMtajI218Q8pi9XUUHqOyq7z3sEC+ZUX2kdK3ft4RyEzyCH9+ZIrzp4rRANGLadar X+NMcBW500C3FaKv8UNUniQ6ljECCeOk7yr94CZd7fz3hfpEduC3Izxxxg/lG5LQbca4 X39Q== X-Forwarded-Encrypted: i=1; AJvYcCW7xhAT2PN8jSQ4PuMlaoOZvC5mn6qix3RRarLNxfqjDwiBBOgXPRII4jQvVdOrKtpD7h5gnr4UvyekyiWXimIIP3NP2XoRb1Jw2nZ2 X-Gm-Message-State: AOJu0YzA537p0AAn3qTxhSsLuRLij/CfQHeZD+/RsOimjckzG+k0X/o6 xszxfqnjCaLFUzyv6wgfulL4B5jcn7UAq68LrDMajSa2MVSpeLb+owBNzEjVfA== X-Received: by 2002:a05:6808:128c:b0:3c5:fe95:2371 with SMTP id a12-20020a056808128c00b003c5fe952371mr14036703oiw.29.1713209692296; Mon, 15 Apr 2024 12:34:52 -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.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:34:51 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 15 Apr 2024 19:34:38 +0000 Subject: [PATCH 21/35] media: venus: Use div64_u64 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-21-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 32 bits. Use the appropriate div function. Found by cocci: drivers/media/platform/qcom/venus/vdec.c:488: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/vdec.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index 29130a9441e7..1dffeb7de76e 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -464,7 +464,7 @@ static int vdec_s_parm(struct file *file, void *fh, struct v4l2_streamparm *a) struct venus_inst *inst = to_inst(file); struct v4l2_captureparm *cap = &a->parm.capture; struct v4l2_fract *timeperframe = &cap->timeperframe; - u64 us_per_frame, fps; + u64 us_per_frame; if (a->type != V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE && a->type != V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) @@ -484,10 +484,7 @@ static int vdec_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 = fps; + inst->fps = div64_u64(USEC_PER_SEC, us_per_frame); inst->timeperframe = *timeperframe; return 0; -- 2.44.0.683.g7961c838ac-goog