From patchwork Mon Oct 12 19:54:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 529398 X-Patchwork-Delegate: jagannadh.teki@gmail.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 462C514027C for ; Tue, 13 Oct 2015 06:55:24 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 09B5C4B8A5; Mon, 12 Oct 2015 21:55:21 +0200 (CEST) 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 4sgAhwpwo5Nr; Mon, 12 Oct 2015 21:55:20 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 970384B8A9; Mon, 12 Oct 2015 21:55:17 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 56AC84B794 for ; Mon, 12 Oct 2015 21:55:13 +0200 (CEST) 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 SzZx2XxPg9N6 for ; Mon, 12 Oct 2015 21:55:13 +0200 (CEST) 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-pa0-f46.google.com (mail-pa0-f46.google.com [209.85.220.46]) by theia.denx.de (Postfix) with ESMTPS id CD8C04B792 for ; Mon, 12 Oct 2015 21:55:11 +0200 (CEST) Received: by pabve7 with SMTP id ve7so104142252pab.2 for ; Mon, 12 Oct 2015 12:55:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=LyeJM4HUfwB50SMNBxSXsz/amRgv24YeIAUJK3VQbO0=; b=nM1mzIsavyLWx3X58M9vl599hwPaykOqCjgtg2Rx/tpTUkv19NdhOLjz3BFhlzpq8L shQxYuWgmNChZWd6kra7lSiD0MEKWAk60Y4v+uxT1TFPsE6EWZKhkW8g+k7RI9XkUDHR cfnjvuyKTPnfCK132yV1tfufqGJOCATYwYo13nrZjyXSpyF8rlWD0Ne/6tYcv8ParPVs ++2GA5YjlJ0YfSV3uJ8M6yx5eigcROonnVPGCIDQfzxo4crxRnXxjF3PxxyKIx6iZK8C HiTeEaPsHBF0K+M2jwLZR4avBHCl/PkC4pT+L6oxy8W1kqb20di/KvHm1zCp9d+2P/bJ JwJw== X-Received: by 10.68.179.33 with SMTP id dd1mr36567503pbc.134.1444679710062; Mon, 12 Oct 2015 12:55:10 -0700 (PDT) Received: from localhost.localdomain ([123.236.183.133]) by smtp.gmail.com with ESMTPSA id g12sm4613845pat.36.2015.10.12.12.55.07 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 12 Oct 2015 12:55:09 -0700 (PDT) From: Jagan Teki To: u-boot@lists.denx.de Date: Tue, 13 Oct 2015 01:24:10 +0530 Message-Id: <1444679655-30349-3-git-send-email-jteki@openedev.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1444679655-30349-1-git-send-email-jteki@openedev.com> References: <1444679655-30349-1-git-send-email-jteki@openedev.com> Cc: Jagan Teki Subject: [U-Boot] [PATCH 3/8] cmd_sf: Use mtd->size instead of flash->size X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Since mtd got added, replace flash->size with mtd->size. Signed-off-by: Jagan Teki Reviewed-by: Heiko Schocher --- common/cmd_sf.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/common/cmd_sf.c b/common/cmd_sf.c index ac7f5df..a501376 100644 --- a/common/cmd_sf.c +++ b/common/cmd_sf.c @@ -275,13 +275,13 @@ static int do_spi_flash_read_write(int argc, char * const argv[]) return -1; if (mtd_arg_off_size(argc - 2, &argv[2], &dev, &offset, &len, - &maxsize, MTD_DEV_TYPE_NOR, flash->size)) + &maxsize, MTD_DEV_TYPE_NOR, flash->mtd->size)) return -1; /* Consistency checking */ - if (offset + len > flash->size) { - printf("ERROR: attempting %s past flash size (%#x)\n", - argv[0], flash->size); + if (offset + len > flash->mtd->size) { + printf("ERROR: attempting %s past flash size (0x%llx)\n", + argv[0], flash->mtd->size); return 1; } @@ -327,7 +327,7 @@ static int do_spi_flash_erase(int argc, char * const argv[]) return -1; if (mtd_arg_off(argv[1], &dev, &offset, &len, &maxsize, - MTD_DEV_TYPE_NOR, flash->size)) + MTD_DEV_TYPE_NOR, flash->mtd->size)) return -1; ret = sf_parse_len_arg(argv[2], &size); @@ -335,9 +335,9 @@ static int do_spi_flash_erase(int argc, char * const argv[]) return -1; /* Consistency checking */ - if (offset + size > flash->size) { - printf("ERROR: attempting %s past flash size (%#x)\n", - argv[0], flash->size); + if (offset + size > flash->mtd->size) { + printf("ERROR: attempting %s past flash size (0x%llx)\n", + argv[0], flash->mtd->size); return 1; }