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

Side by Side Diff: host/lib/fmap.c

Issue 6465018: Add load_firmware_test utility program (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/vboot_reference.git@master
Patch Set: Code review & remove tabs Created 9 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
7 #include <stdio.h>
8 #include <string.h>
9
10 #include "fmap.h"
11
12 /* Return NULL if fail */
gauravsh 2011/02/10 20:02:05 remove this comment - since you already document t
Che-Liang Chiou 2011/02/14 02:27:53 Done.
13 const char *FindFmap(const char *ptr, size_t size)
gauravsh 2011/02/10 20:02:05 const char*
Che-Liang Chiou 2011/02/14 02:27:53 Done.
14 {
15 size_t i;
16 for (i=0; i<size; i += FMAP_SEARCH_STRIDE) {
17 if (0 == strncmp(ptr, "__FMAP__", 8))
Randall Spangler 2011/02/11 17:26:04 Seems like "__FMAP__" should be a const string or
Che-Liang Chiou 2011/02/14 02:27:53 Done.
18 return ptr;
19 ptr += FMAP_SEARCH_STRIDE;
20 }
21 return NULL;
22 }
23
24 int FmapAreaIndex(const FmapHeader* fh, const FmapAreaHeader* ah,
25 const char* name) {
26 int i;
27 for (i = 0; i < fh->fmap_nareas; i++)
28 if (!strcmp((const char*) ah[i].area_name, name))
29 return i;
30 return -1;
31 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698