fmap_find_area: Use const pointers for fmap and return value

fmap_find_area does not modify the fmap, let's use const pointers.

BUG=none
TEST=emerge flashmap

Change-Id: Ie5c64c3df3b2ef44a2e2ca0dbef4dd3403d91d75
Reviewed-on: https://chromium-review.googlesource.com/479037
Commit-Ready: Nicolas Boichat <drinkcat@chromium.org>
Tested-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
diff --git a/lib/fmap.c b/lib/fmap.c
index 5022434..8984697 100644
--- a/lib/fmap.c
+++ b/lib/fmap.c
@@ -349,10 +349,11 @@
 	return new_size;
 }
 
-struct fmap_area *fmap_find_area(struct fmap *fmap, const char *name)
+const struct fmap_area *fmap_find_area(const struct fmap *fmap,
+				       const char *name)
 {
 	int i;
-	struct fmap_area *area = NULL;
+	const struct fmap_area *area = NULL;
 
 	if (!fmap || !name)
 		return NULL;
@@ -532,10 +533,10 @@
 	return status;
 }
 
-static int fmap_find_area_test(struct fmap *fmap)
+static int fmap_find_area_test(const struct fmap *fmap)
 {
 	status = fail;
-	char area_name[] = "test_area_1";
+	const char area_name[] = "test_area_1";
 
 	if (fmap_find_area(NULL, area_name) ||
 	    fmap_find_area(fmap, NULL)) {
diff --git a/lib/fmap.h b/lib/fmap.h
index 9cea22d..d5809dd 100644
--- a/lib/fmap.h
+++ b/lib/fmap.h
@@ -184,7 +184,8 @@
  * returns a pointer to the entry in the fmap structure if successful
  * returns NULL to indicate failure or if no matching area entry is found
  */
-extern struct fmap_area *fmap_find_area(struct fmap *fmap, const char *name);
+extern const struct fmap_area *fmap_find_area(const struct fmap *fmap,
+					      const char *name);
 
 /* unit testing stuff */
 extern int fmap_test();