a5bd9f6
From a870b5f756cc03e163a0ed2a44276bac9ffd1f94 Mon Sep 17 00:00:00 2001
a5bd9f6
From: Vladimir 'phcoder' Serbinenko <phcoder@gmail.com>
a5bd9f6
Date: Thu, 28 Feb 2013 10:50:01 +0100
a5bd9f6
Subject: [PATCH 166/364] 	* grub-core/fs/minix.c: Remove nested
a5bd9f6
 functions.
a5bd9f6
a5bd9f6
---
a5bd9f6
 ChangeLog            |  4 ++++
a5bd9f6
 grub-core/fs/minix.c | 41 ++++++++++++++++++++---------------------
a5bd9f6
 2 files changed, 24 insertions(+), 21 deletions(-)
a5bd9f6
a5bd9f6
diff --git a/ChangeLog b/ChangeLog
a5bd9f6
index 206a094..056de9d 100644
a5bd9f6
--- a/ChangeLog
a5bd9f6
+++ b/ChangeLog
a5bd9f6
@@ -1,5 +1,9 @@
a5bd9f6
 2013-02-28  Vladimir Serbinenko  <phcoder@gmail.com>
a5bd9f6
 
a5bd9f6
+	* grub-core/fs/minix.c: Remove nested functions.
a5bd9f6
+
a5bd9f6
+2013-02-28  Vladimir Serbinenko  <phcoder@gmail.com>
a5bd9f6
+
a5bd9f6
 	* grub-core/fs/iso9660.c: Remove nested functions.
a5bd9f6
 
a5bd9f6
 2013-02-28  Vladimir Serbinenko  <phcoder@gmail.com>
a5bd9f6
diff --git a/grub-core/fs/minix.c b/grub-core/fs/minix.c
a5bd9f6
index 918fe56..225770a 100644
a5bd9f6
--- a/grub-core/fs/minix.c
a5bd9f6
+++ b/grub-core/fs/minix.c
a5bd9f6
@@ -178,6 +178,20 @@ static grub_dl_t my_mod;
a5bd9f6
 static grub_err_t grub_minix_find_file (struct grub_minix_data *data,
a5bd9f6
 					const char *path);
a5bd9f6
 
a5bd9f6
+  /* Read the block pointer in ZONE, on the offset NUM.  */
a5bd9f6
+static grub_minix_uintn_t
a5bd9f6
+grub_get_indir (struct grub_minix_data *data, 
a5bd9f6
+		 grub_minix_uintn_t zone,
a5bd9f6
+		 grub_minix_uintn_t num)
a5bd9f6
+{
a5bd9f6
+  grub_minix_uintn_t indirn;
a5bd9f6
+  grub_disk_read (data->disk,
a5bd9f6
+		  GRUB_MINIX_ZONE2SECT(zone),
a5bd9f6
+		  sizeof (grub_minix_uintn_t) * num,
a5bd9f6
+		  sizeof (grub_minix_uintn_t), (char *) &indirn);
a5bd9f6
+  return grub_minix_to_cpu_n (indirn);
a5bd9f6
+}
a5bd9f6
+
a5bd9f6
 static grub_minix_uintn_t
a5bd9f6
 grub_minix_get_file_block (struct grub_minix_data *data, unsigned int blk)
