bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Fixed compiler warning for kern/bootstrap.c


From: Shakthi Kannan
Subject: [PATCH] Fixed compiler warning for kern/bootstrap.c
Date: Tue, 11 Nov 2008 00:02:20 +0530

Hi,

Fixed compiler warnings for kern/bootstrap.c. Is it advisable to
replace #if 0...#endif construct with #ifndef NDEBUG...#endif? This
way, you can add -D NDEBUG to compiler options to prevent debug code
being compiled? Current patch uses #if 0...#endif.

2008-11-10  Shakthi Kannan <shakshurd@gmail.com>

        * kern/bootstrap.c (task_insert_send_right): Remove ipc_object_t
        type mask for ipc_port_t port. Put load_protect_text, boot_map,
        load_bootstrap_symbols under #if 0 constructs.
        (copy_bootstrap): Move user_map under #if 0 construct.

---
diff --git a/kern/bootstrap.c b/kern/bootstrap.c
index 235aa7b..afc3d88 100644
--- a/kern/bootstrap.c
+++ b/kern/bootstrap.c
@@ -90,7 +90,7 @@ task_insert_send_right(
                kern_return_t kr;

                kr = mach_port_insert_right(task->itk_space, name,
-                           (ipc_object_t)port, MACH_MSG_TYPE_PORT_SEND);
+                                           port, MACH_MSG_TYPE_PORT_SEND);
                if (kr == KERN_SUCCESS)
                        break;
                assert(kr == KERN_NAME_EXISTS);
@@ -357,15 +357,17 @@ static void get_compat_strings(char *flags_str,
char *root_str)
        *cp = '\0';
 }

-/*
- * Copy boot_data (executable) to the user portion of this task.
- */
-static boolean_t       load_protect_text = TRUE;
 #if MACH_KDB
                /* if set, fault in the text segment */
 static boolean_t       load_fault_in_text = TRUE;
 #endif

+/*
+ * Copy boot_data (executable) to the user portion of this task.
+ */
+#if 0
+static boolean_t       load_protect_text = TRUE;
+
 static vm_offset_t
 boot_map(
        void *          data,   /* private data */
@@ -383,7 +385,7 @@ static boolean_t load_bootstrap_symbols = TRUE;
 static boolean_t load_bootstrap_symbols = FALSE;
 #endif

-
+#endif

 static int
 boot_read(void *handle, vm_offset_t file_ofs, void *buf, vm_size_t size,
@@ -450,7 +452,6 @@ read_exec(void *handle, vm_offset_t file_ofs,
vm_size_t file_size,

 static void copy_bootstrap(void *e, exec_info_t *boot_exec_info)
 {
-       register vm_map_t       user_map = current_task()->map;
        int err;

        if ((err = exec_load(boot_read, read_exec, e, boot_exec_info)))
@@ -462,15 +463,14 @@ static void copy_bootstrap(void *e, exec_info_t
*boot_exec_info)
         */

 #if 0 /*XXX*/
+       register vm_map_t       user_map = current_task()->map;
        if (load_bootstrap_symbols)
        (void) X_db_sym_init(
                (char*) boot_start+lp->sym_offset,
                (char*) boot_start+lp->sym_offset+lp->sym_size,
                "bootstrap",
                (char *) user_map);
-#endif

-#if 0 /*XXX*/
        if (load_fault_in_text)
          {
            vm_offset_t lenp = round_page(lp->text_start+lp->text_size) -
-- 
1.5.6




reply via email to

[Prev in Thread] Current Thread [Next in Thread]