]> git.proxmox.com Git - grub2.git/commitdiff
Make list_push and list_remove functions rather than inline functions
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Wed, 22 Feb 2012 04:01:20 +0000 (05:01 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Wed, 22 Feb 2012 04:01:20 +0000 (05:01 +0100)
to decrease size and avoid aliasing violations.

* include/grub/list.h (grub_list_push): Move to ...
* grub-core/kern/list.c (grub_list_push): ... here. Don't inline.
* include/grub/list.h (grub_list_remove): Move to ...
* grub-core/kern/list.c (grub_list_remove): ... here. Don't inline.

ChangeLog
grub-core/kern/list.c
include/grub/list.h

index 2429f2da1152b12d4c154744fd331048d03ade29..3347d73e0ffeffcf0a95da3cf83136737e0616a4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2012-02-22  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       Make list_push and list_remove functions rather than inline functions
+       to decrease size and avoid aliasing violations.
+
+       * include/grub/list.h (grub_list_push): Move to ...
+       * grub-core/kern/list.c (grub_list_push): ... here. Don't inline.
+       * include/grub/list.h (grub_list_remove): Move to ...
+       * grub-core/kern/list.c (grub_list_remove): ... here. Don't inline.
+
 2012-02-22  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * configure.ac: Disable for now -Wstack-protector, -Wunreachable-code
index f7c4e6bbe3b59242dd28562228b9e88792a7268f..78005db1ecfd1f92df1897859f7f9fb87386c44a 100644 (file)
@@ -68,3 +68,24 @@ grub_prio_list_insert (grub_prio_list_t *head, grub_prio_list_t nitem)
   if (! inactive)
     nitem->prio |= GRUB_PRIO_LIST_FLAG_ACTIVE;
 }
+
+void
+grub_list_push (grub_list_t *head, grub_list_t item)
+{
+  item->prev = head;
+  if (*head)
+    (*head)->prev = &item->next;
+  item->next = *head;
+  *head = item;
+}
+
+void
+grub_list_remove (grub_list_t item)
+{
+  if (item->prev)
+    *item->prev = item->next;
+  if (item->next)
+    item->next->prev = item->prev;
+  item->next = 0;
+  item->prev = 0;
+}
index 54f528a054cc10b11b862c609789033bec096cbf..63f45c2074297533e66ba0ca9c2158d2dd523c6b 100644 (file)
@@ -31,26 +31,8 @@ struct grub_list
 };
 typedef struct grub_list *grub_list_t;
 
-static inline void
-grub_list_push (grub_list_t *head, grub_list_t item)
-{
-  item->prev = head;
-  if (*head)
-    (*head)->prev = &item->next;
-  item->next = *head;
-  *head = item;
-}
-
-static inline void
-grub_list_remove (grub_list_t item)
-{
-  if (item->prev)
-    *item->prev = item->next;
-  if (item->next)
-    item->next->prev = item->prev;
-  item->next = 0;
-  item->prev = 0;
-}
+void EXPORT_FUNC(grub_list_push) (grub_list_t *head, grub_list_t item);
+void EXPORT_FUNC(grub_list_remove) (grub_list_t item);
 
 #define FOR_LIST_ELEMENTS(var, list) for ((var) = (list); (var); (var) = (var)->next)