]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86/boot/edd.c
x86 setup: correct segfault in generation of 32-bit reloc kernel
[linux-2.6-omap-h63xx.git] / arch / x86 / boot / edd.c
index d84a48ece78503b10e8429981e44397b6755a454..d93cbc6464d0f8aa8aed3479b1b88a66993afa67 100644 (file)
@@ -126,17 +126,25 @@ void query_edd(void)
 {
        char eddarg[8];
        int do_mbr = 1;
+#ifdef CONFIG_EDD_OFF
+       int do_edd = 0;
+#else
        int do_edd = 1;
+#endif
        int be_quiet;
        int devno;
        struct edd_info ei, *edp;
        u32 *mbrptr;
 
        if (cmdline_find_option("edd", eddarg, sizeof eddarg) > 0) {
-               if (!strcmp(eddarg, "skipmbr") || !strcmp(eddarg, "skip"))
+               if (!strcmp(eddarg, "skipmbr") || !strcmp(eddarg, "skip")) {
+                       do_edd = 1;
                        do_mbr = 0;
+               }
                else if (!strcmp(eddarg, "off"))
                        do_edd = 0;
+               else if (!strcmp(eddarg, "on"))
+                       do_edd = 1;
        }
 
        be_quiet = cmdline_find_option_bool("quiet");
@@ -159,9 +167,8 @@ void query_edd(void)
                 * Scan the BIOS-supported hard disks and query EDD
                 * information...
                 */
-               get_edd_info(devno, &ei);
-
-               if (boot_params.eddbuf_entries < EDDMAXNR) {
+               if (!get_edd_info(devno, &ei)
+                   && boot_params.eddbuf_entries < EDDMAXNR) {
                        memcpy(edp, &ei, sizeof ei);
                        edp++;
                        boot_params.eddbuf_entries++;