]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/fs/zfs/zfs.c: Stylistic fixes.
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sun, 14 Jul 2013 20:48:23 +0000 (22:48 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sun, 14 Jul 2013 20:48:23 +0000 (22:48 +0200)
ChangeLog
grub-core/fs/zfs/zfs.c

index c231b030a0a383d2202a450e055ea20a81655789..c68075c038974008231acc638e9167f7269d6329 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2013-07-14  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/fs/zfs/zfs.c: Stylistic fixes.
+
 2013-07-14  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * grub-core/fs/zfs/zfs.c: Run emacs indent on file.
index 8c2c9b627a3f72fd6edd277e8d2038031a7e5b3e..dfab221cdfb1611025504284e2e4175441a5dd29 100644 (file)
@@ -812,7 +812,7 @@ fill_vdev_info (struct grub_zfs_data *data,
  * nvpair is the last pair in the nvlist, NULL is returned.
  */
 static const char *
-nvlist_next_nvpair(const char *nvl, const char *nvpair)
+nvlist_next_nvpair (const char *nvl, const char *nvpair)
 {
   const char *nvp;
   int encode_size;
@@ -820,24 +820,28 @@ nvlist_next_nvpair(const char *nvl, const char *nvpair)
   if (nvl == NULL)
     return NULL;
 
-  if (nvpair == NULL) {
-    /* skip over header, nvl_version and nvl_nvflag */
-    nvpair = nvl + 4 * 3;
-  } else {
-    /* skip to the next nvpair */
-    encode_size = grub_be_to_cpu32 (grub_get_unaligned32(nvpair));
-    nvpair += encode_size;
-    /*If encode_size equals 0 nvlist_next_nvpair would return
-     * the same pair received in input, leading to an infinite loop.
-     * If encode_size is less than 0, this will move the pointer
-     * backwards, *possibly* examinining two times the same nvpair
-     * and potentially getting into an infinite loop. */
-    if(encode_size <= 0) {
-      grub_dprintf ("zfs", "nvpair with size <= 0\n");
-      grub_error (GRUB_ERR_BAD_FS, "incorrect nvlist");
-      return NULL;
+  if (nvpair == NULL)
+    {
+      /* skip over header, nvl_version and nvl_nvflag */
+      nvpair = nvl + 4 * 3;
+    } 
+  else
+    {
+      /* skip to the next nvpair */
+      encode_size = grub_be_to_cpu32 (grub_get_unaligned32(nvpair));
+      nvpair += encode_size;
+      /*If encode_size equals 0 nvlist_next_nvpair would return
+       * the same pair received in input, leading to an infinite loop.
+       * If encode_size is less than 0, this will move the pointer
+       * backwards, *possibly* examinining two times the same nvpair
+       * and potentially getting into an infinite loop. */
+      if(encode_size <= 0)
+       {
+         grub_dprintf ("zfs", "nvpair with size <= 0\n");
+         grub_error (GRUB_ERR_BAD_FS, "incorrect nvlist");
+         return NULL;
+       }
     }
-  }
   /* 8 bytes of 0 marks the end of the list */
   if (grub_get_unaligned64 (nvpair) == 0)
     return NULL;
@@ -867,12 +871,13 @@ nvlist_next_nvpair(const char *nvl, const char *nvpair)
 
   return nvpair;
 }
+
 /*
  * This function returns 0 on success and 1 on failure. On success, a string
  * containing the name of nvpair is saved in buf.
  */
 static int
-nvpair_name(const char *nvp, char **buf, int* buflen)
+nvpair_name (const char *nvp, char **buf, int *buflen)
 {
   int len;
 
@@ -887,12 +892,13 @@ nvpair_name(const char *nvp, char **buf, int* buflen)
 
   return 0;
 }
+
 /*
  * This function retrieves the value of the nvpair in the form of enumerated
  * type data_type_t.
  */
 static int
-nvpair_type(const char *nvp)
+nvpair_type (const char *nvp)
 {
   int name_len, type;
 
@@ -910,9 +916,10 @@ nvpair_type(const char *nvp)
 
   return type;
 }
+
 static int
-nvpair_value(const char *nvp,char **val,
-            grub_size_t *size_out, grub_size_t *nelm_out)
+nvpair_value (const char *nvp,char **val,
+             grub_size_t *size_out, grub_size_t *nelm_out)
 {
   int name_len,nelm,encode_size;