diff --git a/sections/cper-section-cxl-protocol.c b/sections/cper-section-cxl-protocol.c
index b3334a3..43c9dd0 100644
--- a/sections/cper-section-cxl-protocol.c
+++ b/sections/cper-section-cxl-protocol.c
@@ -13,172 +13,231 @@
 #include "cper-section-cxl-protocol.h"
 
 //Converts a single CXL protocol error CPER section into JSON IR.
-json_object* cper_section_cxl_protocol_to_ir(void* section, EFI_ERROR_SECTION_DESCRIPTOR* descriptor)
+json_object *
+cper_section_cxl_protocol_to_ir(void *section,
+				EFI_ERROR_SECTION_DESCRIPTOR *descriptor)
 {
-    EFI_CXL_PROTOCOL_ERROR_DATA* cxl_protocol_error = (EFI_CXL_PROTOCOL_ERROR_DATA*)section;
-    json_object* section_ir = json_object_new_object();
+	EFI_CXL_PROTOCOL_ERROR_DATA *cxl_protocol_error =
+		(EFI_CXL_PROTOCOL_ERROR_DATA *)section;
+	json_object *section_ir = json_object_new_object();
 
-    //Validation bits.
-    json_object* validation = bitfield_to_ir(cxl_protocol_error->ValidBits, 7, CXL_PROTOCOL_ERROR_VALID_BITFIELD_NAMES);
-    json_object_object_add(section_ir, "validationBits", validation);
+	//Validation bits.
+	json_object *validation =
+		bitfield_to_ir(cxl_protocol_error->ValidBits, 7,
+			       CXL_PROTOCOL_ERROR_VALID_BITFIELD_NAMES);
+	json_object_object_add(section_ir, "validationBits", validation);
 
-    //Type of detecting agent.
-    json_object* agent_type = integer_to_readable_pair(cxl_protocol_error->CxlAgentType, 2,
-        CXL_PROTOCOL_ERROR_AGENT_TYPES_KEYS,
-        CXL_PROTOCOL_ERROR_AGENT_TYPES_VALUES,
-        "Unknown (Reserved)");
-    json_object_object_add(section_ir, "agentType", agent_type);
+	//Type of detecting agent.
+	json_object *agent_type = integer_to_readable_pair(
+		cxl_protocol_error->CxlAgentType, 2,
+		CXL_PROTOCOL_ERROR_AGENT_TYPES_KEYS,
+		CXL_PROTOCOL_ERROR_AGENT_TYPES_VALUES, "Unknown (Reserved)");
+	json_object_object_add(section_ir, "agentType", agent_type);
 
-    //CXL agent address, depending on the agent type.
-    json_object* agent_address = json_object_new_object();
-    if (cxl_protocol_error->CxlAgentType == CXL_PROTOCOL_ERROR_DEVICE_AGENT)
-    {
-        //Address is a CXL1.1 device agent.
-        json_object_object_add(agent_address, "functionNumber", 
-            json_object_new_uint64(cxl_protocol_error->CxlAgentAddress.DeviceAddress.FunctionNumber));
-        json_object_object_add(agent_address, "deviceNumber", 
-            json_object_new_uint64(cxl_protocol_error->CxlAgentAddress.DeviceAddress.DeviceNumber));
-        json_object_object_add(agent_address, "busNumber", 
-            json_object_new_uint64(cxl_protocol_error->CxlAgentAddress.DeviceAddress.BusNumber));
-        json_object_object_add(agent_address, "segmentNumber", 
-            json_object_new_uint64(cxl_protocol_error->CxlAgentAddress.DeviceAddress.SegmentNumber));
-    }
-    else if (cxl_protocol_error->CxlAgentType == CXL_PROTOCOL_ERROR_HOST_DOWNSTREAM_PORT_AGENT)
-    {
-        //Address is a CXL port RCRB base address.
-        json_object_object_add(agent_address, "value", 
-            json_object_new_uint64(cxl_protocol_error->CxlAgentAddress.PortRcrbBaseAddress));
-    }
-    json_object_object_add(section_ir, "cxlAgentAddress", agent_address);
+	//CXL agent address, depending on the agent type.
+	json_object *agent_address = json_object_new_object();
+	if (cxl_protocol_error->CxlAgentType ==
+	    CXL_PROTOCOL_ERROR_DEVICE_AGENT) {
+		//Address is a CXL1.1 device agent.
+		json_object_object_add(
+			agent_address, "functionNumber",
+			json_object_new_uint64(
+				cxl_protocol_error->CxlAgentAddress
+					.DeviceAddress.FunctionNumber));
+		json_object_object_add(
+			agent_address, "deviceNumber",
+			json_object_new_uint64(
+				cxl_protocol_error->CxlAgentAddress
+					.DeviceAddress.DeviceNumber));
+		json_object_object_add(
+			agent_address, "busNumber",
+			json_object_new_uint64(
+				cxl_protocol_error->CxlAgentAddress
+					.DeviceAddress.BusNumber));
+		json_object_object_add(
+			agent_address, "segmentNumber",
+			json_object_new_uint64(
+				cxl_protocol_error->CxlAgentAddress
+					.DeviceAddress.SegmentNumber));
+	} else if (cxl_protocol_error->CxlAgentType ==
+		   CXL_PROTOCOL_ERROR_HOST_DOWNSTREAM_PORT_AGENT) {
+		//Address is a CXL port RCRB base address.
+		json_object_object_add(
+			agent_address, "value",
+			json_object_new_uint64(
+				cxl_protocol_error->CxlAgentAddress
+					.PortRcrbBaseAddress));
+	}
+	json_object_object_add(section_ir, "cxlAgentAddress", agent_address);
 
-    //Device ID.
-    json_object* device_id = json_object_new_object();
-    json_object_object_add(device_id, "vendorID", 
-        json_object_new_uint64(cxl_protocol_error->DeviceId.VendorId));
-    json_object_object_add(device_id, "deviceID", 
-        json_object_new_uint64(cxl_protocol_error->DeviceId.DeviceId));
-    json_object_object_add(device_id, "subsystemVendorID", 
-        json_object_new_uint64(cxl_protocol_error->DeviceId.SubsystemVendorId));
-    json_object_object_add(device_id, "subsystemDeviceID", 
-        json_object_new_uint64(cxl_protocol_error->DeviceId.SubsystemDeviceId));
-    json_object_object_add(device_id, "classCode", 
-        json_object_new_uint64(cxl_protocol_error->DeviceId.ClassCode));
-    json_object_object_add(device_id, "slotNumber", 
-        json_object_new_uint64(cxl_protocol_error->DeviceId.SlotNumber));
-    json_object_object_add(section_ir, "deviceID", device_id);
+	//Device ID.
+	json_object *device_id = json_object_new_object();
+	json_object_object_add(
+		device_id, "vendorID",
+		json_object_new_uint64(cxl_protocol_error->DeviceId.VendorId));
+	json_object_object_add(
+		device_id, "deviceID",
+		json_object_new_uint64(cxl_protocol_error->DeviceId.DeviceId));
+	json_object_object_add(
+		device_id, "subsystemVendorID",
+		json_object_new_uint64(
+			cxl_protocol_error->DeviceId.SubsystemVendorId));
+	json_object_object_add(
+		device_id, "subsystemDeviceID",
+		json_object_new_uint64(
+			cxl_protocol_error->DeviceId.SubsystemDeviceId));
+	json_object_object_add(
+		device_id, "classCode",
+		json_object_new_uint64(cxl_protocol_error->DeviceId.ClassCode));
+	json_object_object_add(
+		device_id, "slotNumber",
+		json_object_new_uint64(
+			cxl_protocol_error->DeviceId.SlotNumber));
+	json_object_object_add(section_ir, "deviceID", device_id);
 
-    //Device serial & capability structure (if CXL 1.1 device).
-    if (cxl_protocol_error->CxlAgentType == CXL_PROTOCOL_ERROR_DEVICE_AGENT)
-    {
-        json_object_object_add(section_ir, "deviceSerial", json_object_new_uint64(cxl_protocol_error->DeviceSerial));
+	//Device serial & capability structure (if CXL 1.1 device).
+	if (cxl_protocol_error->CxlAgentType ==
+	    CXL_PROTOCOL_ERROR_DEVICE_AGENT) {
+		json_object_object_add(
+			section_ir, "deviceSerial",
+			json_object_new_uint64(
+				cxl_protocol_error->DeviceSerial));
 
-        //The PCIe capability structure provided here could either be PCIe 1.1 Capability Structure 
-        //(36-byte, padded to 60 bytes) or PCIe 2.0 Capability Structure (60-byte). There does not seem
-        //to be a way to differentiate these, so this is left as a b64 dump.
-        char* encoded = b64_encode(cxl_protocol_error->CapabilityStructure.PcieCap, 60);
-        json_object_object_add(section_ir, "capabilityStructure", json_object_new_string(encoded));
-        free(encoded);
-    }
+		//The PCIe capability structure provided here could either be PCIe 1.1 Capability Structure
+		//(36-byte, padded to 60 bytes) or PCIe 2.0 Capability Structure (60-byte). There does not seem
+		//to be a way to differentiate these, so this is left as a b64 dump.
+		char *encoded = b64_encode(
+			cxl_protocol_error->CapabilityStructure.PcieCap, 60);
+		json_object_object_add(section_ir, "capabilityStructure",
+				       json_object_new_string(encoded));
+		free(encoded);
+	}
 
-    //CXL DVSEC & error log length.
-    json_object_object_add(section_ir, "dvsecLength", json_object_new_int(cxl_protocol_error->CxlDvsecLength));
-    json_object_object_add(section_ir, "errorLogLength", json_object_new_int(cxl_protocol_error->CxlErrorLogLength));
+	//CXL DVSEC & error log length.
+	json_object_object_add(
+		section_ir, "dvsecLength",
+		json_object_new_int(cxl_protocol_error->CxlDvsecLength));
+	json_object_object_add(
+		section_ir, "errorLogLength",
+		json_object_new_int(cxl_protocol_error->CxlErrorLogLength));
 
-    //CXL DVSEC
-    //For CXL 1.1 devices, this is the "CXL DVSEC For Flex Bus Device" structure as in CXL 1.1 spec.
-    //For CXL 1.1 host downstream ports, this is the "CXL DVSEC For Flex Bus Port" structure as in CXL 1.1 spec.
-    unsigned char* cur_pos = (unsigned char*)(cxl_protocol_error + 1);
-    char* encoded = b64_encode(cur_pos, cxl_protocol_error->CxlDvsecLength);
-    json_object_object_add(section_ir, "cxlDVSEC", json_object_new_string(encoded));
-    free(encoded);
-    cur_pos += cxl_protocol_error->CxlDvsecLength;
+	//CXL DVSEC
+	//For CXL 1.1 devices, this is the "CXL DVSEC For Flex Bus Device" structure as in CXL 1.1 spec.
+	//For CXL 1.1 host downstream ports, this is the "CXL DVSEC For Flex Bus Port" structure as in CXL 1.1 spec.
+	unsigned char *cur_pos = (unsigned char *)(cxl_protocol_error + 1);
+	char *encoded = b64_encode(cur_pos, cxl_protocol_error->CxlDvsecLength);
+	json_object_object_add(section_ir, "cxlDVSEC",
+			       json_object_new_string(encoded));
+	free(encoded);
+	cur_pos += cxl_protocol_error->CxlDvsecLength;
 
-    //CXL Error Log
-    //This is the "CXL RAS Capability Structure" as in CXL 1.1 spec.
-    encoded = b64_encode(cur_pos, cxl_protocol_error->CxlErrorLogLength);
-    json_object_object_add(section_ir, "cxlErrorLog", json_object_new_string(encoded));
-    free(encoded);
-    
-    return section_ir;
+	//CXL Error Log
+	//This is the "CXL RAS Capability Structure" as in CXL 1.1 spec.
+	encoded = b64_encode(cur_pos, cxl_protocol_error->CxlErrorLogLength);
+	json_object_object_add(section_ir, "cxlErrorLog",
+			       json_object_new_string(encoded));
+	free(encoded);
+
+	return section_ir;
 }
 
 //Converts a single CXL protocol CPER-JSON section into CPER binary, outputting to the given stream.
