All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/4] fw_env: fix build error
Date: Mon, 26 Aug 2019 10:59:20 +0200	[thread overview]
Message-ID: <50cf07f6-5e4c-3982-f8f8-f2f2d3adf748@denx.de> (raw)
In-Reply-To: <471c4f31-06a0-f52f-0268-3bc776d8aee0@denx.de>

Hello Pierre-Jean,

Am 26.08.2019 um 08:57 schrieb Heiko Schocher:
> Hello Jean-Pierre,
> 
> Am 23.08.2019 um 23:03 schrieb Pierre-Jean Texier:
>> 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 <pjtexier@koncepto.io>
>> ---
>>   tools/env/fw_env.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> See the same problem, thanks for the Fix!
> 
> Tested-by: Heiko Schocher <hs@denx.de>

Testing deeper on an imx6 based board with Environment in SPI NOR, and
I see:

root at K30RF-5e108e:~# fw_setenv ubifitsz
Could not set obsolete flag: Operation not supported

Also with your patch ... :-(

With follwoing change fw_setenv works again for me:

hs at xmglap:u-boot  [k30rf] $ git diff
diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
index b8b936f9ea..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");
hs at xmglap:u-boot  [k30rf] $

May you can try?

bye,
Heiko
-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: hs@denx.de

  reply	other threads:[~2019-08-26  8:59 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-23 21:03 [U-Boot] [PATCH 0/4] env: fix build error for envtools Pierre-Jean Texier
2019-08-23 21:03 ` [U-Boot] [PATCH 1/4] fw_env: remove duplicated definitions Pierre-Jean Texier
2019-08-24  8:50   ` Joris OFFOUGA
2019-08-26  6:56   ` Heiko Schocher
2019-09-03 22:35   ` Joe Hershberger
2019-08-23 21:03 ` [U-Boot] [PATCH 2/4] fw_env: fix build error Pierre-Jean Texier
2019-08-24  8:49   ` Joris OFFOUGA
2019-08-26  6:57   ` Heiko Schocher
2019-08-26  8:59     ` Heiko Schocher [this message]
2019-08-26 10:54       ` Pierre-Jean Texier
2019-08-23 21:03 ` [U-Boot] [PATCH 3/4] env: add missing <compiler.h> header file Pierre-Jean Texier
2019-08-24  8:50   ` Joris OFFOUGA
2019-08-26  6:57   ` Heiko Schocher
2019-08-23 21:03 ` [U-Boot] [PATCH 4/4] ci: add envtools support Pierre-Jean Texier
2019-08-26  6:58   ` Heiko Schocher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50cf07f6-5e4c-3982-f8f8-f2f2d3adf748@denx.de \
    --to=hs@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.