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 F28E8ECAAD5 for ; Mon, 12 Sep 2022 09:23:03 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CE30B843F0; Mon, 12 Sep 2022 11:23:00 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1662974581; bh=HF5MTubvNZQPmZl6ppO/bBu8fKhD8qbF8/7Hm6G8f0E=; h=To:cc:From:Subject:In-reply-to:References:Date:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=zSpxWO0gENaBq9mpS76nw1jrNmb8XurmkQuZYWYkDDFTTaXUC8naK5lqwQPWfpQv0 FxzO47oMPgci4drOVGyAMAbJ/pzx9o7OYOdv0orSRU5t00Mowmd8k0Nj/4HIKIOoJV wkaPzTDl+28z7TlEAVHl/qGu8wt2NnaKW/aZvIq2NFXSmyyZSKtgVdy762EB5Fp1/7 YOtEyJHGXTHHBt4oRehQ2Z1r9aR9egJ65OiWYTUxMp1NkpSBMSJYyTkc4l0994cy8S h5oAuspzQRa5xdVRAdl73HMBWa0OF2ZRebRlwmCOu/0C7RnfjYVf6HPt/SLt/ehaCl 4dq5ZOpzJC+7w== Received: from janitor.denx.de (unknown [62.91.23.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: noc@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id B663D843F0 for ; Mon, 12 Sep 2022 11:22:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1662974578; bh=HF5MTubvNZQPmZl6ppO/bBu8fKhD8qbF8/7Hm6G8f0E=; h=To:cc:From:Subject:In-reply-to:References:Date:From; b=tYyCevuzOe4DYlP8tdH/DB5JGp2I5bsqQJHbHNaOuy0fqxCplqEfGWk3OiQlF/9c7 kIMLtT1/AdFjV5gzv8/Lp0xPUAazWZfBA+5QSsKEhSv0loV/D7ovPqNnLP9BbLthgq 94ZkndRgorVn/hSQ2Mtl4mc6ikBZutICNj2aUmhY6s09Jy7XPxf6ZeoMscI72K3q1k iZEtYV+yPzkjSvhcGBtBo+CmPUkmHWKC5msorfguMJ9GFkeL3QcD/kpB3EgjaFIRWm yLTvV1ru4lIACa7S/mqeKQFKKPmXE3Oo+WAFMV0B094OvaitJwuprq5N/7SqqqgnDg n/b7noqY/cBSQ== Received: by janitor.denx.de (Postfix, from userid 108) id 6AB24A0272; Mon, 12 Sep 2022 11:22:58 +0200 (CEST) Received: from gemini.denx.de (gemini.denx.de [10.4.0.2]) by janitor.denx.de (Postfix) with ESMTPS id 19D47A009C; Mon, 12 Sep 2022 11:22:54 +0200 (CEST) Received: from gemini.denx.de (localhost [IPv6:::1]) by gemini.denx.de (Postfix) with ESMTP id D95F81E0662; Mon, 12 Sep 2022 11:22:53 +0200 (CEST) To: Ovidiu Panait cc: u-boot@lists.denx.de, Holger Brunck , Marek Vasut , Michal Simek , Rick Chen , Simon Glass From: Wolfgang Denk Subject: Re: [PATCH 1/4] common/board_f: remove XTRN_DECLARE_GLOBAL_DATA_PTR dead code MIME-Version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 8bit In-reply-to: <20220911161052.2986264-1-ovpanait@gmail.com> References: <20220911161052.2986264-1-ovpanait@gmail.com> Comments: In-reply-to Ovidiu Panait message dated "Sun, 11 Sep 2022 19:10:48 +0300." Date: Mon, 12 Sep 2022 11:22:53 +0200 Message-ID: <1053909.1662974573@gemini.denx.de> 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 Dear Ovidiu, In message <20220911161052.2986264-1-ovpanait@gmail.com> you wrote: > The XTRN_DECLARE_GLOBAL_DATA_PTR declarations in ppc code are permanently > commented out, so there are no users for this macro: > #if 1 > #define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("r2") > #else > #define XTRN_DECLARE_GLOBAL_DATA_PTR extern > #define DECLARE_GLOBAL_DATA_PTR XTRN_DECLARE_GLOBAL_DATA_PTR \ > gd_t *gd > #endif > > Remove all references. Actually the commented out code contained some information, and I feel it would be a pity if that got lost: > -#if 1 > #define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("r2") > -#else /* We could use plain global data, but the resulting code is bigger */ > -#define XTRN_DECLARE_GLOBAL_DATA_PTR extern > -#define DECLARE_GLOBAL_DATA_PTR XTRN_DECLARE_GLOBAL_DATA_PTR \ > - gd_t *gd > -#endif Maybe we can keep the information that using global data for the GD pointer would be possible too (and simpler, as it does not require the reservation of a specific register for it), but that the implementation uses a register nevertheless because this results in smaller code? Maybe add such a comment instead ? Thanks! Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr. 5, 82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de All repairs tend to destroy the structure, to increase the entropy and disorder of the system. Less and less effort is spent on fixing original design flaws; more and more is spent on fixing flaws intro- duced by earlier fixes. - Fred Brooks, "The Mythical Man Month"