-void ir_section_cxl_protocol_to_cper(json_object* section, FILE* out)
+void ir_section_cxl_protocol_to_cper(json_object *section, FILE *out)
 {
-    EFI_CXL_PROTOCOL_ERROR_DATA* section_cper =
-        (EFI_CXL_PROTOCOL_ERROR_DATA*)calloc(1, sizeof(EFI_CXL_PROTOCOL_ERROR_DATA));
-        
-    //Validation bits.
-    section_cper->ValidBits = ir_to_bitfield(json_object_object_get(section, "validationBits"), 
-        7, CXL_PROTOCOL_ERROR_VALID_BITFIELD_NAMES);
+	EFI_CXL_PROTOCOL_ERROR_DATA *section_cper =
+		(EFI_CXL_PROTOCOL_ERROR_DATA *)calloc(
+			1, sizeof(EFI_CXL_PROTOCOL_ERROR_DATA));
 
-    //Detecting agent type.
-    section_cper->CxlAgentType = readable_pair_to_integer(json_object_object_get(section, "agentType"));
+	//Validation bits.
+	section_cper->ValidBits = ir_to_bitfield(
+		json_object_object_get(section, "validationBits"), 7,
+		CXL_PROTOCOL_ERROR_VALID_BITFIELD_NAMES);
 
-    //Based on the agent type, set the address.
-    json_object* address = json_object_object_get(section, "cxlAgentAddress");
-    if (section_cper->CxlAgentType == CXL_PROTOCOL_ERROR_DEVICE_AGENT)
-    {
-        //Address is split by function, device, bus & segment.
-        UINT64 function = json_object_get_uint64(json_object_object_get(address, "functionNumber"));
-        UINT64 device = json_object_get_uint64(json_object_object_get(address, "deviceNumber"));
-        UINT64 bus = json_object_get_uint64(json_object_object_get(address, "busNumber"));
-        UINT64 segment = json_object_get_uint64(json_object_object_get(address, "segmentNumber"));
-        section_cper->CxlAgentAddress.DeviceAddress.FunctionNumber = function;
-        section_cper->CxlAgentAddress.DeviceAddress.DeviceNumber = device;
-        section_cper->CxlAgentAddress.DeviceAddress.BusNumber = bus;
-        section_cper->CxlAgentAddress.DeviceAddress.SegmentNumber = segment;
-    }
-    else if (section_cper->CxlAgentType == CXL_PROTOCOL_ERROR_HOST_DOWNSTREAM_PORT_AGENT)
-    {
-        //Plain RCRB base address.
-        section_cper->CxlAgentAddress.PortRcrbBaseAddress = 
-            json_object_get_uint64(json_object_object_get(address, "value"));
-    }
+	//Detecting agent type.
+	section_cper->CxlAgentType = readable_pair_to_integer(
+		json_object_object_get(section, "agentType"));
 
-    //Device ID information.
-    json_object* device_id = json_object_object_get(section, "deviceID");
-    section_cper->DeviceId.VendorId = json_object_get_uint64(json_object_object_get(device_id, "vendorID"));
-    section_cper->DeviceId.DeviceId = json_object_get_uint64(json_object_object_get(device_id, "deviceID"));
-    section_cper->DeviceId.SubsystemVendorId = 
-        json_object_get_uint64(json_object_object_get(device_id, "subsystemVendorID"));
-    section_cper->DeviceId.SubsystemDeviceId = 
-        json_object_get_uint64(json_object_object_get(device_id, "subsystemDeviceID"));
-    section_cper->DeviceId.ClassCode = json_object_get_uint64(json_object_object_get(device_id, "classCode"));
-    section_cper->DeviceId.SlotNumber = json_object_get_uint64(json_object_object_get(device_id, "slotNumber"));
+	//Based on the agent type, set the address.
+	json_object *address =
+		json_object_object_get(section, "cxlAgentAddress");
+	if (section_cper->CxlAgentType == CXL_PROTOCOL_ERROR_DEVICE_AGENT) {
+		//Address is split by function, device, bus & segment.
+		UINT64 function = json_object_get_uint64(
+			json_object_object_get(address, "functionNumber"));
+		UINT64 device = json_object_get_uint64(
+			json_object_object_get(address, "deviceNumber"));
+		UINT64 bus = json_object_get_uint64(
+			json_object_object_get(address, "busNumber"));
+		UINT64 segment = json_object_get_uint64(
+			json_object_object_get(address, "segmentNumber"));
+		section_cper->CxlAgentAddress.DeviceAddress.FunctionNumber =
+			function;
+		section_cper->CxlAgentAddress.DeviceAddress.DeviceNumber =
+			device;
+		section_cper->CxlAgentAddress.DeviceAddress.BusNumber = bus;
+		section_cper->CxlAgentAddress.DeviceAddress.SegmentNumber =
+			segment;
+	} else if (section_cper->CxlAgentType ==
+		   CXL_PROTOCOL_ERROR_HOST_DOWNSTREAM_PORT_AGENT) {
+		//Plain RCRB base address.
+		section_cper->CxlAgentAddress.PortRcrbBaseAddress =
+			json_object_get_uint64(
+				json_object_object_get(address, "value"));
+	}
 
-    //If CXL 1.1 device, the serial number & PCI capability structure.
-    if (section_cper->CxlAgentType == CXL_PROTOCOL_ERROR_DEVICE_AGENT)
-    {
-        section_cper->DeviceSerial = json_object_get_uint64(json_object_object_get(section, "deviceSerial"));
+	//Device ID information.
+	json_object *device_id = json_object_object_get(section, "deviceID");
+	section_cper->DeviceId.VendorId = json_object_get_uint64(
+		json_object_object_get(device_id, "vendorID"));
+	section_cper->DeviceId.DeviceId = json_object_get_uint64(
+		json_object_object_get(device_id, "deviceID"));
+	section_cper->DeviceId.SubsystemVendorId = json_object_get_uint64(
+		json_object_object_get(device_id, "subsystemVendorID"));
+	section_cper->DeviceId.SubsystemDeviceId = json_object_get_uint64(
+		json_object_object_get(device_id, "subsystemDeviceID"));
+	section_cper->DeviceId.ClassCode = json_object_get_uint64(
+		json_object_object_get(device_id, "classCode"));
+	section_cper->DeviceId.SlotNumber = json_object_get_uint64(
+		json_object_object_get(device_id, "slotNumber"));
 
-        json_object* encoded = json_object_object_get(section, "capabilityStructure");
-        char* decoded = b64_decode(json_object_get_string(encoded), json_object_get_string_len(encoded));
-        memcpy(section_cper->CapabilityStructure.PcieCap, decoded, 60);
-        free(decoded);
-    }
+	//If CXL 1.1 device, the serial number & PCI capability structure.
+	if (section_cper->CxlAgentType == CXL_PROTOCOL_ERROR_DEVICE_AGENT) {
+		section_cper->DeviceSerial = json_object_get_uint64(
+			json_object_object_get(section, "deviceSerial"));
 
-    //DVSEC length & error log length.
-    section_cper->CxlDvsecLength = (UINT16)json_object_get_int(json_object_object_get(section, "dvsecLength"));
-    section_cper->CxlErrorLogLength = (UINT16)json_object_get_int(json_object_object_get(section, "errorLogLength"));
+		json_object *encoded =
+			json_object_object_get(section, "capabilityStructure");
+		char *decoded = b64_decode(json_object_get_string(encoded),
+					   json_object_get_string_len(encoded));
+		memcpy(section_cper->CapabilityStructure.PcieCap, decoded, 60);
+		free(decoded);
+	}
 
-    //Write header to stream.
-    fwrite(section_cper, sizeof(EFI_CXL_PROTOCOL_ERROR_DATA), 1, out);
-    fflush(out);
+	//DVSEC length & error log length.
+	section_cper->CxlDvsecLength = (UINT16)json_object_get_int(
+		json_object_object_get(section, "dvsecLength"));
+	section_cper->CxlErrorLogLength = (UINT16)json_object_get_int(
+		json_object_object_get(section, "errorLogLength"));
 
-    //DVSEC out to stream.
-    json_object* encoded = json_object_object_get(section, "cxlDVSEC");
-    char* decoded = b64_decode(json_object_get_string(encoded), json_object_get_string_len(encoded));
-    fwrite(decoded, section_cper->CxlDvsecLength, 1, out);
-    fflush(out);
-    free(decoded);
+	//Write header to stream.
+	fwrite(section_cper, sizeof(EFI_CXL_PROTOCOL_ERROR_DATA), 1, out);
+	fflush(out);
 
-    //Error log out to stream.
-    encoded = json_object_object_get(section, "cxlErrorLog");
-    decoded = b64_decode(json_object_get_string(encoded), json_object_get_string_len(encoded));
-    fwrite(decoded, section_cper->CxlErrorLogLength, 1, out);
-    fflush(out);
-    free(decoded);
+	//DVSEC out to stream.
+	json_object *encoded = json_object_object_get(section, "cxlDVSEC");
+	char *decoded = b64_decode(json_object_get_string(encoded),
+				   json_object_get_string_len(encoded));
+	fwrite(decoded, section_cper->CxlDvsecLength, 1, out);
+	fflush(out);
+	free(decoded);
 
-    free(section_cper);
+	//Error log out to stream.
+	encoded = json_object_object_get(section, "cxlErrorLog");
+	decoded = b64_decode(json_object_get_string(encoded),
+			     json_object_get_string_len(encoded));
+	fwrite(decoded, section_cper->CxlErrorLogLength, 1, out);
+	fflush(out);
+	free(decoded);
+
+	free(section_cper);
 }
\ No newline at end of file
