read.c (2e192b245ed36a63bab0ef576999a95e23f60ecd) | read.c (4101f6879256720b30df712089a3df18565f9203) |
---|---|
1/* 2 * Copyright (c) 2011 The Chromium OS Authors. All rights reserved. 3 * Use of this source code is governed by a BSD-style license that can be 4 * found in the LICENSE file. 5 * 6 * Alternatively, this software may be distributed under the terms of the 7 * GNU General Public License ("GPL") version 2 as published by the Free 8 * Software Foundation. 9 */ 10 11#include <common.h> 12#include <command.h> 13#include <part.h> 14 15int do_read(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) 16{ 17 char *ep; | 1/* 2 * Copyright (c) 2011 The Chromium OS Authors. All rights reserved. 3 * Use of this source code is governed by a BSD-style license that can be 4 * found in the LICENSE file. 5 * 6 * Alternatively, this software may be distributed under the terms of the 7 * GNU General Public License ("GPL") version 2 as published by the Free 8 * Software Foundation. 9 */ 10 11#include <common.h> 12#include <command.h> 13#include <part.h> 14 15int do_read(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) 16{ 17 char *ep; |
18 block_dev_desc_t *dev_desc = NULL; | 18 struct blk_desc *dev_desc = NULL; |
19 int dev; 20 int part = 0; 21 disk_partition_t part_info; 22 ulong offset = 0u; 23 ulong limit = 0u; 24 void *addr; 25 uint blk; 26 uint cnt; --- 25 unchanged lines hidden (view full) --- 52 if (part != 0) { 53 if (get_partition_info(dev_desc, part, &part_info)) { 54 printf("Cannot find partition %d\n", part); 55 return 1; 56 } 57 offset = part_info.start; 58 limit = part_info.size; 59 } else { | 19 int dev; 20 int part = 0; 21 disk_partition_t part_info; 22 ulong offset = 0u; 23 ulong limit = 0u; 24 void *addr; 25 uint blk; 26 uint cnt; --- 25 unchanged lines hidden (view full) --- 52 if (part != 0) { 53 if (get_partition_info(dev_desc, part, &part_info)) { 54 printf("Cannot find partition %d\n", part); 55 return 1; 56 } 57 offset = part_info.start; 58 limit = part_info.size; 59 } else { |
60 /* Largest address not available in block_dev_desc_t. */ | 60 /* Largest address not available in struct blk_desc. */ |
61 limit = ~0; 62 } 63 64 if (cnt + blk > limit) { 65 printf("Read out of range\n"); 66 return 1; 67 } 68 --- 13 unchanged lines hidden --- | 61 limit = ~0; 62 } 63 64 if (cnt + blk > limit) { 65 printf("Read out of range\n"); 66 return 1; 67 } 68 --- 13 unchanged lines hidden --- |