a5bd9f6
 {
a5bd9f6
@@ -185,21 +199,6 @@ grub_minix_get_file_block (struct grub_minix_data *data, unsigned int blk)
a5bd9f6
   const grub_uint32_t block_per_zone = (GRUB_MINIX_ZONESZ
a5bd9f6
 					/ GRUB_MINIX_INODE_BLKSZ (data));
a5bd9f6
 
a5bd9f6
-  auto grub_minix_uintn_t grub_get_indir (grub_minix_uintn_t,
a5bd9f6
-					  grub_minix_uintn_t);
a5bd9f6
-
a5bd9f6
-  /* Read the block pointer in ZONE, on the offset NUM.  */
a5bd9f6
-  grub_minix_uintn_t grub_get_indir (grub_minix_uintn_t zone,
a5bd9f6
-				     grub_minix_uintn_t num)
a5bd9f6
-    {
a5bd9f6
-      grub_minix_uintn_t indirn;
a5bd9f6
-      grub_disk_read (data->disk,
a5bd9f6
-		      GRUB_MINIX_ZONE2SECT(zone),
a5bd9f6
-		      sizeof (grub_minix_uintn_t) * num,
a5bd9f6
-		      sizeof (grub_minix_uintn_t), (char *) &indirn);
a5bd9f6
-      return grub_minix_to_cpu_n (indirn);
a5bd9f6
-    }
a5bd9f6
-
a5bd9f6
   /* Direct block.  */
a5bd9f6
   if (blk < GRUB_MINIX_INODE_DIR_BLOCKS)
a5bd9f6
     return GRUB_MINIX_INODE_DIR_ZONES (data, blk);
a5bd9f6
@@ -208,7 +207,7 @@ grub_minix_get_file_block (struct grub_minix_data *data, unsigned int blk)
a5bd9f6
   blk -= GRUB_MINIX_INODE_DIR_BLOCKS;
a5bd9f6
   if (blk < block_per_zone)
a5bd9f6
     {
a5bd9f6
-      indir = grub_get_indir (GRUB_MINIX_INODE_INDIR_ZONE (data), blk);
a5bd9f6
+      indir = grub_get_indir (data, GRUB_MINIX_INODE_INDIR_ZONE (data), blk);
a5bd9f6
       return indir;
a5bd9f6
     }
a5bd9f6
 
a5bd9f6
@@ -216,10 +215,10 @@ grub_minix_get_file_block (struct grub_minix_data *data, unsigned int blk)
a5bd9f6
   blk -= block_per_zone;
a5bd9f6
   if (blk < block_per_zone * block_per_zone)
a5bd9f6
     {
a5bd9f6
-      indir = grub_get_indir (GRUB_MINIX_INODE_DINDIR_ZONE (data),
a5bd9f6
+      indir = grub_get_indir (data, GRUB_MINIX_INODE_DINDIR_ZONE (data),
a5bd9f6
 			      blk / block_per_zone);
a5bd9f6
 
a5bd9f6
-      indir = grub_get_indir (indir, blk % block_per_zone);
a5bd9f6
+      indir = grub_get_indir (data, indir, blk % block_per_zone);
a5bd9f6
 
a5bd9f6
       return indir;
a5bd9f6
     }
a5bd9f6
@@ -229,10 +228,10 @@ grub_minix_get_file_block (struct grub_minix_data *data, unsigned int blk)
a5bd9f6
   if (blk < ((grub_uint64_t) block_per_zone * (grub_uint64_t) block_per_zone
a5bd9f6
 	     * (grub_uint64_t) block_per_zone))
a5bd9f6
     {
a5bd9f6
-      indir = grub_get_indir (grub_minix_to_cpu_n (data->inode.triple_indir_zone),
a5bd9f6
+      indir = grub_get_indir (data, grub_minix_to_cpu_n (data->inode.triple_indir_zone),
a5bd9f6
 			      (blk / block_per_zone) / block_per_zone);
a5bd9f6
-      indir = grub_get_indir (indir, (blk / block_per_zone) % block_per_zone);
a5bd9f6
-      indir = grub_get_indir (indir, blk % block_per_zone);
a5bd9f6
+      indir = grub_get_indir (data, indir, (blk / block_per_zone) % block_per_zone);
a5bd9f6
+      indir = grub_get_indir (data, indir, blk % block_per_zone);
a5bd9f6
 
a5bd9f6
       return indir;
a5bd9f6
     }
a5bd9f6
-- 
a5bd9f6
1.8.1.4
a5bd9f6