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

[Xen-changelog] [xen-unstable] hvmloader: Formatting cleanups.



# HG changeset patch
# User Keir Fraser <keir@xxxxxxx>
# Date 1311599381 -3600
# Node ID 3244ff483d615f4ab1d938a240052154c13a62f8
# Parent  360b31a5263cf60081cd6dd41c1c7858fcaccbc6
hvmloader: Formatting cleanups.

Signed-off-by: Keir Fraser <keir@xxxxxxx>
---


diff -r 360b31a5263c -r 3244ff483d61 tools/firmware/hvmloader/e820.c
--- a/tools/firmware/hvmloader/e820.c   Mon Jul 25 13:57:49 2011 +0100
+++ b/tools/firmware/hvmloader/e820.c   Mon Jul 25 14:09:41 2011 +0100
@@ -91,7 +91,8 @@
 
     ASSERT ( bios_image_base < 0x100000 );
 
-    if ( lowmem_reserved_base < ACPI_INFO_PHYSICAL_ADDRESS ) {
+    if ( lowmem_reserved_base < ACPI_INFO_PHYSICAL_ADDRESS )
+    {
         /*
          * 0x0-lowmem_reserved_base: Ordinary RAM.
          */
diff -r 360b31a5263c -r 3244ff483d61 tools/firmware/hvmloader/hvmloader.c
--- a/tools/firmware/hvmloader/hvmloader.c      Mon Jul 25 13:57:49 2011 +0100
+++ b/tools/firmware/hvmloader/hvmloader.c      Mon Jul 25 14:09:41 2011 +0100
@@ -408,23 +408,24 @@
 
     perform_tests();
 
-    if (bios->bios_info_setup)
+    if ( bios->bios_info_setup )
         bios->bios_info_setup();
 
-    if (bios->create_smbios_tables) {
+    if ( bios->create_smbios_tables )
+    {
         printf("Writing SMBIOS tables ...\n");
         bios->create_smbios_tables();
     }
 
-    if (bios->bios_load) {
+    printf("Loading %s ...\n", bios->name);
+    if ( bios->bios_load )
         bios->bios_load(bios);
-    } else {
-        printf("Loading %s ...\n", bios->name);
+    else
         memcpy((void *)bios->bios_address, bios->image,
                bios->image_size);
-    }
 
-    if ( (hvm_info->nr_vcpus > 1) || hvm_info->apic_mode ) {
+    if ( (hvm_info->nr_vcpus > 1) || hvm_info->apic_mode )
+    {
         if ( bios->create_mp_tables )
             bios->create_mp_tables();
         if ( bios->create_pir_tables )
@@ -476,14 +477,16 @@
             .value = 1,
         };
 
-        if ( bios->acpi_build_tables ) {
+        if ( bios->acpi_build_tables )
+        {
             printf("Loading ACPI ...\n");
             bios->acpi_build_tables();
         }
+
         hypercall_hvm_op(HVMOP_set_param, &p);
     }
 
-    if (bios->vm86_setup)
+    if ( bios->vm86_setup )
         bios->vm86_setup();
 
     cmos_write_memory_size();
@@ -508,10 +511,10 @@
            bios->bios_address,
            bios->bios_address + bios->image_size - 1);
 
-    if (bios->e820_setup)
+    if ( bios->e820_setup )
         bios->e820_setup();
 
-    if (bios->bios_info_finish)
+    if ( bios->bios_info_finish )
         bios->bios_info_finish();
 
     xenbus_shutdown();
diff -r 360b31a5263c -r 3244ff483d61 tools/firmware/hvmloader/mp_tables.c
--- a/tools/firmware/hvmloader/mp_tables.c      Mon Jul 25 13:57:49 2011 +0100
+++ b/tools/firmware/hvmloader/mp_tables.c      Mon Jul 25 14:09:41 2011 +0100
@@ -211,7 +211,8 @@
 
 
 /* fills in an MP bus entry of type 'type' and bus ID 'bus_id' */
-static void fill_mp_bus_entry(struct mp_bus_entry *mpbe, int bus_id, const 
char *type)
+static void fill_mp_bus_entry(
+    struct mp_bus_entry *mpbe, int bus_id, const char *type)
 {
     int i;
 
@@ -272,7 +273,8 @@
 
     printf("Creating MP tables ...\n");
 
-    if (!_mpfps) {
+    if ( _mpfps == NULL )
+    {
         int sz;
 
         sz  = sizeof(struct mp_floating_pointer_struct);
@@ -282,7 +284,7 @@
         sz += sizeof(struct mp_ioapic_entry);
         sz += sizeof(struct mp_io_intr_entry) * 16;
 
-        base = mem_alloc(sz, 0);
+        _mpfps = mem_alloc(sz, 0);
     }
 
     mpfps = _mpfps;
diff -r 360b31a5263c -r 3244ff483d61 tools/firmware/hvmloader/pir.c
--- a/tools/firmware/hvmloader/pir.c    Mon Jul 25 13:57:49 2011 +0100
+++ b/tools/firmware/hvmloader/pir.c    Mon Jul 25 14:09:41 2011 +0100
@@ -23,7 +23,8 @@
  */
 unsigned long create_pir_tables(void)
 {
-    int length = sizeof(struct pir_table) + sizeof(struct 
pir_slot)*NR_PIR_SLOTS;
+    int length = sizeof(struct pir_table)
+        + sizeof(struct pir_slot) * NR_PIR_SLOTS;
     struct pir_table *pir = scratch_alloc(length, 0);
     int i, checksum;
 
@@ -57,10 +58,8 @@
     }
 
     checksum = 0;
-    for ( i = 0; i < length; i++)
-    {
+    for ( i = 0; i < length; i++ )
         checksum += ((int8_t *)pir)[i];
-    }
     pir->checksum = -checksum;
 
     return (unsigned long)pir;
diff -r 360b31a5263c -r 3244ff483d61 tools/firmware/hvmloader/rombios.c
--- a/tools/firmware/hvmloader/rombios.c        Mon Jul 25 13:57:49 2011 +0100
+++ b/tools/firmware/hvmloader/rombios.c        Mon Jul 25 14:09:41 2011 +0100
@@ -86,7 +86,6 @@
     uint32_t bioshigh;
     struct rombios_info *info;
 
-    printf("Loading %s ...\n", config->name);
     memcpy((void *)config->bios_address, config->image,
            config->image_size);
 
@@ -110,7 +109,7 @@
           bios_mem != (char *)ROMBIOS_END;
           bios_mem++ )
     {
-        if ( strncmp(bios_mem, "___HVMMP", 8) == 0)
+        if ( strncmp(bios_mem, "___HVMMP", 8) == 0 )
             return bios_mem;
     }
 
@@ -124,7 +123,7 @@
     uint8_t checksum;
 
     checksum = 0;
-    for (i = 0; i < ROMBIOS_MAXOFFSET; ++i)
+    for ( i = 0; i < ROMBIOS_MAXOFFSET; i++ )
         checksum += ((uint8_t *)(ROMBIOS_BEGIN))[i];
 
     *((uint8_t *)(ROMBIOS_BEGIN + ROMBIOS_MAXOFFSET)) = -checksum;
@@ -153,9 +152,10 @@
 
 static void rombios_create_smbios_tables(void)
 {
-    hvm_write_smbios_tables(SMBIOS_PHYSICAL_ADDRESS,
-                            SMBIOS_PHYSICAL_ADDRESS + sizeof(struct 
smbios_entry_point),
-                            SMBIOS_PHYSICAL_END);
+    hvm_write_smbios_tables(
+        SMBIOS_PHYSICAL_ADDRESS,
+        SMBIOS_PHYSICAL_ADDRESS + sizeof(struct smbios_entry_point),
+        SMBIOS_PHYSICAL_END);
 }
 
 //BUILD_BUG_ON(sizeof(rombios) > (0x00100000U - ROMBIOS_PHYSICAL_ADDRESS));
diff -r 360b31a5263c -r 3244ff483d61 tools/firmware/hvmloader/seabios.c
--- a/tools/firmware/hvmloader/seabios.c        Mon Jul 25 13:57:49 2011 +0100
+++ b/tools/firmware/hvmloader/seabios.c        Mon Jul 25 14:09:41 2011 +0100
@@ -71,7 +71,7 @@
     uint8_t checksum;
 
     checksum = 0;
-    for (i = 0; i < info->length; ++i)
+    for ( i = 0; i < info->length; i++ )
         checksum += ((uint8_t *)(info))[i];
 
     info->checksum = -checksum;
diff -r 360b31a5263c -r 3244ff483d61 tools/firmware/hvmloader/smbios.c
--- a/tools/firmware/hvmloader/smbios.c Mon Jul 25 13:57:49 2011 +0100
+++ b/tools/firmware/hvmloader/smbios.c Mon Jul 25 14:09:41 2011 +0100
@@ -77,9 +77,9 @@
     cpuid(0, &eax, (uint32_t *)&id[0], (uint32_t *)&id[8],
           (uint32_t *)&id[4]);
 
-    if (memcmp(id, "GenuineIntel", 12) == 0)
+    if ( memcmp(id, "GenuineIntel", 12) == 0 )
         strncpy(buf, "Intel", len);
-    else if (memcmp(id, "AuthenticAMD", 12) == 0)
+    else if ( memcmp(id, "AuthenticAMD", 12) == 0 )
         strncpy(buf, "AMD", len);
     else
         strncpy(buf, "unknown", len);
@@ -158,7 +158,8 @@
 }
 
 void
-hvm_write_smbios_tables(unsigned long ep, unsigned long smbios_start, unsigned 
long smbios_end)
+hvm_write_smbios_tables(
+    unsigned long ep, unsigned long smbios_start, unsigned long smbios_end)
 {
     xen_domain_handle_t uuid;
     uint16_t xen_major_version, xen_minor_version;
@@ -232,7 +233,8 @@
 
     memcpy((void *)smbios_start, (void *)scratch_start, len);
 
-    smbios_entry_point_init((void *)ep, max_struct_size, len, smbios_start, 
nr_structs);
+    smbios_entry_point_init(
+        (void *)ep, max_struct_size, len, smbios_start, nr_structs);
 
     return;
 
@@ -313,12 +315,14 @@
     p->embedded_controller_minor = 0xff;
 
     start += sizeof(struct smbios_type_0);
-    if ((s = xenstore_read("bios-strings/bios-vendor")) == NULL || *s == '\0')
+    if ( ((s = xenstore_read("bios-strings/bios-vendor")) == NULL)
+         || (*s == '\0') )
         s = "Xen";
     strcpy((char *)start, s);
     start += strlen(s) + 1;
 
-    if ((s = xenstore_read("bios-strings/bios-version")) == NULL || *s == '\0')
+    if ( ((s = xenstore_read("bios-strings/bios-version")) == NULL)
+         || (*s == '\0') )
         s = xen_version;
     strcpy((char *)start, s);
     start += strlen(s) + 1;
@@ -358,27 +362,27 @@
 
     start += sizeof(struct smbios_type_1);
     
-    if ((s = xenstore_read("bios-strings/system-manufacturer")) == NULL  
-        || *s == '\0')
+    if ( ((s = xenstore_read("bios-strings/system-manufacturer")) == NULL)
+         || (*s == '\0') )
         s = "Xen";
     strcpy((char *)start, s);
     start += strlen(s) + 1;
 
-    if ((s = xenstore_read("bios-strings/system-product-name")) == NULL
-         || *s == '\0')
+    if ( ((s = xenstore_read("bios-strings/system-product-name")) == NULL)
+         || (*s == '\0') )
         s = "HVM domU";
     strcpy((char *)start, s);
     start += strlen(s) + 1;
 
-    if ((s = xenstore_read("bios-strings/system-version")) == NULL
-        || *s == '\0')
+    if ( ((s = xenstore_read("bios-strings/system-version")) == NULL)
+         || (*s == '\0') )
         s = xen_version;
     strcpy((char *)start, s);
     start += strlen(s) + 1;
 
     uuid_to_string(uuid_str, uuid); 
-    if ((s = xenstore_read("bios-strings/system-serial-number")) == NULL
-        || *s == '\0')
+    if ( ((s = xenstore_read("bios-strings/system-serial-number")) == NULL)
+         || (*s == '\0') )
         s = uuid_str;
     strcpy((char *)start, s);
     start += strlen(s) + 1;
@@ -486,10 +490,11 @@
     start += sizeof(struct smbios_type_11);
 
     /* Pull out as many oem-* strings we find in xenstore */
-    for (i = 1; i < 100; i++) {
+    for ( i = 1; i < 100; i++ )
+    {
         path[(sizeof path) - 3] = '0' + ((i < 10) ? i : i / 10);
         path[(sizeof path) - 2] = (i < 10) ? '\0' : '0' + (i % 10);
-        if ((s = xenstore_read(path)) == NULL || *s == '\0')
+        if ( ((s = xenstore_read(path)) == NULL) || (*s == '\0') )
             break;
         strcpy((char *)start, s);
         start += strlen(s) + 1;
@@ -497,7 +502,8 @@
     }
     
     /* Make sure there's at least one type-11 string */
-    if (p->count == 0) {
+    if ( p->count == 0 )
+    {
         strcpy((char *)start, "Xen");
         start += strlen("Xen") + 1;
         p->count++;
diff -r 360b31a5263c -r 3244ff483d61 tools/firmware/hvmloader/util.h
--- a/tools/firmware/hvmloader/util.h   Mon Jul 25 13:57:49 2011 +0100
+++ b/tools/firmware/hvmloader/util.h   Mon Jul 25 14:09:41 2011 +0100
@@ -199,9 +199,8 @@
 /* Miscellaneous. */
 void cacheattr_init(void);
 unsigned long create_mp_tables(void *table);
-void hvm_write_smbios_tables(unsigned long ep,
-                             unsigned long smbios_start,
-                             unsigned long smbios_end);
+void hvm_write_smbios_tables(
+    unsigned long ep, unsigned long smbios_start, unsigned long smbios_end);
 unsigned long create_pir_tables(void);
 
 void smp_initialise(void);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.