From patchwork Mon Mar 11 16:08:13 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 226587 X-Patchwork-Delegate: trini@ti.com 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 511092C02C2 for ; Tue, 12 Mar 2013 03:11:47 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 22E064A23E; Mon, 11 Mar 2013 17:11:36 +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 tKFaJqOCU50T; Mon, 11 Mar 2013 17:11:35 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5FD704A23F; Mon, 11 Mar 2013 17:10:35 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8C74D4A1DE for ; Mon, 11 Mar 2013 17:09:28 +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 HjCNCZxM6A1e for ; Mon, 11 Mar 2013 17:09:26 +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-gh0-f202.google.com (mail-gh0-f202.google.com [209.85.160.202]) by theia.denx.de (Postfix) with ESMTPS id 6CE694A204 for ; Mon, 11 Mar 2013 17:09:01 +0100 (CET) Received: by mail-gh0-f202.google.com with SMTP id z10so393223ghb.1 for ; Mon, 11 Mar 2013 09:09:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=7ACQcuf0HO+3E77AHu51lu+fy04sbKQ16aKjD6lEfNE=; b=GHkZS+TZNvS7mi2RjLt8WanEFyoYP8pcAum4j8etKETHlAIK1IrSwJYIaRxpsbkY25 9/qvTMtybyJIvj1AKI2kfjkweazHh/5b7qLDi5fx53os0JX4kWARZlzItP2ELrLBIgVy ITxjZ+b65loRc5hYoZkx12n44jsErylgLtnvAcLvdSiuM86ag3IBxVyNuwtErEjzCFHz 3IKPPJcNb7HqewEdv//fmKje+JeIYeR3Va7suEWKxnojMMjh7a+T9aAka0NTTYBFlrHa 5phbKDgySiwF2C8LwuO5aKxZyrpNDI93zV95pQxFGGLmHAyt6xJJXLncxIjpUwmKPKCb +oGw== X-Received: by 10.236.115.104 with SMTP id d68mr7927722yhh.53.1363018140084; Mon, 11 Mar 2013 09:09:00 -0700 (PDT) Received: from corp2gmr1-1.hot.corp.google.com (corp2gmr1-1.hot.corp.google.com [172.24.189.92]) by gmr-mx.google.com with ESMTPS id i65si1087448yhh.5.2013.03.11.09.09.00 (version=TLSv1.1 cipher=AES128-SHA bits=128/128); Mon, 11 Mar 2013 09:09:00 -0700 (PDT) Received: from kaka.mtv.corp.google.com (kaka.mtv.corp.google.com [172.22.73.79]) by corp2gmr1-1.hot.corp.google.com (Postfix) with ESMTP id E5F4731C26C; Mon, 11 Mar 2013 09:08:59 -0700 (PDT) Received: by kaka.mtv.corp.google.com (Postfix, from userid 121222) id C3637160927; Mon, 11 Mar 2013 09:08:59 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Mon, 11 Mar 2013 09:08:13 -0700 Message-Id: <1363018093-28979-16-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 1.8.1.3 In-Reply-To: <1363018093-28979-1-git-send-email-sjg@chromium.org> References: <1363018093-28979-1-git-send-email-sjg@chromium.org> X-Gm-Message-State: ALoCoQltW9TnYRGtg0BN2rjJ1C7TGNLEzHnrWZHneYr+71fSEvhH3sNn6zkypSRYwaNBB0pJ2LH6SpqvVuUvAHyKLlobqNf87LEAc4zL9HCkqfLuVK4PH/NRNRqvuosQlBaq3r6RkLYi4lmCvHQgu7qUVb0qXb3KyOWD1ZPKm5A88k8/CKTe4jCEzUPqP1TWMLquPm5fBeZ8 Cc: Graeme Russ , Tom Warren Subject: [U-Boot] [PATCH v2 15/15] sf: Use unsigned type for buffers 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 The verify code is broken on archs with signed char. Fix it. Signed-off-by: Simon Glass --- Changes in v2: - Add new patch to use unsigned type for buffers in 'sf test' common/cmd_sf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/cmd_sf.c b/common/cmd_sf.c index b175358..3f0d414 100644 --- a/common/cmd_sf.c +++ b/common/cmd_sf.c @@ -369,8 +369,8 @@ static void spi_test_next_stage(struct test_info *test) * @param vbuf Verification buffer * @return 0 if ok, -1 on error */ -static int spi_flash_test(struct spi_flash *flash, char *buf, ulong len, - ulong offset, char *vbuf) +static int spi_flash_test(struct spi_flash *flash, uint8_t *buf, ulong len, + ulong offset, uint8_t *vbuf) { struct test_info test; int i; @@ -431,9 +431,9 @@ static int do_spi_flash_test(int argc, char * const argv[]) { unsigned long offset; unsigned long len; - char *buf = (char *)CONFIG_SYS_TEXT_BASE; + uint8_t *buf = (uint8_t *)CONFIG_SYS_TEXT_BASE; char *endp; - char *vbuf; + uint8_t *vbuf; int ret; offset = simple_strtoul(argv[1], &endp, 16);