From patchwork Mon Aug 26 11:06:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierre-Jean Texier X-Patchwork-Id: 1153106 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=quarantine dis=none) header.from=koncepto.io Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=koncepto.io header.i=@koncepto.io header.b="c5/r1UEA"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46H8Q906lcz9sBF for ; Mon, 26 Aug 2019 21:08:48 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id AEEDAC2212D; Mon, 26 Aug 2019 11:07:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_PASS, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 858A4C2214E; Mon, 26 Aug 2019 11:07:01 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id BFF15C2216A; Mon, 26 Aug 2019 11:06:48 +0000 (UTC) Received: from koncepto.io (koncepto.io [195.154.119.111]) by lists.denx.de (Postfix) with ESMTPS id 87FBDC21FCA for ; Mon, 26 Aug 2019 11:06:45 +0000 (UTC) Received: from menoah.home (lfbn-1-8923-205.w193-250.abo.wanadoo.fr [193.250.65.205]) by koncepto.io (Postfix) with ESMTPSA id EB51860367; Mon, 26 Aug 2019 13:06:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=koncepto.io; s=default; t=1566817605; bh=/BzW5h1tpm92Axd1WgUReyBQsFQF3cTqd1CNLOzC1ko=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c5/r1UEA9buu4jObmZtyFpyrpiS53PaMZNrL4rMiyrbgACz9Mkdy2Z55vsSjmATqG 7uTbEVjsPuqi/ECX2+8I9ozMGh72h4vosbfoak2jzAwHkC4ostork7ltSS2ahy7ZuO CN0oXYk6/WA5mipEaQb6aaipBMd65Hm7hfN365ZHk5a8RBJD805QekonFLGUahFIP6 J7bu7RkeQeCV5n3lqIPfYddP73Lfx4hNs5plSHs+xDT69dyfW7xBGp0qLEljRfw9VS WD/O/BhsUWgQVVbQdludCJaYQgrkLYRUOjdiAA8zMCFYX7TnQT5wvzHDSQiZ0w+RDW ClVzkMBJWfW4Q== From: Pierre-Jean Texier To: u-boot@lists.denx.de Date: Mon, 26 Aug 2019 13:06:16 +0200 Message-Id: <1566817578-16750-3-git-send-email-pjtexier@koncepto.io> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1566817578-16750-1-git-send-email-pjtexier@koncepto.io> References: <1566817578-16750-1-git-send-email-pjtexier@koncepto.io> MIME-Version: 1.0 Cc: bjorn@haxx.se, michal.simek@xilinx.com, joe.hershberger@ni.com, philip@philipmolloy.com Subject: [U-Boot] [PATCH v2 2/4] fw_env: fix build error X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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 --- v1 -> v2: - fix fw_setenv with flag_obsolete (reported by Heiko Schocher) tools/env/fw_env.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c index 876bf2b..e2801f5 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");