Skip to content

Commit

Permalink
Removing unwanted whitespaces in console prints (#417)
Browse files Browse the repository at this point in the history
* Removing unwanted whitespaces in console prints

 - Removed unwanted whitespace characters before new line in console prints.

Signed-off-by: Srikar Josyula <[email protected]>

* Minor improvements to print messages.

 - Aligned whitespaces and \n with rest of the prints for hygiene logs.
 - Adjusted the code to have max 100 chars in a line.

Signed-off-by: Srikar Josyula <[email protected]>

---------

Signed-off-by: Srikar Josyula <[email protected]>
  • Loading branch information
SrikarJosyula authored Nov 24, 2023
1 parent 1387c43 commit 40892e3
Show file tree
Hide file tree
Showing 44 changed files with 304 additions and 300 deletions.
14 changes: 7 additions & 7 deletions baremetal_app/SbsaAvsMain.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,15 +329,15 @@ ShellAppMainsbsa(
g_sbsa_level = SBSA_MAX_LEVEL_SUPPORTED;
}

val_print(AVS_PRINT_TEST, "\n\n SBSA Architecture Compliance Suite \n", 0);
val_print(AVS_PRINT_TEST, "\n\n SBSA Architecture Compliance Suite\n", 0);
val_print(AVS_PRINT_TEST, " Version %d.", SBSA_ACS_MAJOR_VER);
val_print(AVS_PRINT_TEST, "%d.", SBSA_ACS_MINOR_VER);
val_print(AVS_PRINT_TEST, "%d \n", SBSA_ACS_SUBMINOR_VER);
val_print(AVS_PRINT_TEST, "%d\n", SBSA_ACS_SUBMINOR_VER);

val_print(AVS_PRINT_TEST, "\n Starting tests for level %2d", g_sbsa_level);
val_print(AVS_PRINT_TEST, " (Print level is %2d)\n\n", g_print_level);

val_print(AVS_PRINT_TEST, " Creating Platform Information Tables \n", 0);
val_print(AVS_PRINT_TEST, " Creating Platform Information Tables\n", 0);

g_skip_test_num = &g_skip_array[0];
if (g_num_tests) {
Expand Down Expand Up @@ -434,17 +434,17 @@ ShellAppMainsbsa(
Status |= val_ras_execute_tests(g_sbsa_level, val_pe_get_num());

print_test_status:
val_print(AVS_PRINT_TEST, "\n ------------------------------------------------------- \n", 0);
val_print(AVS_PRINT_TEST, "\n -------------------------------------------------------\n", 0);
val_print(AVS_PRINT_TEST, " Total Tests run = %4d;", g_sbsa_tests_total);
val_print(AVS_PRINT_TEST, " Tests Passed = %4d", g_sbsa_tests_pass);
val_print(AVS_PRINT_TEST, " Tests Failed = %4d\n", g_sbsa_tests_fail);
val_print(AVS_PRINT_TEST, " --------------------------------------------------------- \n", 0);
val_print(AVS_PRINT_TEST, " ---------------------------------------------------------\n", 0);

freeSbsaAvsMem();

val_print(AVS_PRINT_TEST, "\n ** For complete SBSA test coverage, it is ", 0);
val_print(AVS_PRINT_TEST, "\n necessary to also run the BSA test ** \n\n", 0);
val_print(AVS_PRINT_TEST, "\n *** SBSA tests complete. Reset the system. *** \n\n", 0);
val_print(AVS_PRINT_TEST, "\n necessary to also run the BSA test **\n\n", 0);
val_print(AVS_PRINT_TEST, "\n *** SBSA tests complete. Reset the system. ***\n\n", 0);


val_pe_context_restore(AA64WriteSp(g_stack_pointer));
Expand Down
20 changes: 10 additions & 10 deletions linux_app/sbsa-acs-app/sbsa_app_main.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @file
* Copyright (c) 2016-2023 Arm Limited or its affiliates. All rights reserved.
* Copyright (c) 2016-2023, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -119,35 +119,35 @@ main (int argc, char **argv)
}


printf ("\n ************ SBSA Architecture Compliance Suite ********* \n");
printf (" Version %d.%d.%d\n", SBSA_APP_VERSION_MAJOR,
printf("\n ************ SBSA Architecture Compliance Suite *********\n");
printf(" Version %d.%d.%d\n", SBSA_APP_VERSION_MAJOR,
SBSA_APP_VERSION_MINOR, SBSA_APP_VERSION_SUBMINOR);


printf ("\n Starting tests for level %2d (Print level is %2d)\n\n", g_sbsa_level, g_print_level);
printf("\n Starting tests for level %2d (Print level is %2d)\n\n", g_sbsa_level, g_print_level);

printf (" Gathering system information.... \n");
printf(" Gathering system information....\n");
status = initialize_test_environment(g_print_level);
if (status) {
printf ("Cannot initialize test environment. Exiting.... \n");
printf("Cannot initialize test environment. Exiting....\n");
return 0;
}

if (g_sbsa_level > 6)
{
printf("\n *** Starting SMMU tests *** \n");
printf("\n *** Starting SMMU tests ***\n");
execute_tests_smmu(1, g_sbsa_level, g_print_level);
}
printf("\n *** Starting PCIe tests *** \n");
printf("\n *** Starting PCIe tests ***\n");
execute_tests_pcie(1, g_sbsa_level, g_print_level);

if (run_exerciser) {
printf("\n *** PCIe Exerciser tests only runs on UEFI *** \n");
printf("\n *** PCIe Exerciser tests only runs on UEFI ***\n");
//execute_tests_exerciser(1, g_sbsa_level, g_print_level);
}
printf("\n ** For complete SBSA test coverage, it is ");
printf("\n necessary to also run the BSA test **\n\n");
printf("\n *** SBSA tests complete *** \n\n");
printf("\n *** SBSA tests complete ***\n\n");

cleanup_test_environment();

Expand Down
16 changes: 8 additions & 8 deletions linux_app/sbsa-acs-app/sbsa_drv_intf.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @file
* Copyright (c) 2016-2018, Arm Limited or its affiliates. All rights reserved.
* Copyright (c) 2016-2018, 2023, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -46,12 +46,12 @@ call_drv_get_status(unsigned long int *arg0, unsigned long int *arg1, unsigned l

if (NULL == fd)
{
printf("fopen failed \n");
printf("fopen failed\n");
return 1;
}
fread(&test_params,1,sizeof(test_params),fd);

//printf("read back value is %x %lx \n", test_params.api_num, test_params.arg1);
//printf("read back value is %x %lx\n", test_params.api_num, test_params.arg1);

fclose(fd);

Expand Down Expand Up @@ -89,7 +89,7 @@ call_drv_init_test_env(unsigned int print_level)

if (NULL == fd)
{
printf("fopen failed \n");
printf("fopen failed\n");
return 1;
}

Expand All @@ -116,7 +116,7 @@ call_drv_clean_test_env()

if (NULL == fd)
{
printf("fopen failed \n");
printf("fopen failed\n");
return 1;
}

Expand All @@ -142,7 +142,7 @@ call_drv_execute_test(unsigned int api_num, unsigned int num_pe,

if (NULL == fd)
{
printf("fopen failed \n");
printf("fopen failed\n");
return 1;
}

Expand All @@ -169,7 +169,7 @@ call_update_skip_list(unsigned int api_num, int *p_skip_test_num)

if (NULL == fd)
{
printf("fopen failed \n");
printf("fopen failed\n");
return 1;
}

Expand Down Expand Up @@ -201,7 +201,7 @@ int read_from_proc_sbsa_msg() {
fd = fopen("/proc/sbsa_msg", "r");

if (NULL == fd) {
printf("fopen failed \n");
printf("fopen failed\n");
return 1;
}

Expand Down
4 changes: 2 additions & 2 deletions platform/pal_baremetal/common/src/pal_hmat.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @file
* Copyright (c) 2023 Arm Limited or its affiliates. All rights reserved.
* Copyright (c) 2023, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -64,7 +64,7 @@ void pal_hmat_create_info_table(HMAT_INFO_TABLE *HmatTable)
HMAT_BW_ENTRY *curr_info_entry;

if (HmatTable == NULL) {
print(AVS_PRINT_ERR, " Unable to create HMAT info table, input pointer is NULL \n");
print(AVS_PRINT_ERR, " Unable to create HMAT info table, input pointer is NULL\n");
return;
}

Expand Down
20 changes: 10 additions & 10 deletions platform/pal_baremetal/common/src/pal_misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ pal_mmio_read8(uint64_t addr)

data = (*(volatile uint8_t *)addr);
if (g_print_mmio || (g_curr_module & g_enable_module))
print(AVS_PRINT_INFO, " pal_mmio_read8 Address = %llx Data = %lx \n", addr, data);
print(AVS_PRINT_INFO, " pal_mmio_read8 Address = %llx Data = %lx\n", addr, data);

return data;
}
Expand All @@ -70,7 +70,7 @@ pal_mmio_read16(uint64_t addr)

data = (*(volatile uint16_t *)addr);
if (g_print_mmio || (g_curr_module & g_enable_module))
print(AVS_PRINT_INFO, " pal_mmio_read16 Address = %llx Data = %lx \n", addr, data);
print(AVS_PRINT_INFO, " pal_mmio_read16 Address = %llx Data = %lx\n", addr, data);

return data;
}
Expand All @@ -90,7 +90,7 @@ pal_mmio_read64(uint64_t addr)

data = (*(volatile uint64_t *)addr);
if (g_print_mmio || (g_curr_module & g_enable_module))
print(AVS_PRINT_INFO, " pal_mmio_read64 Address = %llx Data = %llx \n", addr, data);
print(AVS_PRINT_INFO, " pal_mmio_read64 Address = %llx Data = %llx\n", addr, data);

return data;
}
Expand All @@ -116,7 +116,7 @@ pal_mmio_read(uint64_t addr)

data = (*(volatile uint32_t *)addr);
if (g_print_mmio || (g_curr_module & g_enable_module))
print(AVS_PRINT_INFO, " pal_mmio_read Address = %8x Data = %x \n", addr, data);
print(AVS_PRINT_INFO, " pal_mmio_read Address = %8x Data = %x\n", addr, data);

return data;

Expand All @@ -135,7 +135,7 @@ void
pal_mmio_write8(uint64_t addr, uint8_t data)
{
if (g_print_mmio || (g_curr_module & g_enable_module))
print(AVS_PRINT_INFO, " pal_mmio_write8 Address = %llx Data = %lx \n", addr, data);
print(AVS_PRINT_INFO, " pal_mmio_write8 Address = %llx Data = %lx\n", addr, data);

*(volatile uint8_t *)addr = data;
}
Expand All @@ -153,7 +153,7 @@ void
pal_mmio_write16(uint64_t addr, uint16_t data)
{
if (g_print_mmio || (g_curr_module & g_enable_module))
print(AVS_PRINT_INFO, " pal_mmio_write16 Address = %llx Data = %lx \n", addr, data);
print(AVS_PRINT_INFO, " pal_mmio_write16 Address = %llx Data = %lx\n", addr, data);

*(volatile uint16_t *)addr = data;
}
Expand All @@ -171,7 +171,7 @@ void
pal_mmio_write64(uint64_t addr, uint64_t data)
{
if (g_print_mmio || (g_curr_module & g_enable_module))
print(AVS_PRINT_INFO, " pal_mmio_write64 Address = %llx Data = %llx \n", addr, data);
print(AVS_PRINT_INFO, " pal_mmio_write64 Address = %llx Data = %llx\n", addr, data);

*(volatile uint64_t *)addr = data;
}
Expand All @@ -190,12 +190,12 @@ pal_mmio_write(uint64_t addr, uint32_t data)
{

if (addr & 0x3) {
print(AVS_PRINT_WARN, "\n Error-Input address is not aligned. Masking the last 2 bits \n");
print(AVS_PRINT_WARN, "\n Error-Input address is not aligned. Masking the last 2 bits\n");
addr = addr & ~(0x3); //make sure addr is aligned to 4 bytes
}

if (g_print_mmio || (g_curr_module & g_enable_module))
print(AVS_PRINT_INFO, " pal_mmio_write Address = %8x Data = %x \n", addr, data);
print(AVS_PRINT_INFO, " pal_mmio_write Address = %8x Data = %x\n", addr, data);

*(volatile uint32_t *)addr = data;
}
Expand Down Expand Up @@ -657,4 +657,4 @@ void pal_uart_print(int log, const char *fmt, ...)
(void)vprintf(fmt, args);
va_end(args);
(void) log;
}
}
4 changes: 2 additions & 2 deletions platform/pal_baremetal/common/src/pal_mpam.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ pal_mpam_create_info_table(MPAM_INFO_TABLE *MpamTable)
MPAM_MSC_NODE *curr_entry;

if (MpamTable == NULL) {
print(AVS_PRINT_ERR, " Input MPAM Table Pointer is NULL \n");
print(AVS_PRINT_ERR, " Input MPAM Table Pointer is NULL\n");
return;
}

Expand Down Expand Up @@ -168,7 +168,7 @@ pal_srat_create_info_table(SRAT_INFO_TABLE *SratTable)
uint32_t Index, mem_index = 0, gicc_index = 0;

if (SratTable == NULL) {
print(AVS_PRINT_ERR, " Input SRAT Table Pointer is NULL \n");
print(AVS_PRINT_ERR, " Input SRAT Table Pointer is NULL\n");
return;
}

Expand Down
4 changes: 2 additions & 2 deletions platform/pal_baremetal/common/src/pal_pcie.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ pal_pcie_create_info_table(PCIE_INFO_TABLE *PcieTable)
uint32_t i = 0;

if (PcieTable == NULL) {
print(AVS_PRINT_ERR, "Input PCIe Table Pointer is NULL. Cannot create PCIe INFO \n");
print(AVS_PRINT_ERR, "Input PCIe Table Pointer is NULL. Cannot create PCIe INFO\n");
return;
}

PcieTable->num_entries = 0;

if(platform_pcie_cfg.num_entries == 0) {
print(AVS_PRINT_ERR, "Number of ECAM is 0. Cannot create PCIe INFO \n");
print(AVS_PRINT_ERR, "Number of ECAM is 0. Cannot create PCIe INFO\n");
return;
}

Expand Down
2 changes: 1 addition & 1 deletion platform/pal_baremetal/common/src/pal_pcie_enumeration.c
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ void pal_pcie_enumerate(void)
return;
}

