Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp523365lqt; Fri, 19 Apr 2024 02:59:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX2EcTMLcgKsgoGp2BKmnsBm5dpcLGpYsTxoN8Pwe4/wdFkRt82dD2xqYtQZNtngO46E8C13LW8G0YyJ9bzivbUjDxGj9GEB0ylDnyeRA== X-Google-Smtp-Source: AGHT+IHa4Bk3SIMcizljk6KSWa844Zqd5Z6XVZoKgYkvC7khyguwzE+N4JTniM+ZANlKUV8qmYn6 X-Received: by 2002:a05:6870:4590:b0:233:f867:73a0 with SMTP id y16-20020a056870459000b00233f86773a0mr1723165oao.22.1713520767375; Fri, 19 Apr 2024 02:59:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713520767; cv=pass; d=google.com; s=arc-20160816; b=vDMoNxyAfaoqM8VzzuET9Kb3ECFq7GKFdPI6dt44jLyC98f/qcc6/o2GC+tG2yQNeM s0gQHLunYSGt5hYv5zxQu7rx3djZdMnjzOAwi03MSCBAWNPi5b1LHYXIxrOcxlVBN88X li6YFGXE8p1arNS96+0Gp6ny9rSlYYOh9HvOqhmj2O1USNUmy3e2DjiNGt4LR8w5xEuY gYWmvtZO6z88HlcBLCidpMMYOg/QWzfnKo1XWlDIyjK6aVLXN+slyKtPFYau2JXzHrRi SXMOMe9RHYRoPVxaITWV7a6p4fcN9GW9RkqPev3zgiRkQhBaZFJcLSWhQwkcdCIx+jvK dTMw== 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=lvwwtJ325ZfoqM3HPbRlOXyIZjp4qomL5UkM84Use0I=; fh=iZu/Fz+WeS+16iEVIXthfuvgKC4r22GxOeHDyMdiqio=; b=DVaD/LV8mGPLzQvPiBHEZA3nL4qA5YQ9FZIn2QXZyYgWcNZPbBITkAay3Ap8PbOQON jDHlCeGNiOIOXsgieTkLTUy8tYcKadGwmOttqRq90CQfYMN9d+jAt5jGWd/mpsXb7hXn C7KdEAQn8AQV4ynJk3k1gzFoRwBiQJSlXWXDD2jf6Sgg+/NYeHZeDwAS8V0bKSAX0mqF 8fRJm4MYahwnmkQqnbUyru/dvacdpTqnwNbtSoM4FC5r2W2sgblLgbLHWAT1qPbFBBAh CgNjh900JrEHUasoPdPYdgAB3rmOhqKR82TZ1SnfeF3z/qk0+q3LBsrtK32gL+FpFgMa 6jHA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=LflyhbSJ; 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-151271-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151271-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id x17-20020a056a000bd100b006e546bd270dsi2974616pfu.364.2024.04.19.02.59.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 02:59:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-151271-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=LflyhbSJ; 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-151271-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151271-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id B2DC8B2266F for ; Fri, 19 Apr 2024 09:56:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A43DB132809; Fri, 19 Apr 2024 09:49:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="LflyhbSJ" Received: from mail-qk1-f172.google.com (mail-qk1-f172.google.com [209.85.222.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 8D7F1130AC9 for ; Fri, 19 Apr 2024 09:49:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713520190; cv=none; b=YyYr3hdq0FveCnnuLswSjMzyRezvpPFA8bTyl3+ghEjFfcRvz7/2Q2E3gM2ywgLMmxfXOPFn7rV11q0cL4orJLs3KCCo32iedOn9cGexDsHm5ve+Xrz0d7KWp8OXXqUbp5uMPqbbgJafJn151Tvh3M99iE/sZCSX/D9iFRuNa8M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713520190; c=relaxed/simple; bh=gRjENzF1lqbj9nmqwtSdvwXeaHcWhTIjXKxE/9NkEPk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=jpqEwhX/ctqrlQcaH/y8vD5kyFMJyiV0baxVJWGZeCzsDC/ry/hUjOLfMb7O71T+iPDQFFR9XIRX8B18XKDw/C5sPo0OVwxapl/DX+c3sbU7veBYoJNSjPHQTzTTPLehEpO1Rr4hLl/SqxsipHqPkFP1MQDT4U7jSH68BkqAew0= 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=LflyhbSJ; arc=none smtp.client-ip=209.85.222.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-qk1-f172.google.com with SMTP id af79cd13be357-78f056f928eso115337385a.0 for ; Fri, 19 Apr 2024 02:49:47 -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=lvwwtJ325ZfoqM3HPbRlOXyIZjp4qomL5UkM84Use0I=; b=LflyhbSJPkfz7GbnIPpeH/tJWfQMzwEgtEhu3OUHmDTYIAwQ0dfGVxvZ0AsxgrmEhM okqfpkdUul4+gxPCnEL/OKjEr1lPVn/5INIYehBxl7OlMyb7evgco7VHo0VoPf6Bb9uG LN+r9QOzTqGbgpH5eCyQanMeaxs+DZ2SAPljU= 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=lvwwtJ325ZfoqM3HPbRlOXyIZjp4qomL5UkM84Use0I=; b=gzA2mzHgzAwU2qM1J1joEHD3ndyVUc5DYJe3FLK03Zl987jGz5vCDPrbhK4f3QaXMx +1XJEgmezrw/zDAOqd4DXuty6NQNnLzmXeMNjeMHPVOOeY9GevrDPfHANRnbjJ2zw8Qw snoSNqK4zVCKmrK6AHAL5qNSu3uoflNYfQKF+fI2E2A+9iPMMAdgu0evAILaudo67r5d AUXxIgc0LihlSIAnBhnhxy9U4QA9+GvOmObE0SqxY/NNg5isRoIsOUt2FrJ/qa037rMf ZravSxLJW3FLCwiQ+RlQ1/avH1BBmiz68DmsSATC5mYoDmgueeds2qZnY/4okPpVcQ6G RO6g== X-Forwarded-Encrypted: i=1; AJvYcCXfTJRZPBgtTp56I9p2H04G7kDfTLKr9yvLke/KLkmcL9O/ZQ2avg/dLSYAE/y6HZfw7SovXSxHY+HE5B2tkWAeRYtQPldm07v/kegA X-Gm-Message-State: AOJu0YyfbIXO/AoIgfBj7Lk18LllKO4hpSEStTfS2ZSwqxFyM29kxCA+ IgFhQcboPaR8UN4yVfYlp/7q4uhn4Yv/vVu5gWi7Rf2RLvMJq2c1kzrj5gACNQ== X-Received: by 2002:a05:620a:1238:b0:78f:1622:5a96 with SMTP id v24-20020a05620a123800b0078f16225a96mr1817957qkj.39.1713520186635; Fri, 19 Apr 2024 02:49:46 -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:46 -0700 (PDT) From: Ricardo Ribalda Date: Fri, 19 Apr 2024 09:48:10 +0000 Subject: [PATCH v2 24/26] media: venus: venc: 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-24-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 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; } -- 2.44.0.769.g3c40516874-goog