Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp1436147lqt; Sat, 20 Apr 2024 15:47:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVUZS3W98WIxRNLvTnRQqXV67pmlyBfWUqdjGpu3cKXd7La+B1ZSUjjrNGWAwH2cLoOAi7DDMJnP8Kh31wmD3tuyhYao8PmKKDxxevRpg== X-Google-Smtp-Source: AGHT+IEtgwYjSmtJPmxbKQ6UUFLe+Zp/fBd4Sf0Uod8wVgCtCH3fC1SIHmy1XZpI8QtHKrMIpiYX X-Received: by 2002:a05:620a:10ba:b0:78d:6b30:e5cf with SMTP id h26-20020a05620a10ba00b0078d6b30e5cfmr6504393qkk.22.1713653241458; Sat, 20 Apr 2024 15:47:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713653241; cv=pass; d=google.com; s=arc-20160816; b=NHn6qG9McmHzDgVbmQ+v59KQ9cGoc82nsg27wBXIyyfctRHqn/3PMUDb8AcCS9svJL d0ga5L9Mivhr556ZGpp1xaFexfj2MIVfKH/ZV4/BROt7+kkL3uvzwrO2TEuBd9ueLFM6 c/j4ZbWC+DQRBezE/Cc/okkLL0S+HLE1s2PiOok5Ryvn5aYnuwxoXQEvBHPvzRSO56zv /ZGEQinnuH4GOwqNfaZL/51pxa3aataeg5BFSmaB4XClZPamSkoGpvS+9fbNjvqAG0Cy CyI+ujhnHySwK0HNLYPWgGMfOz7lv7eryZtJurQE9WkcVUouRdZyRcUdFCy8ZKPeCwP0 LnIw== 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=fHqxIncYJ8egtEQrph9tKgbaWj8ag9453EB89pr+LvE=; fh=0mrM8kEVDpGNEI8zivBOJ75BNjgejGe3f1rzADgg2bc=; b=A6L6EeX/Vc/zA429eVxMMLjsjpacxLaleW/dCTMajIbB66pRRW45c5hrTcaV6ud5h4 T06jLN/SlXhAkijk4RkIGTzvgUowZfKzHXOvSsQU9JGkbomuMyC5Le8UopTW19jba3JY xWFE2hB2e162UVpDlotAzHGkRRUevYH2d3UY5GVoYFY1EawRrwuLwPGk1y6ic9ZMry/3 0oHiFPO6s2uxIVNeO0avAcjgi2qrWbx1bIM/tZqxYOCH4F3BMRPBKkgo7EmejLPqWSMr Aw0tx/8D0ttO5N/Obe4v4M0iqgw9syb969WK0Frf0WjhJ4ffeVriMo8E92flB2yc+IV3 0REA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=w1OKLciC; 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-152380-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-152380-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. [147.75.199.223]) by mx.google.com with ESMTPS id wh15-20020a05620a56cf00b0078ecf815804si7083995qkn.296.2024.04.20.15.47.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 Apr 2024 15:47:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-152380-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=@linaro.org header.s=google header.b=w1OKLciC; 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-152380-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-152380-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 1D8461C20A4C for ; Sat, 20 Apr 2024 22:47:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C9B8A4CDEB; Sat, 20 Apr 2024 22:47:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="w1OKLciC" Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) (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 CFC7F2747D for ; Sat, 20 Apr 2024 22:47:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713653230; cv=none; b=ElEJ/6zebypBpACqY638QRu8OQsb1xfBiEVwuH5PQzimxWUZqsxuk1YiT+RgBwzYyzPkBWWCM0isaySvsk1MJUHvOMiN29wWEuaIZClNuNO+QNYP/le3QHod9bQszZA9RnCOo+wcHru2ZMAck4nbkxoeoEQAqBgD0D712Dumf4A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713653230; c=relaxed/simple; bh=7rus6XVRgap7s1soDiF1cXI8lMxTwZlFAZbG+UDBkQ0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=oauyqIbJclBT+4xsFqrhOup4HG23xU2knO7cpY8zs0D3u5zVDiMbMhSeLuhf3dv9o3Wi5QUMGBqH/9Y76ANpZ60Hibs7Jn4SsOlVVc43E6gFLHixLs30lW8bPsrv3poFtsjKkARj/0wRFWt07eDzmllsKNjZW2N5+N8J02CvVy4= 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=w1OKLciC; arc=none smtp.client-ip=209.85.221.46 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-wr1-f46.google.com with SMTP id ffacd0b85a97d-343b7c015a8so2523252f8f.1 for ; Sat, 20 Apr 2024 15:47:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713653226; x=1714258026; 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=fHqxIncYJ8egtEQrph9tKgbaWj8ag9453EB89pr+LvE=; b=w1OKLciCu9wHLskM35r/KRD4m8cCCX9nB0zFYtM4gpxGvaGth/WzWe6mYRgCwIh6Pf mH8HkFvcgjqqA9ysIJEN/al9xHeY/0DgKqzW/R4iHwtTCHmGlGK9QY6Hv+cmCRYIxcdU vFWTKuIvYCGw7gO0/+WXb1b4Qt/YoTJGZExCLTw/Qu15jejGvfn1vnpZfhFnsZmwKIMx eClwIpyPFAsHjy/XjLuhvsMmHwPtkmj+r9ZNMmWLtyC7/4ZoghhN+VPPhtnzigg1D2TM t47aFq7vCdhZ9qWFxaJLSxoGc8o90gmXpZrWt+ie7VgqvFKBCsAjbjUWiegDWNZPMawm bAkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713653226; x=1714258026; 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=fHqxIncYJ8egtEQrph9tKgbaWj8ag9453EB89pr+LvE=; b=PMP/ZJP0EO6Jw4FN9fjjE1wh2Oh4ufz/rQs5pQLBXZBcTDag1AqoJ0ECtogF7PqglR AOFu2LDnG8RKemDkyF6ACgG5lIic8TByAE+5KsKTefELtWj7DQyr5su4aFned0t6LvYp +pPhG+dyJdTzFYvUoOtNwJ1z6U3U3nzckMM18tQOjOEVFgrSfrV9L57poahw/dGOe/Mj aQIJ6HyJbLiv7J7M3ghJjvGu8jdDOtRhI8bdY72a/WxjlI3T/67Xw1GD4pcQ1iYtQRM4 pkoxdZbmA8feage/B/tbpVYQxAFa7NdqPzQznNnpugk7zkKFOcxgC8DaZoCKURUPyYfd R57w== X-Forwarded-Encrypted: i=1; AJvYcCUVe1pUZ+9bWgZKSF6+pnKhvL03KNWvpkzjchA1+7lMKAHV0fPBUgmQDK8WlzutVLqhJP1WRrVFo2CNlrwaLtwh22ynW8W+90nZBsHv X-Gm-Message-State: AOJu0YwQjXF3F1YSNaST2OAR7hYNtzswi/WKUXTKZM/RZ0COn40r1R3I OTtpL+K+xSPJUEkiWhWun1I3WPSMHOWtLzDaY0Am3UTXYO+mTJm6Rwx9X1LEEQo= X-Received: by 2002:a05:6000:2c2:b0:346:758e:5f29 with SMTP id o2-20020a05600002c200b00346758e5f29mr4624994wry.60.1713653226127; Sat, 20 Apr 2024 15:47:06 -0700 (PDT) Received: from [192.168.0.102] ([176.61.106.68]) by smtp.gmail.com with ESMTPSA id fc14-20020a05600c524e00b004161af729f4sm11399884wmb.31.2024.04.20.15.47.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 20 Apr 2024 15:47:05 -0700 (PDT) Message-ID: <0b5c6091-e47c-4d24-a13a-2b5ad1b9cfb8@linaro.org> Date: Sat, 20 Apr 2024 23:47:01 +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 23/26] media: venus: vdec: 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-23-2119e692309c@chromium.org> Content-Language: en-US From: Bryan O'Donoghue In-Reply-To: <20240419-fix-cocci-v2-23-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 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; > Reviewed-by: Bryan O'Donoghue