Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp1436331lqt; Sat, 20 Apr 2024 15:47:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU6ANbYZVOzjyMrtqnQni6etmHpkOHbecMMeFpTaw/tCXQVKN9wDpFfS9EgA0UixionhAlgPdSLXDjX9kcv4MUaMImntM30O4FTySKSlA== X-Google-Smtp-Source: AGHT+IEjLluG3K8JedSSw9sC3AI1bABjLOjdGhTRb6UWxaWXo9dwZ+abo++VPSDgrvl18Hu73brE X-Received: by 2002:a05:6359:4186:b0:183:a0ac:b638 with SMTP id ki6-20020a056359418600b00183a0acb638mr6633993rwc.11.1713653277074; Sat, 20 Apr 2024 15:47:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713653277; cv=pass; d=google.com; s=arc-20160816; b=WF/6pIeqnIGtNFcx8TxtZzbp45BoPzujMpXwOTqj7pK/t3+CBZG4g+bTthrgvMFOtB jUaXYSC4VdjPc29SJISP2qyVKO6LZfWVUS70CW7uxfvv4zK+8qiQ4+Ek3Gg3eSbfkSAN QMb4PKar7oJR8oHosUeCZqKNvsYcgmif54MPKlPV02jnp691lt5Hvq0OeuYx3dw1NuFY xrvQb4oEvzjGbafpDjDhtcTLe/Os2SrrQntWjhNXqpD8JnfB+pkqTBCoAj+ak+/HcnwR 1Zh+w78g+kgzjur39pXRH7RSv3kg9JV9Hzu2/0vXw3KxnWRT9N10QUKJeVuo0P/yk4nh GK8g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=yYrt2gNTxAC2edJd/oDyZK1JqsoIcnAtCqFK2cT4K3E=; fh=+G5sm9m5vYGJeBNimn9yKEqbesYPuZRveA6PXFhfCbc=; b=aXfWXGS7DLvhR9y57XTDQjCnlXCvdbfolyZT/vIn7J+DIvIjvl0u/bBW66ZOZzgzHY rtgk7ifGCUVlFFNnvxXn0O1PcfOCohRxFyL3Ll7KDWoZ8lTblGTkVHLn//9rENaiRPgv Ee+WIukMTpKiMiAF/COTGJ1qlP4iFY07vUIS2wcsDiuZ0CbHNUY31VGyNxVK2AtVEWt0 VenqUtocVVXrpQ8iLh7dN4Dz8cfYRiCYd9JZg9gXv/EOg5jLpQpiN1khlyqS7oDCTUH0 BCCYn/mp/KzO0PqgF6g0eUTxQblfvSLA/aHtTHK/B4vZ9wbgaaPFacl0XMzVweKYAh/q B6bw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Zn0DsYbE; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-152382-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-152382-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id f5-20020ac859c5000000b004368982128csi7403245qtf.721.2024.04.20.15.47.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 Apr 2024 15:47:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-152382-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Zn0DsYbE; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-152382-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-152382-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.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 B83EF1C20B0A for ; Sat, 20 Apr 2024 22:47:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5A9A85026E; Sat, 20 Apr 2024 22:47:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Zn0DsYbE" Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (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 E0D614F21D for ; Sat, 20 Apr 2024 22:47:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713653259; cv=none; b=uEPYXsxxZ5ln6qXztrmMZmLtZ8iELEC0SGpTJ72E8mYPApbU5O9H7NMgwaZ6FS6rYUQQyY47fUKOR39bEXkAJrOWul7jsIgXYrWc9G6UEQiqBWXBE+nKa1dc4jaDDH81JC11rhnnSXOJJrQvD6HdXQOhnKKWlWwM8yUOZJo55Lg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713653259; c=relaxed/simple; bh=7BKUeJX9aV7FK0wwM/ed4hU8pUFUg4zU4KPvLHQ6pXU=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Wj7j64aEnkujZhA0Z0cJ5POQWcu0CAUD2i6fKLasjVApQkwjm4ZgbGNnq6F50RqVvcA4/XZOYruelwu4K6GJ2aizpDRlti11RSuEOQWXvTnWV9bx7EjW3iW+OoKOPkm/SVT+S9J3ZSye6sCe5xMnhaHZrkLv1/19f0c7AS0QDbw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=Zn0DsYbE; arc=none smtp.client-ip=209.85.128.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-4199332c1dcso10464545e9.3 for ; Sat, 20 Apr 2024 15:47:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713653255; x=1714258055; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=yYrt2gNTxAC2edJd/oDyZK1JqsoIcnAtCqFK2cT4K3E=; b=Zn0DsYbEnTIwwESOgoO8bNl+kRk7ZIHTdFnQcbcfA9pC3SCAl9hSeCxZbKt7V1tpaS Fbw2Mq5+oPCuAkB4OYpcbQY0WFzQzenqO7M59554jHeY4cRFNojtogX94EvL1cOYAa3J Pc8ARaggrXzWsp6CK2fZLFQ5hdr+s72oCSL+Bo6R51Gmqrkh84BdS59hvxvS5uffj/XL DkOZyMNQj1pBCog+e3xt3D0ZvXPjFqp6lX+87sC6Bbe4HF5YVZWAKPiHBXE3kOzjaxxS vjhcNS5SszgYyNp87pSYWnI94Xt0JVWcFDmaegY7T6j8ekQ/WtPDEQ2/QtHzc8KCLhJt VaXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713653255; x=1714258055; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=yYrt2gNTxAC2edJd/oDyZK1JqsoIcnAtCqFK2cT4K3E=; b=CMeCp8Xd5ShVXPyDWWeMpuyDYojRY2ltitJgkj043oh/lLWKqfVgRg25AqfHkmAvPf lJwPwQZw8h01XECGJuesJwBxSf14kg+C1PDxVyNut9xgWKidhJ6yKMS5NUIvmxkyYpvc t/xqz/dUvyyuDhW2arSvC6S4QuyAAEtbL79uI2VRljo9ZHYCQ2GChzlkRu5EdTibMpGw 1grWaDFf0Zeqh32tY3Kn+xE+se6GeM5/Fe9bbX44q5giDANlHfHh2kIC4rcEFq1ah8yG 7L/BKjtgsPH/5+ovkDLpp4Mie2zEDljy9nKHAXmUcLw6K9xYtN/uf7uPr3NIGXa+t90l UU/Q== X-Forwarded-Encrypted: i=1; AJvYcCWtqGB/LbYHzYbVOIyjx1O4Khy/0uk8VxpSRcHcvymAOXxEqgRIZ2nA9KcOW2QMeBqUACQrOoeJa1zXsdqMGkvZBibuaQQPo4kDPjda X-Gm-Message-State: AOJu0Yw0+hstVZ/WzCVzeZEF3XimBmKMIH/Z8wYgZZjR+5Uiyc5nTlqG hht4E6ix59dkvmMlP7SedaZFTyfSNhUTfntmyE54M7PiGe3cWuBf66bZ8VdfKMg= X-Received: by 2002:a05:600c:4e88:b0:419:87ab:f6da with SMTP id f8-20020a05600c4e8800b0041987abf6damr3268421wmq.3.1713653255313; Sat, 20 Apr 2024 15:47:35 -0700 (PDT) Received: from [192.168.0.102] ([176.61.106.68]) by smtp.gmail.com with ESMTPSA id r13-20020a05600c458d00b00417f65f148esm15283322wmo.31.2024.04.20.15.47.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 20 Apr 2024 15:47:35 -0700 (PDT) Message-ID: <6b1627ff-5135-4685-be35-adf74a456469@linaro.org> Date: Sat, 20 Apr 2024 23:47:33 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 24/26] media: venus: venc: Make explicit the range of us_per_frame To: Ricardo Ribalda , 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 , 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 References: <20240419-fix-cocci-v2-0-2119e692309c@chromium.org> <20240419-fix-cocci-v2-24-2119e692309c@chromium.org> Content-Language: en-US From: Bryan O'Donoghue In-Reply-To: <20240419-fix-cocci-v2-24-2119e692309c@chromium.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 19/04/2024 10:48, Ricardo Ribalda wrote: > Unless the fps is smaller than 0.000232829 fps, this fits in a 32 bit > number. Make that explicit. > > 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..f87e33a34610 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 = USEC_PER_SEC / (u32)us_per_frame; > inst->timeperframe = *timeperframe; > - inst->fps = fps; > > return 0; > } > Reviewed-by: Bryan O'Donoghue