From: Pierre-Jean Texier Date: Mon, 26 Aug 2019 11:06:16 +0000 (+0200) Subject: fw_env: fix build error X-Git-Tag: v2019.10~13 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=7ce01c78dcd34b49c779467c33953c931bf7bf06;p=oweals%2Fu-boot.git fw_env: fix build error The following error appears: tools/env/fw_env.c:1149:25: error: lvalue required as unary ‘&’ operand rc = write(fd, &ENV_REDUND_OBSOLETE, sizeof(ENV_REDUND_OBSOLETE)); Fixes: d3716dd ("env: Rename the redundancy flags") Signed-off-by: Pierre-Jean Texier Tested-by: Joris Offouga Tested-by: Heiko Schocher Suggested-by: Heiko Schocher Acked-by: Joe Hershberger --- diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c index 876bf2b2da..e2801f595f 100644 --- a/tools/env/fw_env.c +++ b/tools/env/fw_env.c @@ -1135,6 +1135,7 @@ static int flash_flag_obsolete(int dev, int fd, off_t offset) { int rc; struct erase_info_user erase; + char tmp = ENV_REDUND_OBSOLETE; erase.start = DEVOFFSET(dev); erase.length = DEVESIZE(dev); @@ -1146,7 +1147,7 @@ static int flash_flag_obsolete(int dev, int fd, off_t offset) return rc; } ioctl(fd, MEMUNLOCK, &erase); - rc = write(fd, &ENV_REDUND_OBSOLETE, sizeof(ENV_REDUND_OBSOLETE)); + rc = write(fd, &tmp, sizeof(tmp)); ioctl(fd, MEMLOCK, &erase); if (rc < 0) perror("Could not set obsolete flag");