All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yuntao Wang <yuntao.wang@linux.dev>
To: Rob Herring <robh@kernel.org>, Saravana Kannan <saravanak@google.com>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>,
	Catalin Marinas <catalin.marinas@arm.com>,
	AKASHI Takahiro <takahiro.akashi@linaro.org>,
	James Morse <james.morse@arm.com>,
	Chen Zhou <chenzhou10@huawei.com>, Baoquan He <bhe@redhat.com>,
	Zhen Lei <thunder.leizhen@huawei.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Changyuan Lyu <changyuanl@google.com>,
	Alexander Graf <graf@amazon.com>,
	"Mike Rapoport (Microsoft)" <rppt@kernel.org>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	Yuntao Wang <yuntao.wang@linux.dev>
Subject: [PATCH 04/10] of/reserved_mem: Use dt_root_addr_size_bytes() instead of open-coding it
Date: Wed, 12 Nov 2025 22:35:14 +0800	[thread overview]
Message-ID: <20251112143520.233870-5-yuntao.wang@linux.dev> (raw)
In-Reply-To: <20251112143520.233870-1-yuntao.wang@linux.dev>

Use dt_root_addr_size_bytes() instead of open-coding it in
__reserved_mem_alloc_size() to improve code maintainability.

Signed-off-by: Yuntao Wang <yuntao.wang@linux.dev>
---
 drivers/of/of_reserved_mem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c
index 0e6b0e7968a9..8d9139f4297f 100644
--- a/drivers/of/of_reserved_mem.c
+++ b/drivers/of/of_reserved_mem.c
@@ -401,7 +401,7 @@ static int __init __reserved_mem_alloc_in_range(phys_addr_t size,
  */
 static int __init __reserved_mem_alloc_size(unsigned long node, const char *uname)
 {
-	int t_len = (dt_root_addr_cells + dt_root_size_cells) * sizeof(__be32);
+	int t_len = dt_root_addr_size_bytes();
 	phys_addr_t start = 0, end = 0;
 	phys_addr_t base = 0, align = 0, size;
 	int len;
-- 
2.51.0


  parent reply	other threads:[~2025-11-12 14:37 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-12 14:35 [PATCH 00/10] of/fdt: Some bug fixes and cleanups Yuntao Wang
2025-11-12 14:35 ` [PATCH 01/10] of/fdt: Introduce dt_root_addr_size_cells() and dt_root_addr_size_bytes() Yuntao Wang
2025-11-12 16:25   ` Geert Uytterhoeven
2025-11-12 14:35 ` [PATCH 02/10] of/reserved_mem: Use dt_root_addr_size_bytes() instead of open-coding it Yuntao Wang
2025-11-12 16:28   ` Geert Uytterhoeven
2025-11-12 14:35 ` [PATCH 03/10] " Yuntao Wang
2025-11-12 16:29   ` Geert Uytterhoeven
2025-11-12 14:35 ` Yuntao Wang [this message]
2025-11-12 16:30   ` [PATCH 04/10] " Geert Uytterhoeven
2025-11-13 14:21   ` kernel test robot
2025-11-13 23:46   ` kernel test robot
2025-11-12 14:35 ` [PATCH 05/10] of/fdt: " Yuntao Wang
2025-11-12 16:32   ` Geert Uytterhoeven
2025-11-12 14:35 ` [PATCH 06/10] of/fdt: Fix the len check in early_init_dt_check_for_elfcorehdr() Yuntao Wang
2025-11-12 14:35 ` [PATCH 07/10] of/fdt: Fix the len check in early_init_dt_check_for_usable_mem_range() Yuntao Wang
2025-11-12 16:47   ` Geert Uytterhoeven
2025-11-12 14:35 ` [PATCH 08/10] of/fdt: Use dt_root_addr_size_bytes() instead of open-coding it Yuntao Wang
2025-11-12 16:33   ` Geert Uytterhoeven
2025-11-12 14:35 ` [PATCH 09/10] of/fdt: Fix incorrect use of dt_root_addr_cells in early_init_dt_check_kho() Yuntao Wang
2025-11-12 16:54   ` Geert Uytterhoeven
2025-11-12 14:35 ` [PATCH 10/10] of/address: Remove the incorrect and misleading comment Yuntao Wang
2025-11-12 16:56   ` Geert Uytterhoeven
2025-11-12 20:07   ` Rob Herring
2025-11-12 20:08   ` Rob Herring
2025-11-12 20:55 ` [PATCH 00/10] of/fdt: Some bug fixes and cleanups Rob Herring
2025-11-13 16:00   ` Yuntao Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251112143520.233870-5-yuntao.wang@linux.dev \
    --to=yuntao.wang@linux.dev \
    --cc=akpm@linux-foundation.org \
    --cc=bhe@redhat.com \
    --cc=catalin.marinas@arm.com \
    --cc=changyuanl@google.com \
    --cc=chenzhou10@huawei.com \
    --cc=devicetree@vger.kernel.org \
    --cc=geert+renesas@glider.be \
    --cc=graf@amazon.com \
    --cc=james.morse@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=rppt@kernel.org \
    --cc=saravanak@google.com \
    --cc=takahiro.akashi@linaro.org \
    --cc=thunder.leizhen@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.