From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Holler Date: Mon, 07 Feb 2011 11:28:53 +0100 Subject: [U-Boot] U-Boot 2010.12 Cannot Successfully Save Variables with Redundant NAND Environment In-Reply-To: References: Message-ID: <4D4FC965.7040306@ahsoftware.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Am 06.02.2011 22:33, schrieb Grant Erickson: > // Preincrement random data. > > ++env_new.flags; /* increase the serial */ > > Unfortunately, preincrementing random data won't replicate the behavior of Wheter using preincrement or postinecrement isn't of interest here, using preincrement is just a good habit which will avoid temporaries when incrementing complex types in c++. Using always postincrement is a bad habit. Just let us call that increment. ;) But for the random it looks like you are true and I haven't had examined the code correctly. I had the believe (and examine the newly saved nand here showed that too), that env_new.flags contains the old serial. Must have been luck that I've had always the old serial there. Anyway, increasing the serial there is the right way, it's just that flags should already contain the old serial. > 2010.09, where the flags field was referenced through a global env_ptr such > that flag manipulation was handled (more) coherently as the environment was > read and written. Sorry, I don't know how that worked before. I never have come in touch with that before. Regards, Alexander