From patchwork Wed Feb 19 09:47:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 1240602 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=85.214.62.61; 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=PTJS4nKM; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (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 48MtFl11pQz9sRN for ; Wed, 19 Feb 2020 20:48:27 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8D7188050F; Wed, 19 Feb 2020 10:48:00 +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="PTJS4nKM"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9256380417; Wed, 19 Feb 2020 10:47:49 +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 EUR03-VE1-obe.outbound.protection.outlook.com (mail-ve1eur03on0725.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe09::725]) (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 3217880366 for ; Wed, 19 Feb 2020 10:47:44 +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=HLk64vFWN8pS+HHE3Dcf7Mps/vauKxXwrLIG7Qahrk79iKsNvNjZWZfgS/Oza9G5P7WbSe228kr3NjUd7+Az61TlBmuZe7r692VxxVZFczf5QVLLTA+O5aXBlOnaXD/F/mvUNWiT2dnzVNkHiIyyOFR2+jOkxylqAe8l0tW5p6kXpA99KC8rH+5ZLTv+vK24C1vk7oOqpENxX5K92UtnwalPjUIZx3c7wiKc8V9tzBgKBLwcK8EqTlc0tSjYsjIAfLMZHNt23ofmiuM/1cfyGvzc0cpsNoxGF5jqQYh4jZwEG0uKjwF2yabIevsXmEQQMg5L8B3QlbiiPjvP1m/Buw== 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=/JBp5nenVfRSY4Di1/O8G9R+kEErLA+tbik4+U8VKXM=; b=dJZGAw9W8nqkAvBrz26UqD3L7qspWfcKX6ew9sSaJ/xk+V06Ru18A8XbEsGuTCr57m+MeEyVbbouEHkdqqKS3jTQSn4JepFhgYM3GvsC4achXh8Eqq3q1EcbBPtRw8wGadOWoSq6kFdyiUBtyCJzYevHR3TgcjsaySUq8SyDGd8+ZiOLzIplV67e5Se9AJyiI+wpLMsHrL8gzeJeeJWQ9UCe3YZrhjiBUQ+2zKPSzWcUzwIliw95RJWYrczxhJaasgaZ6RZ48+kKvwLfqJsnvSilYSZJaG6/2c6Poxp9iUZBknzc2Xn+ZS87EBDJV/TtotMVcunynRQOT+xgO8d6RQ== 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=/JBp5nenVfRSY4Di1/O8G9R+kEErLA+tbik4+U8VKXM=; b=PTJS4nKMA5ssHKhNfmytQbvRKvRoVDuSFoQoaTuS+FGn2RgtfOjoMGceHrIPtIbc5k3LB7Z7oxgr6XeqTpaE+QVyHnm+RNGgEEmKNkTs65ZDiY3cgURZL1EI0wyL4KA5s/Yy5jfsBwneBrjWNQEBMHG+GE8hVuQ/WbHeKKJTOWM= Received: from VI1PR10MB2765.EURPRD10.PROD.OUTLOOK.COM (20.178.126.85) by VI1PR10MB2159.EURPRD10.PROD.OUTLOOK.COM (20.177.60.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2729.23; Wed, 19 Feb 2020 09:47:43 +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; Wed, 19 Feb 2020 09:47:43 +0000 Received: from prevas-ravi.prevas.se (81.216.59.226) by HE1PR0102CA0040.eurprd01.prod.exchangelabs.com (2603:10a6:7:7d::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2750.18 via Frontend Transport; Wed, 19 Feb 2020 09:47:42 +0000 From: Rasmus Villemoes To: "u-boot@lists.denx.de" CC: Joe Hershberger , Wolfgang Denk , Tom Rini , Rasmus Villemoes Subject: [PATCH 5/5] env/sf.c: drop private CMD_SAVEENV logic Thread-Topic: [PATCH 5/5] env/sf.c: drop private CMD_SAVEENV logic Thread-Index: AQHV5wmhmTifX1zGuEWUvh58fjqmXA== Date: Wed, 19 Feb 2020 09:47:43 +0000 Message-ID: <20200219094726.26798-6-rasmus.villemoes@prevas.dk> References: <20200219094726.26798-1-rasmus.villemoes@prevas.dk> In-Reply-To: <20200219094726.26798-1-rasmus.villemoes@prevas.dk> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HE1PR0102CA0040.eurprd01.prod.exchangelabs.com (2603:10a6:7:7d::17) 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: b242a9e1-23a0-4910-8eb4-08d7b520c42e x-ms-traffictypediagnostic: VI1PR10MB2159: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4125; x-forefront-prvs: 0318501FAE x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(346002)(376002)(396003)(39850400004)(136003)(366004)(199004)(189003)(8976002)(8936002)(52116002)(107886003)(6506007)(26005)(6486002)(6916009)(8676002)(54906003)(4326008)(81166006)(81156014)(71200400001)(66946007)(6512007)(5660300002)(2906002)(1076003)(44832011)(36756003)(2616005)(186003)(956004)(66476007)(64756008)(66556008)(16526019)(66446008)(316002)(478600001)(86362001); DIR:OUT; SFP:1102; SCL:1; SRVR:VI1PR10MB2159; H:VI1PR10MB2765.EURPRD10.PROD.OUTLOOK.COM; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX: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: W9pTqfDM/AlxaceW35Is61kZJSjpPCdlv7r4dmNMloS33ldEdG/VKE9zCnSABjvdWmy6p/0w3e7SjX5Zmr0LYYtE5Ubtz+tzDgbzs9PxcMyp961J6KZhUU+0QkYQ5vbaAaacNxSAt2XuPSzDMETVvdfEAlj3weF6TuB3QM0kxFDJgHXahCpPwje9Eq4VHqQiokpbzFmaMRT2IZ50CnVFn+464Qsqu3JipZgr+fWlUAK3XAdn+7ON/VVj1YAy3Zqy4agOPE/9rLbHscqr4cXH7tevadbki1bMZk/krkKDpvJaukm7sMpZ00S0r+peMbWAGfE+Xlq0gaS95OCG1ypNzL9Z12aMr1bZTyzQxWW2P47Q/mJ/pJ9JAwcJ6EdnyFyKkCur2gs8Mpa1EeBEf8gGANd65BMY1jI/zrRwRDlgXfj32qkJSO3egvPKzPqajXm1 x-ms-exchange-antispam-messagedata: axTVEe+wFs2j9muU9nsnFpFxCDyczgelhtZo2U4LsjCyzSgYTRWYK0qFxklM8Sxzaaby0jXBLsY0ksuEv1tgAOA21yOY/Up6Zp2M8b7bSNbCj6i/nA7nJNeTx7vY45YXCrmq57oFus3Y/C4Me4AYOw== MIME-Version: 1.0 X-OriginatorOrg: prevas.dk X-MS-Exchange-CrossTenant-Network-Message-Id: b242a9e1-23a0-4910-8eb4-08d7b520c42e X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Feb 2020 09:47:43.3169 (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: a8Xk4/aNJtQk+Xb0TgGzBh5hYitUs3zTcw1qZaxy4SGH6o7vI980G/RbEpHAtsNQ8NWArtSMUfEuh6ECKv3NxIqPuIV6TRS7Wp0PtAACd6I= X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR10MB2159 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.2 at phobos.denx.de X-Virus-Status: Clean Deciding whether to compile the env_sf_save() function based solely on CONFIG_SPL_BUILD is wrong: For U-Boot proper, it leads to a build warning in case CONFIG_CMD_SAVEENV=n (because the env_save_ptr() macro causes the function to indeed not be referenced anywhere). And for SPL, when one selects CONFIG_SPL_SAVEENV, one obviously expects to actually be able to save the environment. Signed-off-by: Rasmus Villemoes --- env/sf.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/env/sf.c b/env/sf.c index 5ef4055219..22b70ad319 100644 --- a/env/sf.c +++ b/env/sf.c @@ -21,16 +21,12 @@ #include #ifndef CONFIG_SPL_BUILD -#define CMD_SAVEENV #define INITENV #endif #ifdef CONFIG_ENV_OFFSET_REDUND -#ifdef CMD_SAVEENV static ulong env_offset = CONFIG_ENV_OFFSET; static ulong env_new_offset = CONFIG_ENV_OFFSET_REDUND; -#endif - #endif /* CONFIG_ENV_OFFSET_REDUND */ DECLARE_GLOBAL_DATA_PTR; @@ -69,7 +65,6 @@ static int setup_flash_device(void) } #if defined(CONFIG_ENV_OFFSET_REDUND) -#ifdef CMD_SAVEENV static int env_sf_save(void) { env_t env_new; @@ -148,7 +143,6 @@ static int env_sf_save(void) return ret; } -#endif /* CMD_SAVEENV */ static int env_sf_load(void) { @@ -187,7 +181,6 @@ out: return ret; } #else -#ifdef CMD_SAVEENV static int env_sf_save(void) { u32 saved_size, saved_offset, sector; @@ -247,7 +240,6 @@ static int env_sf_save(void) return ret; } -#endif /* CMD_SAVEENV */ static int env_sf_load(void) { @@ -313,9 +305,7 @@ U_BOOT_ENV_LOCATION(sf) = { .location = ENVL_SPI_FLASH, ENV_NAME("SPI Flash") .load = env_sf_load, -#ifdef CMD_SAVEENV - .save = env_save_ptr(env_sf_save), -#endif + .save = ENV_SAVE_PTR(env_sf_save), #if defined(INITENV) && (CONFIG_ENV_ADDR != 0x0) .init = env_sf_init, #endif