Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1325763lqa; Mon, 29 Apr 2024 05:40:32 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUD9KtN1PQC2qVTmxk7LVyy/P1RIbbW9bHKQDh0TzbqG3LDLVfnnJuSVT8A790z7LdPhdO5xLxkDnjdh7UGaRrihmgzH2Jt6BCRD3oXMg== X-Google-Smtp-Source: AGHT+IGzEwqw5qp7kCUUXzaXuzm5TKJoX8fcsGuQgZpTjX/TH+hy9Es07xxv3DN8cxQiG1rLF0Ln X-Received: by 2002:a17:902:6e02:b0:1e5:5cab:3185 with SMTP id u2-20020a1709026e0200b001e55cab3185mr10427055plk.25.1714394432315; Mon, 29 Apr 2024 05:40:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714394432; cv=pass; d=google.com; s=arc-20160816; b=VjgzLwrtPsMjKA8BzPVlatNVUbKOVJfeTeXc47DgxMpnuBX8tW2oo5ejqhyu+gI/3P 4DGop2K2eSsbX1E+tHuLGGEtQRHHalGDZDLAXhndUAkE646c7PuQ13LIvIDOjOfqUeTK bZ5ZkUeFSwBle9mj/Da9zImrafcVFY8Y4IWVP1TLm+9Qs5eT/qr24dipGeDGQBd9mydi IiC1nlVrz/0kZErK+rELIs4yiB0pg34tZEnt39A1qiel2PECxrqfqbTgyv81nPY1EEdW UJyDbld0Ntz+pxxfZ5dy6BCODuFim3yLrfrMAMtP7XZX8pExj/XtLO44t2Sk7J8tEMzx 8Hvg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=RgUZ7u6Yue6qp20Szyr4ygGSXhk+OQVUPDAlq8ymJuw=; fh=BQaUT5fUS8AwfK9CAXH3w1dpBih45PO2rhV9j1RLmXo=; b=SOddtcIFW2aBj83GUemv7pt0CySMxhr9C1wdeKfmer/8mI7tZmrlF1Gxl1KKRpq+UT k7RXfLQUJK7JeRFvppCWEjfOga6gKN7fyphE1rk/sbVtfUPZfRznNSOKFjPSMmGhojkM /p7zLjUP91j/D/K0UMC9HGP6thEJf851CaPoWdV9t1mm4L8Rmy31czUEClYksHzoPP1+ gCC0dDbZw+bLr03mFEz0QTfh76ltGyAYauPjbA+yUre5hSQU2NK2y6ppWOSe+7yqUXqq T6fyvs+s+N5xHFKRQOhSX7kM2kGs7+62ZzRpZzDrocGpM30I6h1wxcs1gyphHHxZ1BT6 Pw6Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ckc5k5lO; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-162212-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162212-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.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 z4-20020a170903018400b001eadb402587si7184310plg.339.2024.04.29.05.40.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 05:40:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-162212-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=@kernel.org header.s=k20201202 header.b=Ckc5k5lO; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-162212-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162212-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.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 1AA53B25609 for ; Mon, 29 Apr 2024 12:14:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2A452537E4; Mon, 29 Apr 2024 12:11:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Ckc5k5lO" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 51AD852F6D for ; Mon, 29 Apr 2024 12:11:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714392681; cv=none; b=AKT7hbCeLl7KagjbfwepdqXXQiEXj8xb3Nma7YLcuD+PV+gHzObwYeXdI1N5+Nkwr98RN2U7q4UA0hfVqUTXijsayhbZ/0P3G1ZwCMcXDAniALZUnMaL5ausmcRm3PbqMMXkM9ex144irycV7K98JJNzAj0QUw2CImfqGdlypZU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714392681; c=relaxed/simple; bh=X1Qvu63kkY3/b6fxxe2AVsLJHeAHq2bhdDS7GrXYg8Q=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=p/I1VkpVNnCbYmrTi+33C7ouumWwnaTWTIgzXmUYAHMQwzvUVPXfdQMKz0/TrjMJ8ukshzTg580YxgYJWDDApebRCvW2o3ugOvEBa0RA6QRscFOEFKH90i7c6vcQfHIWiwSWFR0B18ibkLpWXuQw+SP3rpqJSOJYeMP7i290BZo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Ckc5k5lO; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 020DFC113CD; Mon, 29 Apr 2024 12:11:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714392680; bh=X1Qvu63kkY3/b6fxxe2AVsLJHeAHq2bhdDS7GrXYg8Q=; h=From:To:Cc:Subject:Date:From; b=Ckc5k5lO0SoC2waH5Mm3uRE9/G6jrfXw9PNzLBHvSRMyV341Vm+RlthYwYgCipJIH 0E3j9rgXWKj2scNo1w2qh1TrvnXJLSmpRRpI0viX4y2eCYyCJRJf5QWbc4Isd2Rw9d Zi82egH2foL7xEEQJx12SiBOcSAbgTND1blxsrk6/U14zb1Z4TTPl99bxlWtrYlP/I DcSH0u5vWZrdGTZ7x28mtnOaJ9WvfVL9PZyiFI8wsJFCFxTFBpn9O0ufS1vK1jkTbk ctvnCu+dyyE6/MTXmGIFIc/qYZI7TEa60LaSrFrEihxBDd7ubL6E6NMl4WnxxWzHVF dFfkqnELShCUw== From: Michael Walle To: Tudor Ambarus , Pratyush Yadav , Michael Walle , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Dan Carpenter Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] mtd: spi-nor: replace unnecessary div64_u64() with div_u64() Date: Mon, 29 Apr 2024 14:11:13 +0200 Message-Id: <20240429121113.803703-1-mwalle@kernel.org> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Both occurences of div64_u64() just have a u8 or u32 divisor. Use div_u64() instead. Reported-by : Dan Carpenter Link: https://lore.kernel.org/r/9ba7f4e6-2b8b-44a3-9cac-9ed6e50f1700@moroto.mountain/ Signed-off-by: Michael Walle --- drivers/mtd/spi-nor/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c index 3e1f1913536b..028514c6996f 100644 --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c @@ -2893,7 +2893,7 @@ static int spi_nor_late_init_params(struct spi_nor *nor) spi_nor_init_default_locking_ops(nor); if (params->n_banks > 1) - params->bank_size = div64_u64(params->size, params->n_banks); + params->bank_size = div_u64(params->size, params->n_banks); return 0; } @@ -3406,7 +3406,7 @@ static int spi_nor_set_mtd_eraseregions(struct spi_nor *nor) return -EINVAL; mtd_region[i].erasesize = erasesize; - mtd_region[i].numblocks = div64_ul(region[i].size, erasesize); + mtd_region[i].numblocks = div_u64(region[i].size, erasesize); mtd_region[i].offset = region[i].offset; } -- 2.39.2