print(AVS_PRINT_INFO, "\nStarting Enumeration \n", 0);
print(AVS_PRINT_INFO, "\nStarting Enumeration\n", 0);
while (pcie_index < g_pcie_info_table->num_entries)
{
pri_bus = g_pcie_info_table->block[pcie_index].start_bus_num;
Expand Down
4 changes: 2 additions & 2 deletions platform/pal_baremetal/common/src/pal_pe.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ PalAllocateSecondaryStack(uint64_t mpidr)
{
gSecondaryPeStack = pal_aligned_alloc(MEM_ALIGN_4K, NumPe * SIZE_STACK_SECONDARY_PE);
if (gSecondaryPeStack == NULL){
print(AVS_PRINT_ERR, "FATAL - Allocation for Secondary stack failed \n", 0);
print(AVS_PRINT_ERR, "FATAL - Allocation for Secondary stack failed\n", 0);
}
pal_pe_data_cache_ops_by_va((uint64_t)&gSecondaryPeStack, CLEAN_AND_INVALIDATE);
}
Expand Down Expand Up @@ -328,7 +328,7 @@ pal_cache_create_info_table(CACHE_INFO_TABLE *CacheTable, PE_INFO_TABLE *PeTable
uint32_t i;

if (CacheTable == NULL) {
print(AVS_PRINT_ERR, " Unable to create cache info table, input pointer is NULL \n");
print(AVS_PRINT_ERR, " Unable to create cache info table, input pointer is NULL\n");
return;
}

Expand Down
10 changes: 5 additions & 5 deletions platform/pal_baremetal/common/src/pal_peripherals.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pal_peripheral_create_info_table(PERIPHERAL_INFO_TABLE *peripheralInfoTable)
PERIPHERAL_INFO_BLOCK *per_info = NULL;

if (peripheralInfoTable == NULL) {
print(AVS_PRINT_ERR, "Input Peripheral Table Pointer is NULL. Cannot create Peripheral INFO \n");
print(AVS_PRINT_ERR, "Input Peripheral Table Pointer is NULL. Cannot create Peripheral INFO\n");
return;
}

Expand All @@ -64,7 +64,7 @@ pal_peripheral_create_info_table(PERIPHERAL_INFO_TABLE *peripheralInfoTable)
/* check for any USB Controllers */
do {

print(AVS_PRINT_INFO, "Entered USB loop \n");
print(AVS_PRINT_INFO, "Entered USB loop\n");
DeviceBdf = pal_pcie_get_bdf(USB_CLASSCODE, StartBdf);
if (DeviceBdf != 0) {
per_info->type = PERIPHERAL_TYPE_USB;
Expand All @@ -75,7 +75,7 @@ pal_peripheral_create_info_table(PERIPHERAL_INFO_TABLE *peripheralInfoTable)
break;
}
per_info->bdf = DeviceBdf;
print(AVS_PRINT_INFO, "Found a USB controller %4x \n", per_info->base0);
print(AVS_PRINT_INFO, "Found a USB controller %4x\n", per_info->base0);
peripheralInfoTable->header.num_usb++;
peripheralInfoTable->header.num_all++;
per_info++;
Expand All @@ -88,7 +88,7 @@ pal_peripheral_create_info_table(PERIPHERAL_INFO_TABLE *peripheralInfoTable)
/* check for any SATA Controllers */
do {

print(AVS_PRINT_INFO, "Entered SATA loop \n");
print(AVS_PRINT_INFO, "Entered SATA loop\n");
DeviceBdf = pal_pcie_get_bdf(SATA_CLASSCODE, StartBdf);
if (DeviceBdf != 0) {
per_info->type = PERIPHERAL_TYPE_SATA;
Expand All @@ -99,7 +99,7 @@ pal_peripheral_create_info_table(PERIPHERAL_INFO_TABLE *peripheralInfoTable)
break;
}
per_info->bdf = DeviceBdf;
print(AVS_PRINT_INFO, "Found a SATA controller %4x \n", per_info->base0);
print(AVS_PRINT_INFO, "Found a SATA controller %4x\n", per_info->base0);
peripheralInfoTable->header.num_sata++;
peripheralInfoTable->header.num_all++;
per_info++;
Expand Down
Loading

0 comments on commit 40892e3

Please sign in to comment.