Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1651180lqp; Mon, 15 Apr 2024 12:39:45 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVnW6OR0W8il2cfVCZoQGgu6rVPeL+Zh+QzXc+9DJJkSKh90iJ6jt9guxqo/0L9o+fmgfFhV1TIyF9hugFFjqoaIW8KGQghAz62qVyAxQ== X-Google-Smtp-Source: AGHT+IGcVQXgbLe3TMrg0f6lw2Gr8qjil5I4hhDeZLIViC2Ao3YohF6Sq3j6UG7kfnv9vmoXlCV0 X-Received: by 2002:a05:6a00:1786:b0:6ea:c767:4699 with SMTP id s6-20020a056a00178600b006eac7674699mr799312pfg.13.1713209985050; Mon, 15 Apr 2024 12:39:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713209985; cv=pass; d=google.com; s=arc-20160816; b=Tr4XU5gOkUDd1y0CwgopzeeTrfopBdQoInv6M3nbX9TBT1jKcS6X8egAbR+DTMx/96 /8I48phltCOHR1LHBmSrGnyAt71BKpP0txmcPXV2izF7Rc7pJH3QLq+Q14HAXHsqNi21 gmRSShyFFQO/d+8+0LnUdTI0nw8rGUyxXdbbNe+QCCKqHAH1T+LgBSjYN1ov/B+O/o0E ybJ0aidmXvc39x+3UD0Wb4G1IlvS/PZiHDS+xPdSCVWdhgwB2RZOC4QoutSNZGNooRfB w5YivMTYuhj4kIUlZlBwv1ScMDixr/iMmASaw68gScgInjRxjveneGhEKn8DqaPmuUFR i+9g== 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=ISUo+c+Z6d9jp43vDna7WArpy0Bh/pUYqJP92YgrR0w=; fh=iA/+lR1lyWn5gaswScHpdIdh6CLcuXp1jvZoRW7kpIM=; b=wUclBXoPRW5EipMlSKfxjRShVHeHu0C2EpOBUU6J2J+iCHPbmbc5hKPDvn3cakcJCV gOmNJhSR47FP6GTRuDUuPRVeMu10lEd8/BNWdmvGNYI7gTn2Tru0GP8LWlFjtAc6+uJH MVCehfrVtr8Ir/EL3I4sduYYDHG6lWI6BZq9xIs3s0XoNQLgLIIJxWAYSmTOQpaRLecn iaFcWNMymmX82KOXBIoFNY54wVZ74NCnnCNE2Da4RUtla9qmR6jfcB975pfRFenNcnLF CFX59cCYG8dkH3kRtqAHtQkGJvOtWekQyJTN/4bFjLkStiBr/bJsfAUJpXIzZS9Z6dDb 3wPg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=PqHHu7Rm; 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-145790-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145790-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. [147.75.48.161]) by mx.google.com with ESMTPS id h9-20020a056a00170900b006ea93dd9239si8723562pfc.144.2024.04.15.12.39.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:39:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-145790-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=PqHHu7Rm; 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-145790-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145790-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 4C790B234D5 for ; Mon, 15 Apr 2024 19:38:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6737315B55F; Mon, 15 Apr 2024 19:34:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="PqHHu7Rm" Received: from mail-qk1-f173.google.com (mail-qk1-f173.google.com [209.85.222.173]) (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 4916F1598F6 for ; Mon, 15 Apr 2024 19:34:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713209679; cv=none; b=oRHVPEA5CFaJ0PBdzdMd6lItDqyv806nujXlgh8iDv3Wp/VC3ZBluNVqeSFnB6fqPPipC+HY6XqPFnglx6+X4iiqHoAnKI0R+MbzDqqFxqEjwcAMHuyh3HmzZ3cRmN/El9ZLIlI0TxWw/NcgGEbfH9G7vgArnT87kRFc64I9HhU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713209679; c=relaxed/simple; bh=Vt+H5ZpqsJCiF9cU1Vjk0O2CGGQ8VmqV+GtNWpgDBmE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=GeikWJy8NO3O+OdyQktPzsOest8wrgvXnKyPJaZYCv/Ub0ib9xmMsiNWkL6LkdLj+P6jDyJcgBZY3x9LbdHIjmTRLC3YTDf6iMNahWTnlZBf9PBTEpEa5y1xpxVliBEeiYeB0gpdzgUUK0h4VPuBhNbnaFhDsxQULyIYm2yQLsQ= 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=PqHHu7Rm; arc=none smtp.client-ip=209.85.222.173 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-f173.google.com with SMTP id af79cd13be357-78d555254b7so293822985a.1 for ; Mon, 15 Apr 2024 12:34:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713209675; x=1713814475; 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=ISUo+c+Z6d9jp43vDna7WArpy0Bh/pUYqJP92YgrR0w=; b=PqHHu7RmgCAD1Sr6qGyZWedulmMJOF+HjBZ+05IojvtMGTnBpMUrUN3yKg9wo4WpcX VtU8n0qcp+fV8oERGRlLFWaXkYod9FFHMPQChDDMX/4eq0dBiST1wSGtOYYAjLPVi+J9 6tGu7PpvVN8EN+Uy10VEOKX8HZFuIfgWM70Mc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713209675; x=1713814475; 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=ISUo+c+Z6d9jp43vDna7WArpy0Bh/pUYqJP92YgrR0w=; b=Du4eXYK9aTwimK79IPIrgTmi0+FG5a03A78pIK+AWvkjgJF9wMtKgLqr+n3nkGUU03 xP/Fq/nT2DNn5NXkuNol5HVlTqkC+AKvN+yhfrtE+Q5kSURm+s2eRkXdRytjiDg6r3V9 AU1zYCGZJc/BJ0iCW6WEUl9wKTQHgBmIEBkqNbGTGi7Yy7oAyR5okVtOLXZhivwFeGC4 xSnbnMAGRvvvVdDL46BNg4oEMt9v5Wih+a9siHQEcSFvO4CyQccT2CE+PyeEohf1ji18 m6aRw4qJ3y0PYepYRrT/9YA+Ehp5cSUhnXofm8QWcIzR7qeRfQ7MlZhuFuyqtpnxMrKY hkSQ== X-Forwarded-Encrypted: i=1; AJvYcCUUWYBZZYkvX2OLV5AQMoHZlBbsAOaXC0qom73kENASFGnp7dFBDY5P8Exd1EhlDg/MS3s7UU9JVW4Gspiizo+qQbVuh3tyLCMaj4Ow X-Gm-Message-State: AOJu0YximOB7XvkFCktHidkLIZzovwgVxaIR4lpGhySI+4cfWr7F1seI BXAhBoasPVmGxhecez2fCGr7TyDgdvgiOVo3954SxHd0+5Evkokqa4wLtfEvDQ== X-Received: by 2002:a05:620a:470f:b0:78d:3b55:21c8 with SMTP id bs15-20020a05620a470f00b0078d3b5521c8mr1321999qkb.24.1713209675268; Mon, 15 Apr 2024 12:34:35 -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 s26-20020ae9f71a000000b0078d3b54eb76sm6718055qkg.78.2024.04.15.12.34.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:34:34 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 15 Apr 2024 19:34:25 +0000 Subject: [PATCH 08/35] media: dvb-frontends: tda18271c2dd: Remove casting during div 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: <20240415-fix-cocci-v1-8-477afb23728b@chromium.org> References: <20240415-fix-cocci-v1-0-477afb23728b@chromium.org> In-Reply-To: <20240415-fix-cocci-v1-0-477afb23728b@chromium.org> To: Martin Tuma , Mauro Carvalho Chehab , Laurent Pinchart , Hans Verkuil , 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 , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio , Benjamin Mugnier , Sylvain Petinot , Jacopo Mondi , Kieran Bingham , Laurent Pinchart , =?utf-8?q?Niklas_S=C3=B6derlund?= , Pavel Machek 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 do_div() divides 64 bits by 32. We were adding a casting to the divider to 64 bits, for a number that fits perfectly in 32 bits. Remove it. Found by cocci: drivers/media/dvb-frontends/tda18271c2dd.c:355:1-7: WARNING: do_div() does a 64-by-32 division, please consider using div64_u64 instead. drivers/media/dvb-frontends/tda18271c2dd.c:331:1-7: WARNING: do_div() does a 64-by-32 division, please consider using div64_u64 instead. Signed-off-by: Ricardo Ribalda --- drivers/media/dvb-frontends/tda18271c2dd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/dvb-frontends/tda18271c2dd.c b/drivers/media/dvb-frontends/tda18271c2dd.c index a34834487943..fd928787207e 100644 --- a/drivers/media/dvb-frontends/tda18271c2dd.c +++ b/drivers/media/dvb-frontends/tda18271c2dd.c @@ -328,7 +328,7 @@ static int CalcMainPLL(struct tda_state *state, u32 freq) OscFreq = (u64) freq * (u64) Div; OscFreq *= (u64) 16384; - do_div(OscFreq, (u64)16000000); + do_div(OscFreq, 16000000); MainDiv = OscFreq; state->m_Regs[MPD] = PostDiv & 0x77; @@ -352,7 +352,7 @@ static int CalcCalPLL(struct tda_state *state, u32 freq) OscFreq = (u64)freq * (u64)Div; /* CalDiv = u32( OscFreq * 16384 / 16000000 ); */ OscFreq *= (u64)16384; - do_div(OscFreq, (u64)16000000); + do_div(OscFreq, 16000000); CalDiv = OscFreq; state->m_Regs[CPD] = PostDiv; -- 2.44.0.683.g7961c838ac-goog