From mboxrd@z Thu Jan 1 00:00:00 1970 From: Philippe De Swert Date: Mon, 07 Dec 2015 19:18:02 +0200 Subject: [U-Boot] [PATCH] mkimage: Fix generating multi and script images again In-Reply-To: <1449507714-9599-1-git-send-email-marex@denx.de> References: <1449507714-9599-1-git-send-email-marex@denx.de> Message-ID: <5665BF4A.5030608@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi, I haven't had time to check the previous report yet. On 07/12/15 19:01, Marek Vasut wrote: > Seems 6ae6e160 broke creating multi and script type images and even > building of mkimage itself. There are two problems with that patch. > > First is that expression (!(x == 0) || !(x == 1)) is always true for > unsigned int x. The expression must use AND (&&) not OR (||) to be > correct. It is either multi or script, so AND does not sound correct. The code should skip the following bit if either of those flags is detected. I admit I threw in the script bit as an afterthought and things went wrong there. Correct would be if( !(params.type == IH_TYPE_MULTI || params.type == IH_TYPE_SCRIPT)) I'll double-check stuff and submit a new patch > Second is the coding which causes gcc 4.9.x and newer scream gruesome > death and murder. The expression !x == 0 && !x == 1 is ambiguous and > should instead be rewritten into (x != 0) && (x != 1) to be correct. > The parenthesis are added for clarity. Weirdly enough I have gcc 4.9.2 and it did not even beep, so I don't know how it could have broken the build. Give me some time to submit a corrective patch later tonight. Cheers, Philippe