From patchwork Wed Nov 23 20:28:17 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Wagner X-Patchwork-Id: 127377 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 2CA4A1007D7 for ; Thu, 24 Nov 2011 07:36:51 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 35F2F2823E; Wed, 23 Nov 2011 21:36:45 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7LBim3IWkdwq; Wed, 23 Nov 2011 21:36:44 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2210C2820F; Wed, 23 Nov 2011 21:36:33 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 91BB2281D6 for ; Wed, 23 Nov 2011 21:36:23 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gf-dr07Z3xIH for ; Wed, 23 Nov 2011 21:36:23 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail.free-electrons.com (mail.free-electrons.com [88.190.12.23]) by theia.denx.de (Postfix) with ESMTP id 5CF7D281E7 for ; Wed, 23 Nov 2011 21:36:20 +0100 (CET) Received: by mail.free-electrons.com (Postfix, from userid 106) id 4E94D295; Wed, 23 Nov 2011 21:28:45 +0100 (CET) Received: from localhost.localdomain (bon31-3-82-226-48-55.fbx.proxad.net [82.226.48.55]) by mail.free-electrons.com (Postfix) with ESMTPSA id 327421DD; Wed, 23 Nov 2011 21:28:29 +0100 (CET) From: David Wagner To: u-boot@lists.denx.de Date: Wed, 23 Nov 2011 21:28:17 +0100 Message-Id: <1322080098-3151-9-git-send-email-david.wagner@free-electrons.com> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: <1322080098-3151-1-git-send-email-david.wagner@free-electrons.com> References: <1322080098-3151-1-git-send-email-david.wagner@free-electrons.com> Cc: thomas.petazzoni@free-electrons.com Subject: [U-Boot] [PATCH 8/9] mkenvimage: Really set the redundant byte when applicable X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Signed-off-by: David Wagner --- tools/mkenvimage.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/tools/mkenvimage.c b/tools/mkenvimage.c index 8d84c85..fa6eb6e 100644 --- a/tools/mkenvimage.c +++ b/tools/mkenvimage.c @@ -257,7 +257,9 @@ int main(int argc, char **argv) crc = crc32(0, envptr, envsize); targetendian_crc = bigendian ? cpu_to_be32(crc) : cpu_to_le32(crc); - memcpy(dataptr, &targetendian_crc, sizeof(uint32_t)); + memcpy(dataptr, &targetendian_crc, sizeof(targetendian_crc)); + if (redundant) + *(dataptr + sizeof(targetendian_crc)) = 1; bin_fd = creat(bin_filename, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP); if (bin_fd == -1) {