Received: by 2002:ab2:7041:0:b0:1f4:bcc8:f211 with SMTP id x1csp173245lql; Fri, 12 Apr 2024 07:10:17 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUta7BTnbAEmV0cNrOnTa9hJ+3jGBihbetApCpMc3pu2sPrsxVktpWRslh95rr4PRQfo+XYXdcctSFILMoeDYRQOlNZixkJP6E8iwW8pg== X-Google-Smtp-Source: AGHT+IHvrMe4t0pC/GtnIl7WJsl20UVE5KkottmmKnp9Kp3qKRTgBfPWD1MHKH+MC60EM/+aM55P X-Received: by 2002:ac2:531c:0:b0:516:be3e:57a1 with SMTP id c28-20020ac2531c000000b00516be3e57a1mr1624472lfh.66.1712931017662; Fri, 12 Apr 2024 07:10:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712931017; cv=pass; d=google.com; s=arc-20160816; b=GiFPOjobpc9bgOmiDfh0UBm2c2qsLwPtpg2oYFhII++OL3oSJLBI2QQniCVj3hQ2ZO vOI1Jr59faaVujDWTazOLI7THbVRgztPc7PCPoqqOhjjKHZ4sb7zSqF0bjvmICC1UnXQ fD13elUoZBdFVXW439EYP/5jjyN/8jrWK7hT2mc37EVveR6Gy5xd3RVxpzRse3Bst7qi AFXUsfD1kCeQItABi6IKFJocq4JLTtsS01Tda5P+Qbbue4aDfcNio/IS8pNexiS3No5/ Hi68JXQmNWMGwf/qL4BV+TJjDxZL+Xa6O/iUHGHWXPa/6Qcn+3awgsIJ8nQ6cuOqs6fd eR6A== 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=2v42DRWLOed5JT4EgzNbhffgc6QDunSBW8zl0fYmT1o=; fh=4cUjKM0C+FjoE8+auJyAa+zqROAnBtKvDm0QqgVXEnc=; b=OfMjvfvvPyxyu0ghag+ORZtemUF0iTvd2DOHUGrvZJ+B7C8OosudtOOEKiOaJmjfIz QR81/4CNcMGBLkHDzACPOh76yFuZPKcAxaFF4iZr2EOES/2RIqh5aq9/0FYk3VPLtU2R Ji29YBZPMX8xq+dHVAId/0ieKrFpuiwQd84JsSu0dJ7TK4V6F/gCQYxpQQH7pjqlK/4h ZmH9+JUtdprRruk2+J1eXQ1qqCM1OfdQpttvY6A6CKmYB8b+fdnF85c440v5ZoyG3ZJK tsFbv+9batelxju4VUkBMt8P+N67iXsksGG63YO9SZPiOTymKNweJyKthqKHoXcd5zKj qElA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="e4MuP/Vb"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-142796-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142796-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id dr15-20020a170907720f00b00a523c5c895fsi428083ejc.144.2024.04.12.07.10.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 07:10:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-142796-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="e4MuP/Vb"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-142796-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142796-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 62CE61F23FB4 for ; Fri, 12 Apr 2024 14:10:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8CE5383CDB; Fri, 12 Apr 2024 14:10:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="e4MuP/Vb" Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) (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 8E0DB85939; Fri, 12 Apr 2024 14:10:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712931008; cv=none; b=Y3DWvMG7VvzVu6SCI+Q2Fo9DZTdkSq+ugMNtmWx3Wer/OyvUfCrreWMVk4UBbNyWiQuv28kXV6oQ+X010WTbXDKkETNn0era+u00zuyOpaV6I6eWrTe8mKXEg6vxjGfF3ta1aHXIfSFbr1HFBtmh2md2RLYNSo2fU8X6ozzSOTE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712931008; c=relaxed/simple; bh=kP5fvy0TH4cELyJB6+wTRXk3uN7OL9Rtm3SJaT9RpWU=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=iMF/dbEDtKsLmMmhNRNh8GWh8orapvnPxWsg+1Y5yf8l3+Iyh1XUDUfdyspFQiW6bT+NP4UIXIPFeJF9HC/+u56x6q2vw7P60Y8+7D4bjRhFWytSG6PCi3nyEFkhpYxoMR+FJB8ysCHNa/T5VZc06QR6HjseRoQapy7SfOS4A14= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=e4MuP/Vb; arc=none smtp.client-ip=209.85.210.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-f176.google.com with SMTP id d2e1a72fcca58-6ead4093f85so843235b3a.3; Fri, 12 Apr 2024 07:10:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712931007; x=1713535807; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=2v42DRWLOed5JT4EgzNbhffgc6QDunSBW8zl0fYmT1o=; b=e4MuP/VbBGS8nQ/JYdnIjH60gpqMxMM9lMw3FzyzknUen5n6biaKHIJ/vB9XMaMmsB 0s3H7X9lgnAcCVnwdcLILHE9aEjyqXPRPQwUTiDwdz7TpkenP4WvvzNTvkT0xvUk68i7 DsgVWv6ivxzro/EC0EmOcjLl65UU0Ga6l9xIpztELVFooT9H07nwaRJt9RlKcD5oC4tq TzGYdQy3UVppoeMOdE4M4H9g9Ply3Lkzp6CZhzYOQKYpyo7XK9JyCG1jzHrSqO+7oqMl R/1sFDJWxHc/0ADPtI8flQj5Y8uTIM9RDEavjltEJfZt81ZZV3eoTJG85a9SueaNCGud p93A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712931007; x=1713535807; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=2v42DRWLOed5JT4EgzNbhffgc6QDunSBW8zl0fYmT1o=; b=Yx+sBokcVHleG2JDuoM7iZk90O9j2Kr14oimGhrNiTaB+WEywy1V81+uhtZBtMuWOS b/H3Mzimtfml+MY0tAN8KQAf5cYz2q0FAY5I1mhrth+jZDUr8br8yC1CNkr03D6nEWQn qjJMLCRx7XbDcgcE8MEvJkf6TJuK5KYj/EABmVKYBAPYbeE24e1BAl8BAEls1NgS4k6B 7m0BBhM2SjGym84NJc+go82KRGq/m3IrF4a+PXt04wyyAZwNJziFunEWvQ4SD7M5VacN iXyXT7BijJLp879zZEaMEvUGzR260c97t5sW9Zhl3l5p1lK5IfNSlZxF2OzNbl61kMMQ 8+Vw== X-Forwarded-Encrypted: i=1; AJvYcCVOqIOCsgX6M1K3sVHDBDtWzy5Q62yW33LrzkHDhhMpnkasuz6HU/SxfgJfNVn8aR+xQsIL/x8o3ndX6gcqnIhFXZrCgQzW0XkGR7Hs X-Gm-Message-State: AOJu0YxYzP7NH4qrerqWnUEt0ZEVsbTI2Ge3fD+cvH8P9VrJzL0XYGcQ 3vsNnruQY2yTxZCbo+twVt1rQ+1gOTuDSLGfSr/E8FaDNMImxAKk X-Received: by 2002:a05:6a00:b4a:b0:6e8:3d5b:f3b1 with SMTP id p10-20020a056a000b4a00b006e83d5bf3b1mr2703700pfo.22.1712931006678; Fri, 12 Apr 2024 07:10:06 -0700 (PDT) Received: from localhost.localdomain ([49.142.40.215]) by smtp.gmail.com with ESMTPSA id c9-20020a056a000ac900b006e647716b6esm3006425pfl.149.2024.04.12.07.10.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 07:10:06 -0700 (PDT) From: skseofh@gmail.com To: robh@kernel.org, saravanak@google.com Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Daero Lee Subject: [PATCH] of: of_reserved_mem: remove repeated call to get no-map property Date: Fri, 12 Apr 2024 23:09:38 +0900 Message-Id: <20240412140938.137803-1-skseofh@gmail.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Daero Lee In __reserved_mem_alloc_size, of_get_flat_dt_prop is called and checked whether the "no-map" property exists for the node. In fdt_init_reserved_mem, the only caller of __reserved_mem_alloc_size, we checked this again for the same node. Therefore, repeated of_get_flat_dt_prop call was removed and 'nomap' was passed as an input parameter to the callee function. Signed-off-by: Daero Lee --- drivers/of/of_reserved_mem.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c index 8236ecae2953..cb86a28379c7 100644 --- a/drivers/of/of_reserved_mem.c +++ b/drivers/of/of_reserved_mem.c @@ -254,14 +254,13 @@ static int __init __reserved_mem_alloc_in_range(phys_addr_t size, * 'size', 'alignment' and 'alloc-ranges' properties. */ static int __init __reserved_mem_alloc_size(unsigned long node, - const char *uname, phys_addr_t *res_base, phys_addr_t *res_size) + const char *uname, phys_addr_t *res_base, phys_addr_t *res_size, bool nomap) { int t_len = (dt_root_addr_cells + dt_root_size_cells) * sizeof(__be32); phys_addr_t start = 0, end = 0; phys_addr_t base = 0, align = 0, size; int len; const __be32 *prop; - bool nomap; int ret; prop = of_get_flat_dt_prop(node, "size", &len); @@ -284,8 +283,6 @@ static int __init __reserved_mem_alloc_size(unsigned long node, align = dt_mem_next_cell(dt_root_addr_cells, &prop); } - nomap = of_get_flat_dt_prop(node, "no-map", NULL) != NULL; - /* Need adjust the alignment to satisfy the CMA requirement */ if (IS_ENABLED(CONFIG_CMA) && of_flat_dt_is_compatible(node, "shared-dma-pool") @@ -451,7 +448,7 @@ void __init fdt_init_reserved_mem(void) if (rmem->size == 0) err = __reserved_mem_alloc_size(node, rmem->name, - &rmem->base, &rmem->size); + &rmem->base, &rmem->size, nomap); if (err == 0) { err = __reserved_mem_init_node(rmem); if (err != 0 && err != -ENOENT) { -- 2.25.1