From patchwork Mon Apr 29 15:05:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13647120 Received: from mail-qk1-f182.google.com (mail-qk1-f182.google.com [209.85.222.182]) (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 8C5F712880A for ; Mon, 29 Apr 2024 15:05:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714403114; cv=none; b=dtBi27bZGqjaVmXVMuu1Y07MHaGHlnoB1TCNtg3Su7MMaSSsUC7QrPf8oMIr/btMTP+le3T+ozeAC8vw4qmtcow3zCBzLMKI8kRxB5USKxSN4KXzHqQd1B7YhTc6G51OuTLB0csJYOaM7Ci3ffRX8q5UUmVcR0J1Me1nB/MIGm8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714403114; c=relaxed/simple; bh=A2Ua3QkuJFffFg1BMdgqwGEYAvUbwmxlzRDyBr/ON+U=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=YUuMbDfMLKAa47JpkDi358kUvGF8CRp2rV4xhH+JhVbog+gxMvMl+QFUNUqLHM2CnVEXqK3RPEbZAdatArRLFch1yCQyDJsryBiB4AAQQ+/6Gvw/R6I7kALYcJd1LecK3Fzy1BN1Sx/cTSf2p9f01Tfze7ToX6KMp32F1aqcp3g= 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=NnBwWPhn; arc=none smtp.client-ip=209.85.222.182 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="NnBwWPhn" Received: by mail-qk1-f182.google.com with SMTP id af79cd13be357-78f02c96c52so339122185a.1 for ; Mon, 29 Apr 2024 08:05:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714403106; x=1715007906; 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=H+ICFE9T0WtFgFxAAIzneJg+RkmVbFrs0mrpkqFICS0=; b=NnBwWPhnDPlXn/K1WZixKEy0quXxOUtNmvo6ldziFdsnve3fpTeshXWBDx4Z1FM7fh ebMk9p6iZYfiY8oW8nawpshyR4wv7l6PAnXJq6x9fNOylg+3oxu+MMddTGjw3AG3hiqd yhcIrxAT1IqVLvrOaSlwKbu5DO8k9+n1ZJEYE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714403106; x=1715007906; 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=H+ICFE9T0WtFgFxAAIzneJg+RkmVbFrs0mrpkqFICS0=; b=wSFbG4CNVv3t61rpVwQz4eLRn/i7Qa4H8NByvqhjykKZOqE5LmhjOCNFUMZq30E1Um skrtwPfFcZLGR17PYbRT0E8Q0Mafvv4Q7GUfc1HVUB6NE8swFxXBqxTLasNabUy3+blR 4/ogzWzsyhhO5hEYYe1udYB5uTUtVk5CPmVgIQYV8xOix8wHIPlbGeeETsFJxwE24mg8 JZl+lk5/vPy7qZS5KX44YAq42hjW4OPnYaDFXcdbA1js4WEjKzIWG+kuDI1LWcQWhEf1 jcJoZzxOU9KkFwVw9TVa6FrRhKnmXASVH9HwoKEVvrlvf95KpAIkHqLoMltq4K4R4/bA CpsQ== X-Forwarded-Encrypted: i=1; AJvYcCV4OE+JhkqSZfhyNHfBfA7JAMtldGtZRcvJi9btR1SIsaZvnStT5o/UF6iSekahN3PQuvIXuAmt4N/6khm9Ml2KWCM1giIEefoODD74Lg== X-Gm-Message-State: AOJu0YxHGy7UP9b670trxKN4yO6UIHt4rUCAxeSl9EFZ2bX+qZ+oSuoa sp9Q5sieT7BEjCzv+Q6q16WcrKaVNiiAEwkcBfSVipRnhRySWSaBewLqM6j9Yg== X-Google-Smtp-Source: AGHT+IE1jrRBd5HK/tPuhHP5Hku+rmhJzqzd24VfyQoPlWIHBef+7Xc9RHcUZ/XfTRZVrVfoGNJ+0A== X-Received: by 2002:a05:620a:57d6:b0:790:b2a3:f86c with SMTP id wl22-20020a05620a57d600b00790b2a3f86cmr8844059qkn.34.1714403106175; Mon, 29 Apr 2024 08:05:06 -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 p7-20020a05620a056700b0078d3b9139edsm10568591qkp.97.2024.04.29.08.05.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 08:05:05 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 29 Apr 2024 15:05:01 +0000 Subject: [PATCH v3 22/26] media: tc358746: Use the correct div_ function Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240429-fix-cocci-v3-22-3c4865f5a4b0@chromium.org> References: <20240429-fix-cocci-v3-0-3c4865f5a4b0@chromium.org> In-Reply-To: <20240429-fix-cocci-v3-0-3c4865f5a4b0@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 fin does not fit in 32 bits in some arches. Found by cocci: drivers/media/i2c/tc358746.c:847:2-8: WARNING: do_div() does a 64-by-32 division, please consider using div64_ul instead. Signed-off-by: Ricardo Ribalda --- drivers/media/i2c/tc358746.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/media/i2c/tc358746.c b/drivers/media/i2c/tc358746.c index d676adc4401b..edf79107adc5 100644 --- a/drivers/media/i2c/tc358746.c +++ b/drivers/media/i2c/tc358746.c @@ -844,8 +844,7 @@ static unsigned long tc358746_find_pll_settings(struct tc358746 *tc358746, continue; tmp = fout * postdiv; - do_div(tmp, fin); - mul = tmp; + mul = div64_ul(tmp, fin); if (mul > 511) continue;