]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2009-11-09 Robert Millan <rmh.grub@aybabtu.com>
authorRobert Millan <rmh@aybabtu.com>
Mon, 9 Nov 2009 14:45:28 +0000 (14:45 +0000)
committerRobert Millan <rmh@aybabtu.com>
Mon, 9 Nov 2009 14:45:28 +0000 (14:45 +0000)
        Misc cleanup.

        * kern/command.c (grub_register_command_prio): Use
        grub_zalloc() instead of explicitly zeroing data.
        * kern/list.c: Include `<grub/mm.h>'.
        (grub_named_list_find): Replace `0' with `NULL'.
        * normal/autofs.c (struct grub_fs_module_list): Remove ad-hoc type.
        (fs_module_list): Change type to `grub_named_list_t'.  Update all
        users.
        * normal/dyncmd.c (read_command_list): Add space between function
        call and parenthesis.
        * normal/handler.c (read_handler_list): Likewise.

ChangeLog
kern/command.c
kern/list.c
normal/autofs.c
normal/dyncmd.c
normal/handler.c

index a0d180f60f6bd691a76289d79e3835843a166f3b..ff6a8c6fd513534d5455813675fa29bc01f48d5c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2009-11-09  Robert Millan  <rmh.grub@aybabtu.com>
+
+       Misc cleanup.
+
+       * kern/command.c (grub_register_command_prio): Use
+       grub_zalloc() instead of explicitly zeroing data.
+       * kern/list.c: Include `<grub/mm.h>'.
+       (grub_named_list_find): Replace `0' with `NULL'.
+       * normal/autofs.c (struct grub_fs_module_list): Remove ad-hoc type.
+       (fs_module_list): Change type to `grub_named_list_t'.  Update all
+       users.
+       * normal/dyncmd.c (read_command_list): Add space between function
+       call and parenthesis.
+       * normal/handler.c (read_handler_list): Likewise.
+
 2009-11-09  Robert Millan  <rmh.grub@aybabtu.com>
 
        * normal/auth.c (punishment_delay): Moved from here ...
index 63b536eb766c67bd23f4c7b27140ca508d037a0d..9b3c92b9b4a3abec74cfd6c3a92f88cdd2f4c752 100644 (file)
@@ -31,7 +31,7 @@ grub_register_command_prio (const char *name,
 {
   grub_command_t cmd;
 
-  cmd = (grub_command_t) grub_malloc (sizeof (*cmd));
+  cmd = (grub_command_t) grub_zalloc (sizeof (*cmd));
   if (! cmd)
     return 0;
 
@@ -42,7 +42,6 @@ grub_register_command_prio (const char *name,
 
   cmd->flags = GRUB_COMMAND_FLAG_BOTH;
   cmd->prio = prio;
-  cmd->data = 0;
 
   grub_prio_list_insert (GRUB_AS_PRIO_LIST_P (&grub_command_list),
                         GRUB_AS_PRIO_LIST (cmd));
index b879f13207e91b56a51c997a85a1059bf91c596b..379b0d8863541bbd8d061482fdd0896c8d7a6994 100644 (file)
@@ -19,6 +19,7 @@
 
 #include <grub/list.h>
 #include <grub/misc.h>
+#include <grub/mm.h>
 
 void
 grub_list_push (grub_list_t *head, grub_list_t item)
@@ -81,7 +82,7 @@ grub_list_insert (grub_list_t *head, grub_list_t item,
 void *
 grub_named_list_find (grub_named_list_t head, const char *name)
 {
-  grub_named_list_t result = 0;
+  grub_named_list_t result = NULL;
 
   auto int list_find (grub_named_list_t item);
   int list_find (grub_named_list_t item)
index 39f2f9ddccc40c6aaae771903fd344168ff6adad..ce354a22c2151310f265ea7cf8b0b32ad782fcc0 100644 (file)
 #include <grub/normal.h>
 
 /* This is used to store the names of filesystem modules for auto-loading.  */
-struct grub_fs_module_list
-{
-  char *name;
-  struct grub_fs_module_list *next;
-};
-typedef struct grub_fs_module_list *grub_fs_module_list_t;
-
-static grub_fs_module_list_t fs_module_list = 0;
+static grub_named_list_t fs_module_list;
 
 /* The auto-loading hook for filesystems.  */
 static int
 autoload_fs_module (void)
 {
-  grub_fs_module_list_t p;
+  grub_named_list_t p;
 
-  while ((p = fs_module_list) != 0)
+  while ((p = fs_module_list) != NULL)
     {
       if (! grub_dl_get (p->name) && grub_dl_load (p->name))
        return 1;
@@ -84,7 +77,7 @@ read_fs_list (void)
                  char *buf;
                  char *p;
                  char *q;
-                 grub_fs_module_list_t fs_mod;
+                 grub_named_list_t fs_mod;
 
                  buf = grub_file_getline (file);
                  if (! buf)
index 154da61142545c63c0910c56562ad013b4a19787..84b7ff3b141c384fab200d0e25b832b0b3ae77d5 100644 (file)
@@ -84,7 +84,7 @@ read_command_list (void)
          if (file)
            {
              char *buf = 0;
-             for (;; grub_free(buf))
+             for (;; grub_free (buf))
                {
                  char *p, *name, *modname;
                  grub_command_t cmd;
index fe31478fef7ea3c83c21ea77c339cd346d42c0b8..5e9f8612c741ced6b076ac639f1753903213f0ad 100644 (file)
@@ -182,7 +182,7 @@ read_handler_list (void)
          if (file)
            {
              char *buf = 0;
-             for (;; grub_free(buf))
+             for (;; grub_free (buf))
                {
                  char *p;