Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp522204lqt; Fri, 19 Apr 2024 02:56:26 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV1vCfB5RaxvwGjzLtpNlcGgJoqSVfI51CVGnRGxbI+XvXUjn881SeeJ0lNSWjvhAOkenISwV5IPL7n4muEHaZ8BtPxXx1dPJ1xYNpEyQ== X-Google-Smtp-Source: AGHT+IGETCLK4hUW4/a84MgTEGM+w5xGCplDul6Y1fYRFIq7XXJmWWgGs71uL9j7Sbi7UXbDMrfY X-Received: by 2002:a05:6a20:5b1a:b0:1a3:50b7:7b5b with SMTP id kl26-20020a056a205b1a00b001a350b77b5bmr1822577pzb.60.1713520586169; Fri, 19 Apr 2024 02:56:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713520586; cv=pass; d=google.com; s=arc-20160816; b=cdKm8MYKsjVvCnVzaoZIEvt0U+RZSYksJOI3kkokYgiU6+ctmr12KezV14IR7wWpIz O3TQf2557sdV6kigs9qM+VSYu4ilQhg9TLUBX84ZRD3pS6dC+Cncf+LBYvUwP4XVB8nO 4cD7KOfsV6ywSL7pTKgNqbtvYiH4PvTb1KD9rJi6Amxieb+gm3NUjH8wxQhetBgWoGKO D/9JgpLfUR1ZI/1MJAHTjX8UHTTo9I/vhxjI77UwCdJQjHKcoJzCIrXdEsbPrbY+A/UK 0qjd4RL+5qqzMUCfLUH1AfppJ9YjY5QAA6rgY14tAoydVLKWeXwieGxTwV7KBk0rzdT4 dudg== 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=G+OLGyPz2NtLOZH/YOdUHJtasX7vVXp+smN0A8Fakk8=; fh=vgLoUb0MnxJj8StyMkMfnZDhO2h88XbuT4OV6ioUQPc=; b=qh+2M09TLqwIDObFlt0YP3p2HWhNMsPWRHdngEntA+jbJWSoxdPkZ9OLYgpt7YKSKK elnIlorkuHuGmHTpfdMWsTAGo5ElJS07+lVwDQfijfE/ZdaLUOf7adudEYYg7RCSfBWs NUoH0s61PE6YatXX7OTSyJBjt+QNdepLfv2TVRL49P7QyjmJHDf0h/DERsnTbnBICijv x4jXXvsGHzQv7SUqPqtP16QrvHfss2nB4cLDlCEeV3dEshrL9FaFQTOZgK1PeZOEf2EM WkrDE2e8h5geo4bllUssHWGFAIKCHE4MOY9R68XnHdKUpsNpkFljZo1M0+GCPUD4iZCv wxvQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Vw2XJPuH; 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-151270-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151270-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. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id a12-20020a056a000c8c00b006ecf566ed70si3225784pfv.10.2024.04.19.02.56.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 02:56:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-151270-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Vw2XJPuH; 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-151270-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151270-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 BDF7E283A52 for ; Fri, 19 Apr 2024 09:56:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4BE35131BC7; Fri, 19 Apr 2024 09:49:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="Vw2XJPuH" Received: from mail-qk1-f179.google.com (mail-qk1-f179.google.com [209.85.222.179]) (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 B57C8130A52 for ; Fri, 19 Apr 2024 09:49:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713520189; cv=none; b=GygERGucxA+ULTGywqBMpqVjDm7hajwmRPlfFf6Qtl12LyxeZYn4Yz/LGQ8E3FLBPhmE4mIXm5hPPGBf5+kbdRpUcyoM4yPvTVV/lhIez4qsiJ0wQEs+NTWoR4VuMVWMTxpbgC9KEZr8fKPOfm5Z8DD1MoyhR/B5mrzDO3jsu7o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713520189; c=relaxed/simple; bh=kVHfPXf+aJiHcuvBXYKvN9J4cRi3k9vjohaInvrzoF4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=BN/AJ5z4sH9wRQupMcvVl2pxJHTPUS/tZ/YLs9adb+G6+JnR66P882OtsZFyobn2lkTcf45AbArcblM2xbS4DE5tQcVleB/CKnc2WRv50b/3+EmFOnsQAdf93hQFBnoSMKZ0wENwcVpruelfa8jxalwaltNKDLGcr0W5WD8UKqQ= 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=Vw2XJPuH; arc=none smtp.client-ip=209.85.222.179 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-f179.google.com with SMTP id af79cd13be357-78f05aec21cso124240085a.0 for ; Fri, 19 Apr 2024 02:49:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713520186; x=1714124986; 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=G+OLGyPz2NtLOZH/YOdUHJtasX7vVXp+smN0A8Fakk8=; b=Vw2XJPuHWCVTRB0iEXZ53SnOAN4jpYhdj1wIWOcRqY5hGxKRv656AdWslYB8uX88tP EQoS69p92Mhox0z8LIcDMq2zXNmb4Xys+ypmny73pBc9eXkdxEe836/PEXBIsU9YI3dz mRPnexaltu7mZlFdvPCslsXezgWOSBnfLHH1g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713520186; x=1714124986; 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=G+OLGyPz2NtLOZH/YOdUHJtasX7vVXp+smN0A8Fakk8=; b=p4Cp01BsP9qXgbdxvCb3zAmZ+o/FepUypgzvSQKv0wL5nzT8YlmAftLfPE0f8CR5W/ t8D5q3bQU1/QlMnAZ1KLGcw2GRszbRuRwiCG+p9Q9CaXMBoB/7j/C/kylJUuW9PVHX7m eWvPwwm1Bk1Bu8+VLav3YukTmyRe+tZggT8RYOks8wPtslPPdQlHSlNh1e4fR4rrgVP3 PsYndeWEwiR2AqJLUchmJJDfVK5Z3QdwmdPCD55Xd6p41cl8qUaYSKTXxNmfydaDWH3f vdPv031XJnrnQnjBAimrwCqKaQnvabyCpVktv4QKjt0my3BVW2qKyZqLSzcLpZn64WMk SFbQ== X-Forwarded-Encrypted: i=1; AJvYcCXKwRyrXHoxjPrI2taTvo9vXg0RyFFjxkeFMbzjIiV1WbKsUf0TDIBKxQaGJyqgUYN6a8pRoCRqykQ+h0lC5jWxSLvu/OGsdAPMkNwm X-Gm-Message-State: AOJu0Yyy6MkFyD6skpM2VC1qrHjHsPW8e2a4reRkPVmWeB3/Zy2PGJFW YGC7kejoPkBAiKMiUPD5jYV531tXb9toLu+m5Y+tt7pVW4sVslwhrB6RnnHZnw== X-Received: by 2002:a05:620a:8116:b0:78d:7036:fbda with SMTP id os22-20020a05620a811600b0078d7036fbdamr1727540qkn.75.1713520185768; Fri, 19 Apr 2024 02:49:45 -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 dt14-20020a05620a478e00b0078d735ca917sm1434532qkb.123.2024.04.19.02.49.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 02:49:45 -0700 (PDT) From: Ricardo Ribalda Date: Fri, 19 Apr 2024 09:48:09 +0000 Subject: [PATCH v2 23/26] media: venus: vdec: Make explicit the range of us_per_frame 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: <20240419-fix-cocci-v2-23-2119e692309c@chromium.org> References: <20240419-fix-cocci-v2-0-2119e692309c@chromium.org> In-Reply-To: <20240419-fix-cocci-v2-0-2119e692309c@chromium.org> To: Martin Tuma , Mauro Carvalho Chehab , Laurent Pinchart , 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 , Benjamin Mugnier , Sylvain Petinot , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio 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 Unless the fps is smaller than 0.000232829 fps, this fits in a 32 bit number. Make that explicit. 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..2b2874aedb2d 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 = USEC_PER_SEC / (u32)us_per_frame; inst->timeperframe = *timeperframe; return 0; -- 2.44.0.769.g3c40516874-goog