From patchwork Tue Feb 18 08:54:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 1239849 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=prevas.dk Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=prevas.dk header.i=@prevas.dk header.a=rsa-sha256 header.s=selector1 header.b=hOpRf/Lz; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48MF5w5Clpz9sRG for ; Tue, 18 Feb 2020 19:54:25 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 87179811FB; Tue, 18 Feb 2020 09:54:16 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=prevas.dk Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=prevas.dk header.i=@prevas.dk header.b="hOpRf/Lz"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8490581203; Tue, 18 Feb 2020 09:54:14 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FORGED_SPF_HELO, SPF_HELO_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2071c.outbound.protection.outlook.com [IPv6:2a01:111:f400:7d00::71c]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id B845D8039D for ; Tue, 18 Feb 2020 09:54:11 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=prevas.dk Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=rasmus.villemoes@prevas.dk ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dfuB4U3zO3JE1raELpZn+zEfQYK8A42xWkBXQbYwQYtSWAwTeBWyxP7s2knRO3pwW3aCbMOPDzzeWX3M3oNSHGijp3SrpcuvcC18kYMg7s4YKih/gxxx7pUKHaVQ+UklHwYrNTt1m7JmuF71skkJxDlGI7MLphPzoRG4oTKkVMKkkzC/WYAjumepOudAw7ac2H8i8e7wY2+NoEP+XuyYJEHgR5Khz3OQl5iRWLW5AOBT2wrhnWmO9KMl9uRTVBWwAMx3M1GHgF+Rh8hTh239rCF+6SPpYLW4P85hGA5YKgDXKdV2TFEzWD81sY1PmLdS+V3Y11w2BtF28azSBokSdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YAm89dqsou6oTsugQ8755iKximBNYSLLl/1M2CK+1U0=; b=jULsmqUppsUBxze4PdQE46iG3nycGFiWsjxp3ZbYjSuq2UuWQ+rGqWZxt+1xC28uyxg6DKrqAv18tJM5xBA0T4gn0CWii95Pctzfwt8plsYOs2C5YVtkjGFguY+43gFzSPGWBP1/g456KLOhmt/7XnnpEvkZVOefSV4MdUxC8ZOMVo+mBHe8sdu9gNG6It8ea+s+Isnxhv59wFFcU/BbK5YQCuTjeGdNCenHd+cjwMT3RTgNRvMG9FiASJ376mIDp3Bb8ghXdqoKOfcqTHn13VNV6ucgNrRuJBoU3u45u/sUyYnykCVnGIjlohJEuSLe8QfeDaQpIQ3lw95KkBYkeQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=prevas.dk; dmarc=pass action=none header.from=prevas.dk; dkim=pass header.d=prevas.dk; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=prevas.dk; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YAm89dqsou6oTsugQ8755iKximBNYSLLl/1M2CK+1U0=; b=hOpRf/LzAlYAyl6gF9l7O78m2+7VawjN3HIDr5QRqMLOx+oMyZXQE4KB6D+Zn9Ax149RG9+dg9BhleEeHJ3wf87GU+6vys422s+eWZUqlSJsCxOjfW7UTG4lZfDRuCTUCaQIvDeOndORI2ScLzWrWqHHdxkyzpMu5FTc7uuEowA= Received: from VI1PR10MB2765.EURPRD10.PROD.OUTLOOK.COM (20.178.126.85) by VI1PR10MB1566.EURPRD10.PROD.OUTLOOK.COM (10.165.196.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2729.29; Tue, 18 Feb 2020 08:54:09 +0000 Received: from VI1PR10MB2765.EURPRD10.PROD.OUTLOOK.COM ([fe80::e58f:1097:b71d:32c7]) by VI1PR10MB2765.EURPRD10.PROD.OUTLOOK.COM ([fe80::e58f:1097:b71d:32c7%5]) with mapi id 15.20.2729.032; Tue, 18 Feb 2020 08:54:09 +0000 Received: from prevas-ravi.prevas.se (81.216.59.226) by HE1PR0701CA0056.eurprd07.prod.outlook.com (2603:10a6:3:9e::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2750.8 via Frontend Transport; Tue, 18 Feb 2020 08:54:09 +0000 From: Rasmus Villemoes To: "u-boot@lists.denx.de" CC: Joe Hershberger , Wolfgang Denk , Rasmus Villemoes Subject: [PATCH] env: make file-scope env_ptr variables static Thread-Topic: [PATCH] env: make file-scope env_ptr variables static Thread-Index: AQHV5jj7rY1MDTkyvEuGY866b9+x1g== Date: Tue, 18 Feb 2020 08:54:09 +0000 Message-ID: <20200218085356.13929-1-rasmus.villemoes@prevas.dk> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HE1PR0701CA0056.eurprd07.prod.outlook.com (2603:10a6:3:9e::24) To VI1PR10MB2765.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:803:e1::21) x-mailer: git-send-email 2.23.0 authentication-results: spf=none (sender IP is ) smtp.mailfrom=rasmus.villemoes@prevas.dk; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [81.216.59.226] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 06c00e82-2728-402f-cc94-08d7b4501e52 x-ms-traffictypediagnostic: VI1PR10MB1566: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4714; x-forefront-prvs: 031763BCAF x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(136003)(39850400004)(396003)(366004)(376002)(346002)(189003)(199004)(16526019)(186003)(26005)(52116002)(1076003)(81166006)(66446008)(81156014)(66946007)(107886003)(66556008)(316002)(86362001)(6916009)(8676002)(8936002)(54906003)(8976002)(6506007)(64756008)(4326008)(66476007)(36756003)(956004)(71200400001)(6486002)(6512007)(2906002)(5660300002)(478600001)(2616005)(44832011); DIR:OUT; SFP:1102; SCL:1; SRVR:VI1PR10MB1566; H:VI1PR10MB2765.EURPRD10.PROD.OUTLOOK.COM; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: prevas.dk does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: jTf5s1KJ1ov7arHjeqrc3RNZ7OMpto7TVP4YmryfSY3jalC1p0UOn34Ys5dSLILgYwQFg1obHnqL/rCy/bTzBBMHjXN0KiPVxVQf6JeZZUoeQXPeTRf/igVbXz9pny2N/ORLVMRwPoSt95b498h8USQq7NVdKfXAa05HxXcq2qg8iPbG/BmJ+ePW4EmYFVwu/fc2v6N0PsIn93bL6grjPl1aOEr/d/G3FrrihNdwkdO57mhhMR9IvD/feA+6Ivkec3Pelo6BiaTZTHxcV80GJsdxXU0o0yCcXIYsH9hgqKYyt3bh/azl9x6ALiKsEVcEWIlEDmyns0cIJtXYOkvlMr9BSKBfRmTequzZ3pTyRpZcuzLgtSwkI6cUb4Oc6VvPx1geZpv5b/uWIyRkPBLR+yyMbl/7dTdMxgP5ldRKmw8xfeIar64ZzvNU+SG5p7gh x-ms-exchange-antispam-messagedata: ssKGQ9wZQ+73x3qYBHk+Fs6ibJqBVOTsNNfLkyI03/+w3/aWw5s6jxn15zI4WHd0VPvc1IBGyR8bFFzuMM9t0BVG+F31XxqWFdm1Y/kAAumP1K9iDj4Anfmm8MJyXhphWSFUCpGkTY2iQa3XZGlGIg== MIME-Version: 1.0 X-OriginatorOrg: prevas.dk X-MS-Exchange-CrossTenant-Network-Message-Id: 06c00e82-2728-402f-cc94-08d7b4501e52 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Feb 2020 08:54:09.7049 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: d350cf71-778d-4780-88f5-071a4cb1ed61 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 8v/DcavQokg0rW5B+U2tKuFt4XFPTYKMCfhQ10UeXv/xYBZa48dr2xPmyjz9qV2EMwFPTXqEq3VyEfSRYn+wBtBNWVf1Vg46+tp50lRBpDM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR10MB1566 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 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.102.1 at phobos.denx.de X-Virus-Status: Clean The combination ENV_IS_IN_NVRAM=y, ENV_IS_IN_REMOTE=y fails to build: env/remote.o:/mnt/ext4/devel/u-boot/env/remote.c:17: multiple definition of `env_ptr' env/nvram.o:/mnt/ext4/devel/u-boot/env/nvram.c:41: first defined here It's not necessarily a meaningful combination, but for build-testing it's nice to be able to enable most ENV_IS_IN_* at the same time, and since these env_ptr are not declared anywhere, they really have no reason to have external linkage. nand.c and flash.c similarly already define file-scope static env_ptr variables. Signed-off-by: Rasmus Villemoes --- env/nvram.c | 2 +- env/remote.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/env/nvram.c b/env/nvram.c index a78db21623..1a9fcf1c06 100644 --- a/env/nvram.c +++ b/env/nvram.c @@ -38,7 +38,7 @@ DECLARE_GLOBAL_DATA_PTR; extern void *nvram_read(void *dest, const long src, size_t count); extern void nvram_write(long dest, const void *src, size_t count); #else -env_t *env_ptr = (env_t *)CONFIG_ENV_ADDR; +static env_t *env_ptr = (env_t *)CONFIG_ENV_ADDR; #endif #ifdef CONFIG_SYS_NVRAM_ACCESS_ROUTINE diff --git a/env/remote.c b/env/remote.c index 50d77b8dfe..e3f0608b16 100644 --- a/env/remote.c +++ b/env/remote.c @@ -12,9 +12,9 @@ #include #ifdef ENV_IS_EMBEDDED -env_t *env_ptr = &environment; +static env_t *env_ptr = &environment; #else /* ! ENV_IS_EMBEDDED */ -env_t *env_ptr = (env_t *)CONFIG_ENV_ADDR; +static env_t *env_ptr = (env_t *)CONFIG_ENV_ADDR; #endif /* ENV_IS_EMBEDDED */ DECLARE_GLOBAL_DATA_PTR;