Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(320)

Unified Diff: common/cmd_cros_bootstub.c

Issue 6650024: Factor out read_firmware_device() (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/u-boot-next.git@chromeos-v2010.09
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | include/chromeos/firmware_storage.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: common/cmd_cros_bootstub.c
diff --git a/common/cmd_cros_bootstub.c b/common/cmd_cros_bootstub.c
index 8c53ec851717879199ce55f68f0ed1c51e7527e2..c1ae25d451df531ea4dae61f026465304a346e32 100644
--- a/common/cmd_cros_bootstub.c
+++ b/common/cmd_cros_bootstub.c
@@ -34,42 +34,6 @@
#define FIRMWARE_B 2
/*
- * Read <count> bytes, starting from <offset>, from firmware storage
- * device <file> into buffer <buf>.
- *
- * Return 0 on success, non-zero on error.
- */
-int read_firmware_device(firmware_storage_t *file, off_t offset, void *buf,
- size_t count)
-{
- ssize_t size;
-
- if (file->seek(file->context, offset, SEEK_SET) < 0) {
- debug(PREFIX "seek to address 0x%08x fail\n", offset);
- return -1;
- }
-
- size = 0;
- while (count > 0 &&
- (size = file->read(file->context, buf, count)) > 0) {
- count -= size;
- buf += size;
- }
-
- if (size < 0) {
- debug(PREFIX "an error occur when read firmware: %d\n", size);
- return -1;
- }
-
- if (count > 0) {
- debug(PREFIX "cannot read all data: %d\n", count);
- return -1;
- }
-
- return 0;
-}
-
-/*
* Read verification block on <vblock_offset> from <file>.
*
* The pointer to verification block is stored in <vblock_ptr>, and the size of
« no previous file with comments | « no previous file | include/chromeos/firmware_storage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698