Skip to contentSkip to conversation

mmc: fix env in mmc with redundant compile error

PATCH New Bo Shen 4 participants 4 messages May 15, 2013 – Jun 13, 2013

lore
Share & tools
lore

Bo Shen

author
#0 lore raw

PATCH v2 1/1 mmc: fix env in mmc with redundant compile error

The commit d196bd8 (env_mmc: add support for redundant environment) introduce the following compile error when enable redundant environment support with MMC
---8<---
env_mmc.c:149: error: 'env_t' has no member named 'flags' env_mmc.c:248: error: 'env_t' has no member named 'flags' env_mmc.c:248: error: 'env_t' has no member named 'flags' env_mmc.c:250: error: 'env_t' has no member named 'flags' env_mmc.c:250: error: 'env_t' has no member named 'flags' env_mmc.c:252: error: 'env_t' has no member named 'flags' env_mmc.c:252: error: 'env_t' has no member named 'flags' env_mmc.c:254: error: 'env_t' has no member named 'flags' env_mmc.c:254: error: 'env_t' has no member named 'flags' env_mmc.c:267: error: 'env_t' has no member named 'flags' make[1]: *** [env_mmc.o] Error 1
--->8---

Add this patch to fix it

---
Changes in v2:
- s/reduandant/redundant in commit message

 include/environment.h |    6 ++++++
 1 file changed, 6 insertions(+)
include/environment.h +6 -0
index 4c6a37b..460ccb4 100644
@@ -75,6 +75,12 @@
 # endif
 #endif	/* CONFIG_ENV_IS_IN_FLASH */
 
+#if defined(CONFIG_ENV_IS_IN_MMC)
+# ifdef CONFIG_ENV_OFFSET_REDUND
+#  define CONFIG_SYS_REDUNDAND_ENVIRONMENT
+# endif
+#endif
+
 #if defined(CONFIG_ENV_IS_IN_NAND)
 # if defined(CONFIG_ENV_OFFSET_OOB)
 #  ifdef CONFIG_ENV_OFFSET_REDUND
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH v2 1/1 mmc: fix env in mmc with redundant compile error

Quoted 33 lines · Bo Shen

The commit d196bd8 (env_mmc: add support for redundant environment) introduce the following compile error when enable redundant environment support with MMC
---8<---
env_mmc.c:149: error: 'env_t' has no member named 'flags' env_mmc.c:248: error: 'env_t' has no member named 'flags' env_mmc.c:248: error: 'env_t' has no member named 'flags' env_mmc.c:250: error: 'env_t' has no member named 'flags' env_mmc.c:250: error: 'env_t' has no member named 'flags' env_mmc.c:252: error: 'env_t' has no member named 'flags' env_mmc.c:252: error: 'env_t' has no member named 'flags' env_mmc.c:254: error: 'env_t' has no member named 'flags' env_mmc.c:254: error: 'env_t' has no member named 'flags' env_mmc.c:267: error: 'env_t' has no member named 'flags' make[1]: *** [env_mmc.o] Error 1
--->8---

Add this patch to fix it

---
Changes in v2:
- s/reduandant/redundant in commit message

 include/environment.h |    6 ++++++
 1 file changed, 6 insertions(+)
include/environment.h +0 -0
index 4c6a37b..460ccb4 100644

include/environment.h line 84

Quoted 10 lines
include/environment.h +6 -0
@@ -75,6 +75,12 @@
 # endif
 #endif /* CONFIG_ENV_IS_IN_FLASH */
 
+#if defined(CONFIG_ENV_IS_IN_MMC)
+# ifdef CONFIG_ENV_OFFSET_REDUND
+#  define CONFIG_SYS_REDUNDAND_ENVIRONMENT
+# endif
+#endif
+
 

If CONFIG_SYS_REDUNDAND_ENVIRONMENT must be defined when CONFIG_ENV_OFFSET_REDUND is defined, then isn't it, itself, redundant?

Further, if defining CONFIG_ENV_OFFSET_REDUND is enough to make env_mmc.c access a variable that is protected by CONFIG_SYS_REDUNDAND_ENVIRONMENT, then doesn't that mean that those accesses are improperly protected (or that the "flags" field is)?

It looks like we keep patching over this problem, rather than fixing it....

