Formatting .c/.h files and fix memory leakage issues
Signed-off-by: John Chung <john.chung@arm.com>
Change-Id: Id8328f412c2724992d80c0b3f895c8f85bc4ae68
diff --git a/generator/sections/gen-section-pci-bus.c b/generator/sections/gen-section-pci-bus.c
index 1aee19a..c814069 100644
--- a/generator/sections/gen-section-pci-bus.c
+++ b/generator/sections/gen-section-pci-bus.c
@@ -11,28 +11,28 @@
//Generates a single pseudo-random PCI/PCI-X bus error section, saving the resulting address to the given
//location. Returns the size of the newly created section.
-size_t generate_section_pci_bus(void** location)
+size_t generate_section_pci_bus(void **location)
{
- //Create random bytes.
- int size = 72;
- UINT8* bytes = generate_random_bytes(size);
-
- //Set reserved areas to zero.
- UINT64* validation = (UINT64*)bytes;
- *validation &= 0x1FF; //Validation 9-63
- UINT32* reserved = (UINT32*)(bytes + 20);
- *reserved = 0;
- UINT64* bus_command = (UINT64*)(bytes + 40);
- *bus_command &= ((UINT64)0b1 << 56); //Bus command bytes bar bit 56.
+ //Create random bytes.
+ int size = 72;
+ UINT8 *bytes = generate_random_bytes(size);
- //Fix values that could be above range.
- UINT16* error_type = (UINT16*)(bytes + 16);
- *error_type = rand() % 8;
+ //Set reserved areas to zero.
+ UINT64 *validation = (UINT64 *)bytes;
+ *validation &= 0x1FF; //Validation 9-63
+ UINT32 *reserved = (UINT32 *)(bytes + 20);
+ *reserved = 0;
+ UINT64 *bus_command = (UINT64 *)(bytes + 40);
+ *bus_command &= ((UINT64)0x1 << 56); //Bus command bytes bar bit 56.
- //Fix error status.
- create_valid_error_section(bytes + 8);
+ //Fix values that could be above range.
+ UINT16 *error_type = (UINT16 *)(bytes + 16);
+ *error_type = rand() % 8;
- //Set return values, exit.
- *location = bytes;
- return size;
-}
\ No newline at end of file
+ //Fix error status.
+ create_valid_error_section(bytes + 8);
+
+ //Set return values, exit.
+ *location = bytes;
+ return size;
+}