Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp758087pxb; Mon, 25 Oct 2021 18:18:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJziHZShnDcWODycsYlnCuz2Qptm8vrALh8SmiohdMnuig2aCJv2yDRNoD+sJ9yARaAmUVvD X-Received: by 2002:a05:6a00:1a16:b0:47c:11bb:f833 with SMTP id g22-20020a056a001a1600b0047c11bbf833mr376681pfv.2.1635211084289; Mon, 25 Oct 2021 18:18:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635211084; cv=none; d=google.com; s=arc-20160816; b=ETLHvSTW9tut5S6Uht1WZ+wLd0BWQdSfJCCNkoV2e/tlw0AiLBELsmRHt/MULHFGeS G+6/BiWFWczHhWAy1YvLX0TLSDGRDH/4/QL2Kc1ah2mCvWBwEsaMaMZ3a7LFzHlezdbn fauqsmwWgYCKPdciKdF8xPNERunT+jEkQjh7T3tjL0wjkr/0I/3WZ4sX3wwQbG8+oPXF z94KeGlNAqy55PL7A4CqAIPxPYVmmdhtoAwF2+23m0zVUXcml+QlgxMxVusUsT+8LVN5 iCTgv+uU35hjEjCerBQCzL/CTvEDjJ2gg6OL5VjgWNgYN1oTHJ+IEFr5qfIfpWaOGJJR d+uA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=1RZvkoA/sl7KvzulpyCg2gDdKYg9I01sggRNR8L+wOQ=; b=iQkoVJHabVTyK5TQ/CPzYqVSm7DNbQWZ/hW1HlWU6kd6X44gkjRrTMNCKNNNefoFiV Iv3mY889pgErCqA6jikIJDDzlXQv01EFLXjQtBqnOS37ziUCJ6VlBfqt/JZrX8F0Vdnj mGlbwHi1aKOauvqA/hkp2NzXW6F5QUoKtTIgp3/xj0xzvNGMEgUms9J+MXwxkD6Ss9Ui zWlqcr9wpLG2kFwc1OJklKktFMrwOA0unEUr29ScVrZN3DU6UIn23vEywVyfVyQYeBGn y89TrBnCs2fC5OMjjpWhNcUfF28uDUxQ7B5ldo4soNIuhhw7T74TUtm7TVqEW7g0XnS+ b5Kg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t2si16670732pjg.19.2021.10.25.18.17.51; Mon, 25 Oct 2021 18:18:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234957AbhJYU7i (ORCPT + 99 others); Mon, 25 Oct 2021 16:59:38 -0400 Received: from relmlor1.renesas.com ([210.160.252.171]:27422 "EHLO relmlie5.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S234955AbhJYU70 (ORCPT ); Mon, 25 Oct 2021 16:59:26 -0400 X-IronPort-AV: E=Sophos;i="5.87,181,1631545200"; d="scan'208";a="98142156" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 26 Oct 2021 05:57:02 +0900 Received: from localhost.localdomain (unknown [10.226.36.204]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 5D67C41003BB; Tue, 26 Oct 2021 05:56:59 +0900 (JST) From: Lad Prabhakar To: Krzysztof Kozlowski , Rob Herring , Vignesh Raghavendra , Miquel Raynal , Richard Weinberger , Mark Brown , Philipp Zabel , Geert Uytterhoeven , Wolfram Sang , Sergei Shtylyov Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, linux-spi@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Prabhakar , Biju Das , Lad Prabhakar Subject: [PATCH v2 6/7] memory: renesas-rpc-if: Drop usage of RPCIF_DIRMAP_SIZE macro Date: Mon, 25 Oct 2021 21:56:30 +0100 Message-Id: <20211025205631.21151-7-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211025205631.21151-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20211025205631.21151-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org RPCIF_DIRMAP_SIZE may differ on various SoC's. Instead of using RPCIF_DIRMAP_SIZE macro use resource size to get dirmap size which is already part of struct rpcif. Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Reviewed-by: Wolfram Sang --- v1->v2: * New patch (split from patch 5 of v1) * Included RB tags --- drivers/memory/renesas-rpc-if.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/memory/renesas-rpc-if.c b/drivers/memory/renesas-rpc-if.c index ff8bcbccac63..0c56decc91f2 100644 --- a/drivers/memory/renesas-rpc-if.c +++ b/drivers/memory/renesas-rpc-if.c @@ -147,8 +147,6 @@ #define RPCIF_PHYINT 0x0088 /* R/W */ #define RPCIF_PHYINT_WPVAL BIT(1) -#define RPCIF_DIRMAP_SIZE 0x4000000 - static const struct regmap_range rpcif_volatile_ranges[] = { regmap_reg_range(RPCIF_SMRDR0, RPCIF_SMRDR1), regmap_reg_range(RPCIF_SMWDR0, RPCIF_SMWDR1), @@ -588,8 +586,8 @@ static void memcpy_fromio_readw(void *to, ssize_t rpcif_dirmap_read(struct rpcif *rpc, u64 offs, size_t len, void *buf) { - loff_t from = offs & (RPCIF_DIRMAP_SIZE - 1); - size_t size = RPCIF_DIRMAP_SIZE - from; + loff_t from = offs & (rpc->size - 1); + size_t size = rpc->size - from; if (len > size) len = size; -- 2.17.1