Andy

PS - Is there a reason it's REDUNDAND, and not REDUNDANT?

#2 lore raw

PATCH v2 1/1 mmc: fix env in mmc with redundant compile error

Quoted 55 lines · Andy Fleming
Quoted 33 lines · Bo Shen

The commit d196bd8 (env_mmc: add support for redundant environment) introduce the following compile error when enable redundant environment support with MMC
---8<---
env_mmc.c:149: error: 'env_t' has no member named 'flags' env_mmc.c:248: error: 'env_t' has no member named 'flags' env_mmc.c:248: error: 'env_t' has no member named 'flags' env_mmc.c:250: error: 'env_t' has no member named 'flags' env_mmc.c:250: error: 'env_t' has no member named 'flags' env_mmc.c:252: error: 'env_t' has no member named 'flags' env_mmc.c:252: error: 'env_t' has no member named 'flags' env_mmc.c:254: error: 'env_t' has no member named 'flags' env_mmc.c:254: error: 'env_t' has no member named 'flags' env_mmc.c:267: error: 'env_t' has no member named 'flags' make[1]: *** [env_mmc.o] Error 1
--->8---

Add this patch to fix it

---
Changes in v2:
- s/reduandant/redundant in commit message

 include/environment.h |    6 ++++++
 1 file changed, 6 insertions(+)
include/environment.h +0 -0
index 4c6a37b..460ccb4 100644

include/environment.h line 84

Quoted 10 lines
include/environment.h +6 -0
@@ -75,6 +75,12 @@
 # endif
 #endif /* CONFIG_ENV_IS_IN_FLASH */
 
+#if defined(CONFIG_ENV_IS_IN_MMC)
+# ifdef CONFIG_ENV_OFFSET_REDUND
+#  define CONFIG_SYS_REDUNDAND_ENVIRONMENT
+# endif
+#endif
+
 

If CONFIG_SYS_REDUNDAND_ENVIRONMENT must be defined when CONFIG_ENV_OFFSET_REDUND is defined, then isn't it, itself, redundant?

Further, if defining CONFIG_ENV_OFFSET_REDUND is enough to make env_mmc.c access a variable that is protected by CONFIG_SYS_REDUNDAND_ENVIRONMENT, then doesn't that mean that those accesses are improperly protected (or that the "flags" field is)?

Quoted 5 lines

It looks like we keep patching over this problem, rather than fixing it....

Andy

PS - Is there a reason it's REDUNDAND, and not REDUNDANT?

The answer for all of the above is, history. A problem is that we need CONFIG_SYS_REDUNDAND_ENVIRONMENT if any of:
- CONFIG_ENV_OFFSET_REDUND
- CONFIG_ENV_ADDR_REDUND
- CONFIG_ENV_UBI_VOLUME_REDUND

are set. And the config variable is used in both common/env_ubi.c (which would be easy to switch to UBI_VOLUME_REDUND) and tools/envcrc.c, which would be harder. And I don't think we can just whack flags as being always on as that would invalidate peoples environment, from a quick peek at things.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130515/aba1b637/attachment.pgp>
Applied
#3 lore raw

PATCH v2 1/1 mmc: fix env in mmc with redundant compile error

In reply to Bo Shen
Quoted 17 lines · Bo Shen

The commit d196bd8 (env_mmc: add support for redundant environment) introduce the following compile error when enable redundant environment support with MMC
---8<---
env_mmc.c:149: error: 'env_t' has no member named 'flags' env_mmc.c:248: error: 'env_t' has no member named 'flags' env_mmc.c:248: error: 'env_t' has no member named 'flags' env_mmc.c:250: error: 'env_t' has no member named 'flags' env_mmc.c:250: error: 'env_t' has no member named 'flags' env_mmc.c:252: error: 'env_t' has no member named 'flags' env_mmc.c:252: error: 'env_t' has no member named 'flags' env_mmc.c:254: error: 'env_t' has no member named 'flags' env_mmc.c:254: error: 'env_t' has no member named 'flags' env_mmc.c:267: error: 'env_t' has no member named 'flags' make[1]: *** [env_mmc.o] Error 1
--->8---

Quoted 4 lines

Add this patch to fix it

Applied, thanks.

Andy