From patchwork Fri Apr 19 09:48:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13636101 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 66DD2C4345F for ; Fri, 19 Apr 2024 09:53:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=isn+jpdZQNj1KWuFgML2IDkHyK49L6/UNaRtrbvBjhQ=; b=DrpYf2GkQiqg3N dzLVdbGnHHQljuNr/IlSpNnZL0wV76VusbO1mzoYI8nzf3BVx/l+LPr8DUngKEx2rR8Yz3ebS/Tn5 6jB4/RbUwCUEUjRFKsup73bbewfejVDeGg8tSpbt9favYLUhm7HrAbX6yIqv7Pt3xV8t9gFq+azx6 h9duJFUF37JcNk+ymqb/Gxj9j2avO1oLdiM7H31342jTD+CHmvJK2upvic7xR/sn61nktA7gc3wqr RWdomX1gISivbtJ3pX9XOhR2SdiFgnvVYl4p9nRTghLEUOlxGqYNUtbagRGdihlmhzbN0+ya7j7Xs rQKy+UPdX2+iZjCQbcdw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rxkvI-00000005AvJ-3aKS; Fri, 19 Apr 2024 09:52:48 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rxksS-000000059FD-1H9o for linux-arm-kernel@bombadil.infradead.org; Fri, 19 Apr 2024 09:49:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=mekpuuLwriZD6IkthqRlN7odC9zWZqgKPV8UcJZ7R9M=; b=b421Ft/YuyMytGAkKnWe+G4wPf /fgyT4kgPVAZapEc8pJv4n/Elu8CchSMfgIJVaWcgsRRQW34W4dzc/GDrYSm6P6DWZXJ37zNjYrIR RmrQETSzaMGNtkpzH5zJCjITh4EYCDuo6+OajbEUT4KwIRue7dojmxSjo+siW4Kt2BUr8Ng3eJRnT OM+nYTqgPHELWkAkhXl4bS9r71kKzY8ijQUPvHewf4OaA9Jvivh+lkZICrM86JXlygd6EY59U/Fx2 vACZDjHHPWqMZ8BEJfVNq9cTzfyOWsImOzEGGkAGLYsmAOv622W3yoNRZfGiPp3odnoK+1JIA+4yW EurIa4NA==; Received: from mail-ot1-f48.google.com ([209.85.210.48]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rxksM-0000000COSD-1qJS for linux-arm-kernel@lists.infradead.org; Fri, 19 Apr 2024 09:49:50 +0000 Received: by mail-ot1-f48.google.com with SMTP id 46e09a7af769-6ea2f95ec67so906792a34.2 for ; Fri, 19 Apr 2024 02:49:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713520184; x=1714124984; darn=lists.infradead.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=mekpuuLwriZD6IkthqRlN7odC9zWZqgKPV8UcJZ7R9M=; b=TdlJUqVdsxsctOWn7kZrmFKVhePSJK8VGYsXuNscLx4dd3PNNblcNQLUZqnGi5+p6Y ob1PmG/NCSwyZ6xzCZUbKpMt8IQAmBrPwcrZhoFnUpSvGnynvBngZ6/MHLsL+Ha9U/cs 4ETSBN1nUDOe3IwIroc7AIWQEbqDmaZ58xjwA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713520184; x=1714124984; 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=mekpuuLwriZD6IkthqRlN7odC9zWZqgKPV8UcJZ7R9M=; b=BuAcGxH11TsIePnZTSIAhjPs3kwRlIBRmQdUSA83qt5OPQ/vrSrPn/41Na+NJsKFJO /+Fpr0DYk3PTFL05TFXltCsufPBNWbbHOsG9s0ztTlMwjBFK5Q4B/HOAHz67hApxbJ/w EwIUkqO4gztScSRW0k3Au+TozdZneic1gqmbH83V35ogcvJTD6SVdnpCGw4+QibMETqV 3t00zOhrRSob2slWaYU8hfpcp4skiXnjAaXiEOc5MaINbhE+/kZXWeUVoR1k/6Mu51KV tB/N7mfsClx2KxaMfF9qYBIN7BCPJlCypaERzWj7u4nm5VZ0dGjAdlL8i/vamWIANHFm I0+A== X-Forwarded-Encrypted: i=1; AJvYcCXrwpq4rwsi52Y/PmHKdUu1pJWiC3W7OI+E+AVSOk1U6nHV36sTl5K3a8h3cH0+trj5+5uuJAkVsSF0Eo9V7aL6qJSOuMj3RG3tb2w1JjPsMr/K26E= X-Gm-Message-State: AOJu0YwPv9QzOWMESFmTB+jFBV1ENhz1m/AoR9DMdnKY0x29W2eHR6+8 KeyOjvjk53FxKs9TnyvRiVKWSAw3JGLdf20+ZmKUoVlcElu8r9Quw1Qq0tpWAw== X-Google-Smtp-Source: AGHT+IEYwOxlb1WugYE4t9h28+AXEwcDjQAa28XJBDFMEfi87sd7BKKPg6Joa8eH6oaaPvD2ajlMkw== X-Received: by 2002:a9d:7f03:0:b0:6ea:1dc5:514c with SMTP id j3-20020a9d7f03000000b006ea1dc5514cmr1695945otq.11.1713520183703; Fri, 19 Apr 2024 02:49:43 -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.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 02:49:42 -0700 (PDT) From: Ricardo Ribalda Date: Fri, 19 Apr 2024 09:48:07 +0000 Subject: [PATCH v2 21/26] media: i2c: st-mipid02: Use the correct div function MIME-Version: 1.0 Message-Id: <20240419-fix-cocci-v2-21-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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240419_104947_636393_98E80C2C X-CRM114-Status: GOOD ( 12.83 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org link_freq does not fit in 32 bits. Found by cocci: drivers/media/i2c/st-mipid02.c:329:1-7: WARNING: do_div() does a 64-by-32 division, please consider using div64_s64 instead. Reviewed-by: Benjamin Mugnier Signed-off-by: Ricardo Ribalda Reviewed-by: Sakari Ailus --- drivers/media/i2c/st-mipid02.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/i2c/st-mipid02.c b/drivers/media/i2c/st-mipid02.c index f250640729ca..93a40bfda1af 100644 --- a/drivers/media/i2c/st-mipid02.c +++ b/drivers/media/i2c/st-mipid02.c @@ -326,7 +326,7 @@ static int mipid02_configure_from_rx_speed(struct mipid02_dev *bridge, } dev_dbg(&client->dev, "detect link_freq = %lld Hz", link_freq); - do_div(ui_4, link_freq); + ui_4 = div64_s64(ui_4, link_freq); bridge->r.clk_lane_reg1 |= ui_4 << 2; return 0;