From mboxrd@z Thu Jan 1 00:00:00 1970 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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 758C3C4332F for ; Wed, 28 Dec 2022 11:55:24 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0862685465; Wed, 28 Dec 2022 12:55:21 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="TttsceEl"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 685068537F; Wed, 28 Dec 2022 12:55:19 +0100 (CET) Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 0853D8537F for ; Wed, 28 Dec 2022 12:55:17 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=saproj@gmail.com Received: by mail-lf1-x12c.google.com with SMTP id b3so23332260lfv.2 for ; Wed, 28 Dec 2022 03:55:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=QIijvgB6nQCKtaOuOFSpGA5sU6ZvT7rG7Pvid8GI5cM=; b=TttsceElX7Rs5lk1z8X8Y85CtXSbpHwi9oEP6/4f+Hn+L6/DXBVuRirDFt2MbT8aXg eoAu7eW42s+dCdWVcn6HhMVQsMdZJXrF5Q/iyc36XZQwxUzKwUVBa01vFhNXBbhQ0h0P qSY/06PiMjXk/vdnnT1GhD4yDm5ztYduilyWQ0LCGwX9MR917NYncvYm/aQgU8WZ4c0H 1xXRx6c3ZTVYPzyC+49xazRdrfJtl3JBrMx+p8h7ggjp8fO1nXr4YRwoQtER3udM+jF2 8LpmbZeEbwnL8Qz5I9B9xIZxdofj5Qaq/Hn8FoAOxR8UQIiu8ApUDIpNerdYR6I4hgCg 22gA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QIijvgB6nQCKtaOuOFSpGA5sU6ZvT7rG7Pvid8GI5cM=; b=nC3HHSmm0dfqFYVL4oe0RYMeWy9I3wDIDx15AiedYoPaw5OnYxMxH/X5x1q64iRVL7 FrS9k8luNuESzSnrnuxG6762gdxJ/6nFkbWhAS7UabxM0Xr2y03JWMHkjzrcZMcl0bWv Z3++YcoXFjpol+MjRNDrLVrtMb5zZUVydUKXlKQl2kYmfemCQdFwnbyW+s0jDkUFLmK6 oDzkKIr2qzOntyFoooKQEYmpD08a+Itz+PW94341D5e2i6qWZVPEEgDu3Z5tiPRu/TLh dhcflRj0rbii7JQE9zYLGvMuTnjl88CzQw2lVl4LGk9NoDj5DGRIHKbng15BT5/LMUkE o0vQ== X-Gm-Message-State: AFqh2kp+fn/TpIA0M5a18gNaVHHt0m2wGZ3iKS4tOEqJeXiBPwqvYCBw 9KRny3IKY3WJQnH56LaJ798JeIlia5w= X-Google-Smtp-Source: AMrXdXuJr9ksBugz5I9+j1DOyFMFel9DD0M+831ExwG/kZ4AXK57AvFCXqvVpRArpa2ozUejZcfFRQ== X-Received: by 2002:a05:6512:3baa:b0:4b5:3200:eb37 with SMTP id g42-20020a0565123baa00b004b53200eb37mr8720619lfv.43.1672228516276; Wed, 28 Dec 2022 03:55:16 -0800 (PST) Received: from saproj-Latitude-5501.lan (128-69-7-107.broadband.corbina.ru. [128.69.7.107]) by smtp.gmail.com with ESMTPSA id q10-20020ac246ea000000b004b57db96aabsm2637022lfo.52.2022.12.28.03.55.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Dec 2022 03:55:15 -0800 (PST) From: Sergei Antonov To: u-boot@lists.denx.de, joe.hershberger@ni.com, rfried.dev@gmail.com Cc: bmeng.cn@gmail.com, Sergei Antonov Subject: [PATCH 2/3] net: ftmac100: simplify priv->iobase casting Date: Wed, 28 Dec 2022 14:54:22 +0300 Message-Id: <20221228115423.1035149-2-saproj@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221228115423.1035149-1-saproj@gmail.com> References: <20221228115423.1035149-1-saproj@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Replace 'phys_addr_t iobase' with 'struct ftmac100 *ftmac100' in order to cast once on assignment and remove casting in a number of other places. Signed-off-by: Sergei Antonov --- drivers/net/ftmac100.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/net/ftmac100.c b/drivers/net/ftmac100.c index b3da9479ea5e..bb39e837bbe7 100644 --- a/drivers/net/ftmac100.c +++ b/drivers/net/ftmac100.c @@ -28,7 +28,7 @@ struct ftmac100_data { struct ftmac100_rxdes rxdes[PKTBUFSRX]; int rx_index; const char *name; - phys_addr_t iobase; + struct ftmac100 *ftmac100; }; /* @@ -36,7 +36,7 @@ struct ftmac100_data { */ static void ftmac100_reset(struct ftmac100_data *priv) { - struct ftmac100 *ftmac100 = (struct ftmac100 *)(uintptr_t)priv->iobase; + struct ftmac100 *ftmac100 = priv->ftmac100; debug ("%s()\n", __func__); @@ -57,7 +57,7 @@ static void ftmac100_reset(struct ftmac100_data *priv) static void ftmac100_set_mac(struct ftmac100_data *priv , const unsigned char *mac) { - struct ftmac100 *ftmac100 = (struct ftmac100 *)(uintptr_t)priv->iobase; + struct ftmac100 *ftmac100 = priv->ftmac100; unsigned int maddr = mac[0] << 8 | mac[1]; unsigned int laddr = mac[2] << 24 | mac[3] << 16 | mac[4] << 8 | mac[5]; @@ -72,7 +72,7 @@ static void ftmac100_set_mac(struct ftmac100_data *priv , */ static void _ftmac100_halt(struct ftmac100_data *priv) { - struct ftmac100 *ftmac100 = (struct ftmac100 *)(uintptr_t)priv->iobase; + struct ftmac100 *ftmac100 = priv->ftmac100; debug ("%s()\n", __func__); writel (0, &ftmac100->maccr); } @@ -82,7 +82,7 @@ static void _ftmac100_halt(struct ftmac100_data *priv) */ static int _ftmac100_init(struct ftmac100_data *priv, unsigned char enetaddr[6]) { - struct ftmac100 *ftmac100 = (struct ftmac100 *)(uintptr_t)priv->iobase; + struct ftmac100 *ftmac100 = priv->ftmac100; struct ftmac100_txdes *txdes = priv->txdes; struct ftmac100_rxdes *rxdes = priv->rxdes; unsigned int maccr; @@ -187,7 +187,7 @@ static int __ftmac100_recv(struct ftmac100_data *priv) */ static int _ftmac100_send(struct ftmac100_data *priv, void *packet, int length) { - struct ftmac100 *ftmac100 = (struct ftmac100 *)(uintptr_t)priv->iobase; + struct ftmac100 *ftmac100 = priv->ftmac100; struct ftmac100_txdes *curr_des = priv->txdes; ulong start; @@ -400,7 +400,7 @@ static int ftmac100_of_to_plat(struct udevice *dev) struct eth_pdata *pdata = dev_get_plat(dev); const char *mac; pdata->iobase = dev_read_addr(dev); - priv->iobase = pdata->iobase; + priv->ftmac100 = (struct ftmac100 *)pdata->iobase; mac = dtbmacaddr(0); if (mac) memcpy(pdata->enetaddr , mac , 6); -- 2.34.1