From patchwork Wed Feb 19 09:47:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 1240600 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=W+9HHSZB; 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 48MtFJ6wfpz9sRN for ; Wed, 19 Feb 2020 20:48:04 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7094580364; Wed, 19 Feb 2020 10:47:50 +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="W+9HHSZB"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0632D80367; Wed, 19 Feb 2020 10:47:46 +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 2852A80246 for ; Wed, 19 Feb 2020 10:47:43 +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=APKrayvJlgWt3Q2Hi1HAVwszp1p83bhMktQOLFsN+0dpzFWG5jLK4CFAnKxwaR94h8ACdtCaqJ0EJRstDu+gpzKWXTjuQLKoMg1lWTnenOn27ns9kg1OOyOvorBpsgjt32NLaKY167JmZqepWruMmqh8bpzvZq5urOscd/tRAgoKkvSFeBtALZ8K8d38MVVdy1KgxaDyE27bJYsXTJymgsIR0/QRiJ3ix7cC+epYy16QsiQ0TlXMwLGc+zUmhEXE1JgQT8YkK+lSpn/ifSMgxQkGg4jvR9mrA9w6Q372MYfgOmAVqI/iO1cn1jnOXlmGqtjgbRZwFWQU9hqq/Mh67w== 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=iHhnRh8WTZzkColUPxbGUt8jOZxaOW2XvZPv/ka271U=; b=EZ2FFw4cDeCa2kUlRLKkgrazIBiFRquKbhuYqiiKCPw+z/KNFxVNdu9YAkX1Dhr45fxGGBrJKirHQARbYVE5X8MXa3RX+CNtEpikmFl2Knc307iY1IUAK/ruy5BNw9VNk59o6GHYxYIPqw72vEDx3qVA6QtiBd+gyzCw6D5807+KK+53QpeMf/uZl8cBWPkYYcN9vzEZ4RgAPNBiMYqD49+lXA0QQYgxuDTc22hc/OBT+ff3efoBwUikvtWodndgK6eFTHA/EKjD5TZpLblfpJl8RxEyq9hQgxkCldbWg+yBfh+h7ntG0rmpUCLUMbjp/keJ1resIi7YSJWwn+YXpA== 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=iHhnRh8WTZzkColUPxbGUt8jOZxaOW2XvZPv/ka271U=; b=W+9HHSZB6F5flj98VWYNJlAc/dGObrmSSXdgzZoKY8IdbX/1hT5tai5Yj05nrgDMJH8S8Ou50uufAs7DO46enb2D8sOYyijvJ0gU7pDB4pAAPdMkNQ0pEdJMV8lCto/8daXh3PE7XLmbnBkEFZLvBssBWgzBeUrmw52qyz7F8NE= 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:40 +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:40 +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:39 +0000 From: Rasmus Villemoes To: "u-boot@lists.denx.de" CC: Joe Hershberger , Wolfgang Denk , Tom Rini , Rasmus Villemoes Subject: [PATCH 1/5] env: add SAVEENV as an alias of the CMD_SAVEENV symbol Thread-Topic: [PATCH 1/5] env: add SAVEENV as an alias of the CMD_SAVEENV symbol Thread-Index: AQHV5wmf+oPlEzS1uE+Vlwh58j5Ybw== Date: Wed, 19 Feb 2020 09:47:39 +0000 Message-ID: <20200219094726.26798-2-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: 1e81f63e-9e48-4d51-50c3-08d7b520c21c x-ms-traffictypediagnostic: VI1PR10MB2159: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5516; x-forefront-prvs: 0318501FAE x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(346002)(376002)(396003)(39850400004)(136003)(366004)(199004)(189003)(8976002)(8936002)(52116002)(107886003)(4744005)(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: IDYcvCcyyD/mPdaaP3F0sAc3H4iUpLND+I45f3v8LeDS3HlwV3GjHp+TX7IGEydzRi5CZvYIOmqbKolSnK2KdeV62oSnFzzcyzpiRkoZeVbeObH1tdEnlpbRA0DRaviUFQgI0puDggfThdKMq8k44kIQI+YWEYft/2cPFvVIaZ4pDrwlKXrtwG+TvGmN0AUGys+aJ1kFBEZpj2fcWSzdPtT6FklTTxb2gXni6wUJtw3RnN2VcwXu9g2qoj1Bmi2lr+YJipVkN+546I+mPp9t4tFg4EtzvHOBnLL2M2aeWOX6JHbH8SmkZhUg0daN+NnUrbCfYQYumPMcBmEdCku5GAfZcXH7KzRVlpWukxBRakHPdugCHXaFBq33xjwgpgis59BqoOY7Hz+kxMhtpVJaZP+VeuhWGelCrB4R/X8n6/2WES3pI9jjn+OAmlwzYb4F x-ms-exchange-antispam-messagedata: iONAuCKoG8dSdS5pqUdiAkarERzHH1QIbtvbui7O9W+lwWiF1aNz2/kyHCYjOc1Qx8DeA+0wcpmZglp74gzfc6YVCvG6rWKWV8aIZ8nQuMhKEU8lICFyYySq6OfN7/DLz5lwXM1qwsCKKgreS5bokA== MIME-Version: 1.0 X-OriginatorOrg: prevas.dk X-MS-Exchange-CrossTenant-Network-Message-Id: 1e81f63e-9e48-4d51-50c3-08d7b520c21c X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Feb 2020 09:47:39.8619 (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: 4mB3DSpvWUzy9PswnXVmTPmCalf6kkwRgaC2J+fnaZueYIK651trKlar7XG6GimCXISeE11/UqEYAqoMSUdZcAfZjTkkZrw2XsNgDleoCeA= 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 Currently, testing whether to compile in support for saving the environment is a bit awkward when one needs to take SPL_SAVEENV into account, and quite a few storage drivers currently do not honour SPL_SAVEENV. To make it a bit easier to decide whether environment saving should be enabled, introduce SAVEENV as an alias for the CMD_SAVEENV symbol. Then one can simply use CONFIG_IS_ENABLED(SAVEENV) Signed-off-by: Rasmus Villemoes --- env/Kconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/env/Kconfig b/env/Kconfig index 0d6f559b39..969308fe6c 100644 --- a/env/Kconfig +++ b/env/Kconfig @@ -3,6 +3,9 @@ menu "Environment" config ENV_SUPPORT def_bool y +config SAVEENV + def_bool y if CMD_SAVEENV + config ENV_IS_NOWHERE bool "Environment is not stored" default y if !ENV_IS_IN_EEPROM && !ENV_IS_IN_EXT4 && \ From patchwork Wed Feb 19 09:47:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 1240603 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=Hl/97RFr; 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 48MtFw64rSz9sRN for ; Wed, 19 Feb 2020 20:48:36 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8E7BF80580; Wed, 19 Feb 2020 10:48:03 +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="Hl/97RFr"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9D88580396; 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 EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on0717.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe0c::717]) (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 D2FAE801E9 for ; Wed, 19 Feb 2020 10:47:42 +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=iiTY5mg8s8RRAVrhSbqbIo9QLc7ljTuvjebsOEeV440Y40GbP5E7Pgsy6XCoRvfaPnRu7Aj2ZKCdV61jO2sHWPd7K1zuwerQMC+BEkNUV2d/pc7X0lnouk/Qk8NSLwiWRErY1f88OcBCjL5bhr3Wtrsg/3w4RHlAcOSLfLed6Dli+8Z6LF1JdCJq4KQ2GkLuXCq21kAwMBwu6d9QAKxT5o9LNnJtAw+nPkvWngViR2JwxRkSmHszgVx7ZTQ81wrQ3RTJ/4HErW9PTYwgiqHTWKzeKAqIkYNZxpXanx/eeor9eKtFjwSo5K6BbZJq869BekJ+4AgoJsaznwUcLYAP5A== 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=iUG3tr5Y35WG4Fnl5q3wwpZBfI5Fsq5eR+lNSUrSVEU=; b=f4de/Gk1WPSP6GRH8KftG0h+65m5V6E66rv2XZATbkektM7ApJE4Sl3Mh3rttArt8WW6TP4AB5sHcMIuIwWM9jREEazbo0ujdyvinWa95mY+uLx9pSew2yqPRmM656TE7MJOHlbIt7z7bafVhE0ohPGHD/pdWO+ZaJ1dHrcQstRjrKoghIQcdi+l+d40djkDjqWq0Vxz7GCcem3dTizFPzqFsNq8KdQFO9WwPR4FhfLbpwqMHFYIZWsnYqGQi+wha+YhIgcIGv/UQbsp3Vrf+PhlxyWdkL4PPZ+orouq6iYV3R9yP0eP7oyrfxKYBPVXqVpf7LGbnRyj41vWTEzKKA== 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=iUG3tr5Y35WG4Fnl5q3wwpZBfI5Fsq5eR+lNSUrSVEU=; b=Hl/97RFrqCNDV2MfS5jxGMhu5QzgI/HfK2qTBn3aPooeUddnY9TqkqoDt+EfDG1BielFGywX3HKhCqTDckyyEF3lsH/Phg7nfbxq6AUB0gXhjReYkWvCiP5Zf2ps+ontdrxceg5TBt5xeb8xjH1pT1DR3BV7eF/MGvsc3mIcOnc= Received: from VI1PR10MB2765.EURPRD10.PROD.OUTLOOK.COM (20.178.126.85) by VI1PR10MB2286.EURPRD10.PROD.OUTLOOK.COM (20.177.60.221) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2729.22; Wed, 19 Feb 2020 09:47:41 +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:41 +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:40 +0000 From: Rasmus Villemoes To: "u-boot@lists.denx.de" CC: Joe Hershberger , Wolfgang Denk , Tom Rini , Rasmus Villemoes Subject: [PATCH 2/5] env_internal.h: add alternative ENV_SAVE_PTR macro Thread-Topic: [PATCH 2/5] env_internal.h: add alternative ENV_SAVE_PTR macro Thread-Index: AQHV5wmg2V3Gj09Jx0yKssY7A01raA== Date: Wed, 19 Feb 2020 09:47:40 +0000 Message-ID: <20200219094726.26798-3-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: 385408c4-90e3-40fa-99ae-08d7b520c2a1 x-ms-traffictypediagnostic: VI1PR10MB2286: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-forefront-prvs: 0318501FAE x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(39850400004)(346002)(366004)(376002)(396003)(136003)(189003)(199004)(8676002)(54906003)(8936002)(4326008)(1076003)(16526019)(66946007)(44832011)(8976002)(956004)(107886003)(2616005)(66446008)(6506007)(5660300002)(66556008)(316002)(81166006)(81156014)(66476007)(186003)(64756008)(26005)(6916009)(71200400001)(52116002)(6512007)(6486002)(2906002)(478600001)(86362001)(36756003); DIR:OUT; SFP:1102; SCL:1; SRVR:VI1PR10MB2286; 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: B5AKgMx3HjQ5x3q0u4O1Ucmenvc515DVgi5LaRWrvS1XNpx1y2j2oRfqbT2ooaw6MfYz2YS4ygbwUtAQ/2lfrAk0ueUOKoiAvky5nPjZnnxtwxMmn0ZVCWmNDqyRox9tIvgH9D1lWMCOM2eE2LNM6PS7JvegFEjD2bIjmcz/KZzUWllSDaPbe/A3QDnWnBZmqIvr1M3Dv4hCPSK74Mufi+4CE3DkzBb9LhpiKQDtmZoWu/EyfCrccLTSMkYC4EMfGduxc5nuevXUEzgZYXZ5lixFr63apJNMf5a+dCfww4Obl4cwtDV+9opkA4AdqQzA+SAX9QB0B59n05ispCdnfBhq0wSmxa7YUwLngL7Cn9rqnLOkSpiIVsYaPzsOWTgbMTCLDP9ETnqV6okHR+FQNcVw/epoyQrf04mwY0SrSRqk/dIhAafGkoeZP94odw6c x-ms-exchange-antispam-messagedata: jm0kxeS70edscYUAFAUVxmhvXWV7mYJ3u4xMfzSoGvcLHtMjom3xRMZ+6wZ3zl5T5fdDDg8r5awjr7o012NMnn4CwmRmeo3abRPCq7s+UN145P6jNOLnW87OSkpDUnCyCYDG9xGIrCYwNjex1oo5og== MIME-Version: 1.0 X-OriginatorOrg: prevas.dk X-MS-Exchange-CrossTenant-Network-Message-Id: 385408c4-90e3-40fa-99ae-08d7b520c2a1 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Feb 2020 09:47:40.6685 (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: BjeAF1E53TtouNs6r1HM6rzI7hyOT/pGUKNNyvpS0NVUarokSSqEvyOB79v/mkM+ksQIrcCvOPYv1QOt2kL835nxc1qguMqdgMz7SSxOEs8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR10MB2286 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 The current definition of the env_save_ptr does not take SPL_SAVEENV into account. Moreover, the way it is implemented means that drivers need to guard the definitions of their _save methods with ifdefs to avoid "defined but unused" warnings in case CMD_SAVEENV=n. The ifdeffery can be avoided by using a "something ? x : NULL" construction instead and still have the compiler elide the _save method when it is not referenced. Unfortunately we can't just switch the existing env_save_ptr macro, since that would give a lot of build errors unless all the ifdeffery is removed at the same time. Conversely, removing that ifdeffery first would merely lead to the "defined but unused" warnings temporarily, but for some storage drivers it requires a bit more work than just removing their private CMD_SAVEENV logic. So introduce an alternative to env_save_ptr, which for lack of a better name is simply uppercased, allowing one to update storage drivers piecemeal to both reduce their ifdeffery and honour CONFIG_SPL_SAVEENV. Signed-off-by: Rasmus Villemoes --- include/env_internal.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/env_internal.h b/include/env_internal.h index 90a4df8a72..e89fbdb1b7 100644 --- a/include/env_internal.h +++ b/include/env_internal.h @@ -207,6 +207,8 @@ struct env_driver { #define env_save_ptr(x) NULL #endif +#define ENV_SAVE_PTR(x) (CONFIG_IS_ENABLED(SAVEENV) ? (x) : NULL) + extern struct hsearch_data env_htab; #endif /* DO_DEPS_ONLY */ From patchwork Wed Feb 19 09:47:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 1240601 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=jYwW6VIL; 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 48MtFW5Dpqz9sRN for ; Wed, 19 Feb 2020 20:48:15 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 63F5580367; Wed, 19 Feb 2020 10:47:58 +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="jYwW6VIL"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A0312803E3; Wed, 19 Feb 2020 10:47:48 +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 742268025D for ; Wed, 19 Feb 2020 10:47:43 +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=oGkLq/cyMATGM6Xlwhzf13apm4PaqAZS9HDut7RIQPLuiHIRU8Fel81Oc3ruoH7eq5wdaZzrbgQglL8pqbB439drmjMVX5SkRog9hxiQVcHCOPQWdra5tx4WEmiTUy1TtaMxhKmKwbO1sjwMczibx4i6p5E2nPmW3X2l9g2pmj+qlW7nJYTx/XGK/lfas7pJ7tKH1OInEofb+JnG2CfBNnLjVVUUIE+d2athb0lOSOzzZ+uH6tmOilQ1M+pPGYOgDs985J33XzTDqoGGa4/fLUvYeMf75iDD+zkjQN/cR5yzTQy88eNpHD7ALDKWOBXReUpaEm5NPLsrC0u7CSD9CA== 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=w/QVK/o/RMGg02iMsKv7kabAqhgjppkYWXjj6rHC6GY=; b=L02et84JKypaU/fZgjz+lb6AHPeAR5ImG7C8Yc3iUgFb4xj19oiQ8BwGiYn6YffMNFZnLQHw87+ruOKpHMZVvwLoD6j7NQCJ7APfnep2xYdCIuiz/E7gQXMJM9Oc4pmLTA56zt2N+I33YZc1d7kt5TlZ88mqEwB3B93VvWialM2CBimJQBj/MzQrCfhCWJMXuz8O+U6VEme9RsTijF/GORNr34SAusIcqkzBNWMU6v+XJXfistALjQY3aV7nvdDni7jFFriPYj6ocYh4N80ho8kW8ZgFxtEw7r4avpty1GU+pyvxub4YI8xCBIzuaoGw7aKENiv65f2Udc35pUX2FQ== 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=w/QVK/o/RMGg02iMsKv7kabAqhgjppkYWXjj6rHC6GY=; b=jYwW6VILJU9VI1kEMxIRJlRcs3y4alBk8QR9ptFtPEHo3gsKiocf/fo0L1Lz2N9YDf8vdoORmAJHA6w0NmmOuGku0uzeGgjLE0wSe4Dy5UAI2BJs0zarjB130Mqp5q1ylz83SejDRhg5uGwiGnOBqPg1LA7LN1Yl+MBSMZJ0ZUE= 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:41 +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:41 +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:40 +0000 From: Rasmus Villemoes To: "u-boot@lists.denx.de" CC: Joe Hershberger , Wolfgang Denk , Tom Rini , Rasmus Villemoes Subject: [PATCH 3/5] env/fat.c: remove private CMD_SAVEENV logic Thread-Topic: [PATCH 3/5] env/fat.c: remove private CMD_SAVEENV logic Thread-Index: AQHV5wmggOW7Vx4VEE+N/KbvCKc6uw== Date: Wed, 19 Feb 2020 09:47:41 +0000 Message-ID: <20200219094726.26798-4-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: ccf2e6fb-9a3f-4c3c-83ee-08d7b520c31c x-ms-traffictypediagnostic: VI1PR10MB2159: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:800; x-forefront-prvs: 0318501FAE x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(346002)(376002)(396003)(39850400004)(136003)(366004)(199004)(189003)(8976002)(8936002)(52116002)(107886003)(4744005)(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: p4czJzLrN1I5TGIaSAdhxzA8Q7gVQZ0sz1jsi0HcTZgaPiHE9OIZE1pXzRxKgdbYyyLUiR14OJaqUQ4th+ieSyNYAoJozk6LZvS1oiMGTjtLMXgTvYUmj2auvRwB3eOjoHAnR+kV//8HSKv60ZSPc8dlEXTfAB8zKZrk3rS9/Nuz07m94hpbjyI9nw+mHNyeT2HItU1AT1hrQzj0KpWvypZEDNaKdtRRuNKbQc9Vo9ENXLLqNbTU287W7eVBXmeHD6lVDbjF4YByKs39AZHzzNDw0+2UxUQFX6R+0RmXSVCOdrXOcwfuGV4ODUIn/nfOiemnGTTVrvkNpXwaIKKUJEppnrgyQ+T8GXxE2bywghRP9oGTezVqpD+0FzZkj1l8SXW92mfmu+TeEOpLiKIU4xErcwTUd3j77ZYD2ecJ75gM9qcC0wDdWUc+SdUGMYQL x-ms-exchange-antispam-messagedata: jLg9yvEtBzI98VInr0sCBlA1LCKqBzRZA0OTwxDO8UgnbjfJgy18cizIuo8IqnObj8nfuELs/QAWZG/rwHGKujLfFXscwVowxBtZsCgsqev9+bPNk1CMe5r/MHV6JUMzdvEd0KI7GlCS8bOG/a34KA== MIME-Version: 1.0 X-OriginatorOrg: prevas.dk X-MS-Exchange-CrossTenant-Network-Message-Id: ccf2e6fb-9a3f-4c3c-83ee-08d7b520c31c X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Feb 2020 09:47:41.5360 (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: PhbXJc5nf5LdM8udD6s9Y8QoyBW4AydiFxIUfHe9zIjkZOc2fTFlw1hGAQo+uX/tBWqviuPTl0j6VuDvaNK/NUxz9SeDTZvDvJbZPxiYPuk= 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 Always compile the env_fat_save() function, and let CONFIG_IS_ENABLED(SAVEENV) (via the ENV_SAVE_PTR macro) decide whether it actually ends up being compiled in. Signed-off-by: Rasmus Villemoes --- env/fat.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/env/fat.c b/env/fat.c index 1836556f36..cf2e5e2b26 100644 --- a/env/fat.c +++ b/env/fat.c @@ -26,12 +26,8 @@ # endif #else # define LOADENV -# if defined(CONFIG_CMD_SAVEENV) -# define CMD_SAVEENV -# endif #endif -#ifdef CMD_SAVEENV static int env_fat_save(void) { env_t __aligned(ARCH_DMA_MINALIGN) env_new; @@ -76,7 +72,6 @@ static int env_fat_save(void) return 0; } -#endif /* CMD_SAVEENV */ #ifdef LOADENV static int env_fat_load(void) @@ -135,7 +130,5 @@ U_BOOT_ENV_LOCATION(fat) = { #ifdef LOADENV .load = env_fat_load, #endif -#ifdef CMD_SAVEENV - .save = env_save_ptr(env_fat_save), -#endif + .save = ENV_SAVE_PTR(env_fat_save), }; From patchwork Wed Feb 19 09:47:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 1240604 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=XZ6I6knK; 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 48MtG70PSJz9sRN for ; Wed, 19 Feb 2020 20:48:47 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BC67580829; Wed, 19 Feb 2020 10:48:05 +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="XZ6I6knK"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 288D28025D; Wed, 19 Feb 2020 10:47:50 +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 00B7C80364 for ; Wed, 19 Feb 2020 10:47:43 +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=DuLiJDahTb/X+bjAa/B547A05DbJD3suDfC6dC9wC6wKop0MqEJ1VkZfeZ+D4OI9D1R86Mts4Jlf7mM2/H/w/42FvMkKk3+6Er0dSBBX4pbxeVb7z7BfeSON9AzG9Ujz1xzwjsIDVL1slFwG7+d/mtheYQUbBeq9iWYrpA6lxHwoxKzKked7AH0rWsahKT0IBHY1jsG3jVAMrkssULhwUF3svvZS6pULBIdI9dx+J8O9MkFsppHRR2q8Pz3Fm7XFp0edW4dBXlucF6ZE/uEEgY5TGIaqvP6S3NWWuvMd+xALIFXWATaY2Km5mT1sm3NZYRmbAcl5zqu5Y/7ytp0a8Q== 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=Zq0Odqg/SxSYJwd9Pt5s/i/Pa4rARh2i0IrGZm9JU1w=; b=SNEiDDwX5KD1f7P/c6eTuF6QvKaIykcndMnwOCO538kgA6AjY6wuglUX21Dum+LVdnX3mk4+3HqLLPQ+2oALeS35AQZLbzR4gBLrKY/4lt2H4Hc0LdOaPcI7VKM+YBMr343SXJ/58jfJbjmZozgoQi2WRPra7Iqk23/dhqi4LiigW9pIZpWrr8CNMHJctX4B4g/dLSACfuT7dBiVrjnJfRpTZjhbgVUALMLmMnv2H1aFLnZRK+ZnNzWRa9zSED+rlY7XOWgAa1KDJ2B+nwnDPu+ynUkq6slTNs9DP3hHBjOSeYwES+qa1iJOWSCFVUC3Tg8yZDJPFLhvzkRf8x8omg== 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=Zq0Odqg/SxSYJwd9Pt5s/i/Pa4rARh2i0IrGZm9JU1w=; b=XZ6I6knK5hhbIpusbIhFOe/eGWur56xzJwjvQo+HGOkrBy+fUxNH7Z+7D05vcTosOyBUKnQ/AWlGLL9/Kv7c7QHK87Fp+yfv4uitciFyRnvRSDBLk0GANFnOSTEriqzizCbZEN4ehu7ZGEr9sbmABdU+CSABUB5Q55CW6KCiNyQ= 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:42 +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:42 +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:41 +0000 From: Rasmus Villemoes To: "u-boot@lists.denx.de" CC: Joe Hershberger , Wolfgang Denk , Tom Rini , Rasmus Villemoes Subject: [PATCH 4/5] env/ext4.c: remove CONFIG_CMD_SAVEENV ifdef Thread-Topic: [PATCH 4/5] env/ext4.c: remove CONFIG_CMD_SAVEENV ifdef Thread-Index: AQHV5wmhqwfFvFW3hUOaEtDURIYyLQ== Date: Wed, 19 Feb 2020 09:47:42 +0000 Message-ID: <20200219094726.26798-5-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: dc61c023-6315-4ff7-0529-08d7b520c3a3 x-ms-traffictypediagnostic: VI1PR10MB2159: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:989; 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: zKD+ekr/YX75aPcnE+0izdMmmfoauWHecwHopl+7gvcjyBRvrXi0bf6qjD86WcgPqOhlz4A75vLtzOCtXQN8xmDbKAbt1a9nemp8iO8pUAf4R1kcD8aCM+LdYeaSV0vE7Xom8z+BWjkgsmuRLfGWL2IwNyEFN5Zp0vAq/Kr9mdAcWNMiCilwzUJhcoAas2Dounr6WmXWXosnrg8IIt3lZbhjZrny6E8fGG4WkILPtvagGz7DyjKvgjLu+78PynFKt4YaZT7TM3yA0Mrbe21+42i+b3LBSTQs7ysDC/Y2/9VSoTi4OqXrAxJODGzPtt1Sw5jMk2eQQtzmLFqSX4QOw66uNDZ9UGJSqia2pPC6xHelxT89dS/zsaqlrudGsEqqHTsJcGl3eLjBjrVnO+o5SCL0sijb9/mil14VfZX0ovlE4gy/qm31BX09wIK43IvP x-ms-exchange-antispam-messagedata: ZJfJewoxEgKW/cc8DM4n235D2YeRSOBtrdAkSBsQf7Isu53s0R4i4igX2gSIuX3OLmWXgWhi0hYC7/pBTxN7bwMD8NmztDI1u0Yo04gFH9e9ZqTFT7sEmxzHUsHsN3XcTTwhtCrVYy379dpC5dhtQg== MIME-Version: 1.0 X-OriginatorOrg: prevas.dk X-MS-Exchange-CrossTenant-Network-Message-Id: dc61c023-6315-4ff7-0529-08d7b520c3a3 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Feb 2020 09:47:42.4314 (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: jvCPqNJrSv3UIifkMVYIyjf1HVqEmyhBPmxCKsSi5WOPUQm6nK3OJSltxMBCP9cpJGxolC4DlpcSSChM7WucWIoCtIkB+OPnp0CmITzieN0= 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 Removing this ifdef/endif pair yields a "defined but unused warning" for CONFIG_CMD_SAVEENV=n, but that vanishes if we use the ENV_SAVE_PTR macro instead. This gives slightly better compile testing, and moreover, it's possible to have CONFIG_CMD_SAVEENV=n CONFIG_SPL_SAVEENV=y SPL_ENV_IS_IN_EXT4=y in which case env_ext4_save would erroneously not be compiled in. Signed-off-by: Rasmus Villemoes --- env/ext4.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/env/ext4.c b/env/ext4.c index 1f6b1b5bd8..911e19c6d3 100644 --- a/env/ext4.c +++ b/env/ext4.c @@ -41,7 +41,6 @@ __weak const char *env_ext4_get_dev_part(void) return (const char *)CONFIG_ENV_EXT4_DEVICE_AND_PART; } -#ifdef CONFIG_CMD_SAVEENV static int env_ext4_save(void) { env_t env_new; @@ -83,7 +82,6 @@ static int env_ext4_save(void) puts("done\n"); return 0; } -#endif /* CONFIG_CMD_SAVEENV */ static int env_ext4_load(void) { @@ -137,5 +135,5 @@ U_BOOT_ENV_LOCATION(ext4) = { .location = ENVL_EXT4, ENV_NAME("EXT4") .load = env_ext4_load, - .save = env_save_ptr(env_ext4_save), + .save = ENV_SAVE_PTR(env_ext4_save), }; 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