Patchwork apci: aspm: clean up messages

login
register
mail settings
Submitter Colin King
Date Dec. 7, 2012, 6:33 p.m.
Message ID <1354905200-29769-1-git-send-email-colin.king@canonical.com>
Download mbox | patch
Permalink /patch/204594/
State Accepted
Headers show

Comments

Colin King - Dec. 7, 2012, 6:33 p.m.
From: Colin Ian King <colin.king@canonical.com>

Fix a few messages:
	aspm -> ASPM
	PCIE -> PCIe

..and emit a message when lspci fails to produce any output.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/pci/aspm/aspm.c | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)
Keng-Yu Lin - Dec. 12, 2012, 3:18 a.m.
On Sat, Dec 8, 2012 at 2:33 AM, Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Fix a few messages:
>         aspm -> ASPM
>         PCIE -> PCIe
>
> ..and emit a message when lspci fails to produce any output.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/pci/aspm/aspm.c | 22 ++++++++++++----------
>  1 file changed, 12 insertions(+), 10 deletions(-)
>
> diff --git a/src/pci/aspm/aspm.c b/src/pci/aspm/aspm.c
> index a2cda8c..7d1e53f 100644
> --- a/src/pci/aspm/aspm.c
> +++ b/src/pci/aspm/aspm.c
> @@ -100,10 +100,10 @@ static int facp_get_aspm_control(fwts_framework *fw, int *aspm)
>
>         if ((fadt->iapc_boot_arch & FWTS_FACP_IAPC_BOOT_ARCH_PCIE_ASPM_CONTROLS) == 0) {
>                 *aspm = 1;
> -               fwts_log_info(fw, "PCIE ASPM is controlled by Linux kernel.");
> +               fwts_log_info(fw, "PCIe ASPM is controlled by Linux kernel.");
>         } else {
>                 *aspm = 0;
> -               fwts_log_info(fw, "PCIE ASPM is not controlled by Linux kernel.");
> +               fwts_log_info(fw, "PCIe ASPM is not controlled by Linux kernel.");
>                 fwts_advice(fw,
>                         "BIOS reports that Linux kernel should not modify ASPM "
>                         "settings that BIOS configured. It can be intentional "
> @@ -192,11 +192,11 @@ static int pcie_compare_rp_dev_aspm_registers(fwts_framework *fw,
>         rp_aspm_cntrl = rp_cap->link_contrl & FWTS_PCIE_ASPM_CONTROL_FIELD;
>         device_aspm_cntrl = device_cap->link_contrl & FWTS_PCIE_ASPM_CONTROL_FIELD;
>         if (rp_aspm_cntrl != device_aspm_cntrl) {
> -               fwts_failed(fw, LOG_LEVEL_MEDIUM, "PCIEASPM_UNMATCHED",
> -                       "PCIE aspm setting was not matched.");
> -               fwts_log_error(fw, "RP %02Xh:%02Xh.%02Xh has aspm = %02Xh."
> +               fwts_failed(fw, LOG_LEVEL_MEDIUM, "PCIEASPM_Unmatched",
> +                       "PCIe ASPM setting was not matched.");
> +               fwts_log_error(fw, "RP %02Xh:%02Xh.%02Xh has ASPM = %02Xh."
>                         , rp->bus, rp->dev, rp->func, rp_aspm_cntrl);
> -               fwts_log_error(fw, "Device %02Xh:%02Xh.%02Xh has aspm = %02Xh.",
> +               fwts_log_error(fw, "Device %02Xh:%02Xh.%02Xh has ASPM = %02Xh.",
>                         dev->bus, dev->dev, dev->func, device_aspm_cntrl);
>                 fwts_advice(fw,
>                         "ASPM control registers between root port and device "
> @@ -205,7 +205,7 @@ static int pcie_compare_rp_dev_aspm_registers(fwts_framework *fw,
>                         "ASPM correctly and the system is not saving power "
>                         "at its full potential.");
>         } else {
> -               fwts_passed(fw, "PCIE aspm setting matched was matched.");
> +               fwts_passed(fw, "PCIe ASPM setting matched was matched.");
>         }
>
>         return ret;
> @@ -234,11 +234,13 @@ static int pcie_check_aspm_registers(fwts_framework *fw)
>         snprintf(command, sizeof(command), "%s", fw->lspci);
>
>         if (fwts_pipe_exec(command, &lspci_output, &status) != FWTS_OK) {
> -               fwts_log_warning(fw, "Could not execute %s", command);
> +               fwts_log_warning(fw, "Could not execute %s.", command);
>                 return FWTS_ERROR;
>         }
> -       if (lspci_output == NULL)
> +       if (lspci_output == NULL) {
> +               fwts_log_warning(fw, "Output from lspci was empty.");
>                 return FWTS_ERROR;
> +       }
>
>         /* Get the list of pci devices and their configuration */
>         fwts_list_foreach(item, lspci_output) {
> @@ -330,7 +332,7 @@ static int aspm_check_configuration(fwts_framework *fw)
>
>         ret = facp_get_aspm_control(fw, &aspm_facp);
>         if (ret == FWTS_ERROR) {
> -               fwts_log_info(fw, "No valid FACP information present: cannot test aspm.");
> +               fwts_log_info(fw, "No valid FACP information present: cannot test ASPM.");
>                 return FWTS_ERROR;
>         }
>
> --
> 1.8.0
>
Acked-by: Keng-Yu Lin <kengyu@canonical.com>
Alex Hung - Dec. 12, 2012, 6:37 a.m.
On 12/08/2012 02:33 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Fix a few messages:
> 	aspm -> ASPM
> 	PCIE -> PCIe
>
> ..and emit a message when lspci fails to produce any output.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/pci/aspm/aspm.c | 22 ++++++++++++----------
>   1 file changed, 12 insertions(+), 10 deletions(-)
>
> diff --git a/src/pci/aspm/aspm.c b/src/pci/aspm/aspm.c
> index a2cda8c..7d1e53f 100644
> --- a/src/pci/aspm/aspm.c
> +++ b/src/pci/aspm/aspm.c
> @@ -100,10 +100,10 @@ static int facp_get_aspm_control(fwts_framework *fw, int *aspm)
>
>   	if ((fadt->iapc_boot_arch & FWTS_FACP_IAPC_BOOT_ARCH_PCIE_ASPM_CONTROLS) == 0) {
>   		*aspm = 1;
> -		fwts_log_info(fw, "PCIE ASPM is controlled by Linux kernel.");
> +		fwts_log_info(fw, "PCIe ASPM is controlled by Linux kernel.");
>   	} else {
>   		*aspm = 0;
> -		fwts_log_info(fw, "PCIE ASPM is not controlled by Linux kernel.");
> +		fwts_log_info(fw, "PCIe ASPM is not controlled by Linux kernel.");
>   		fwts_advice(fw,
>   			"BIOS reports that Linux kernel should not modify ASPM "
>   			"settings that BIOS configured. It can be intentional "
> @@ -192,11 +192,11 @@ static int pcie_compare_rp_dev_aspm_registers(fwts_framework *fw,
>   	rp_aspm_cntrl = rp_cap->link_contrl & FWTS_PCIE_ASPM_CONTROL_FIELD;
>   	device_aspm_cntrl = device_cap->link_contrl & FWTS_PCIE_ASPM_CONTROL_FIELD;
>   	if (rp_aspm_cntrl != device_aspm_cntrl) {
> -		fwts_failed(fw, LOG_LEVEL_MEDIUM, "PCIEASPM_UNMATCHED",
> -			"PCIE aspm setting was not matched.");
> -		fwts_log_error(fw, "RP %02Xh:%02Xh.%02Xh has aspm = %02Xh."
> +		fwts_failed(fw, LOG_LEVEL_MEDIUM, "PCIEASPM_Unmatched",
> +			"PCIe ASPM setting was not matched.");
> +		fwts_log_error(fw, "RP %02Xh:%02Xh.%02Xh has ASPM = %02Xh."
>   			, rp->bus, rp->dev, rp->func, rp_aspm_cntrl);
> -		fwts_log_error(fw, "Device %02Xh:%02Xh.%02Xh has aspm = %02Xh.",
> +		fwts_log_error(fw, "Device %02Xh:%02Xh.%02Xh has ASPM = %02Xh.",
>   			dev->bus, dev->dev, dev->func, device_aspm_cntrl);
>   		fwts_advice(fw,
>   			"ASPM control registers between root port and device "
> @@ -205,7 +205,7 @@ static int pcie_compare_rp_dev_aspm_registers(fwts_framework *fw,
>   			"ASPM correctly and the system is not saving power "
>   			"at its full potential.");
>   	} else {
> -		fwts_passed(fw, "PCIE aspm setting matched was matched.");
> +		fwts_passed(fw, "PCIe ASPM setting matched was matched.");
>   	}
>
>   	return ret;
> @@ -234,11 +234,13 @@ static int pcie_check_aspm_registers(fwts_framework *fw)
>   	snprintf(command, sizeof(command), "%s", fw->lspci);
>
>   	if (fwts_pipe_exec(command, &lspci_output, &status) != FWTS_OK) {
> -		fwts_log_warning(fw, "Could not execute %s", command);
> +		fwts_log_warning(fw, "Could not execute %s.", command);
>   		return FWTS_ERROR;
>   	}
> -	if (lspci_output == NULL)
> +	if (lspci_output == NULL) {
> +		fwts_log_warning(fw, "Output from lspci was empty.");
>   		return FWTS_ERROR;
> +	}
>
>   	/* Get the list of pci devices and their configuration */
>   	fwts_list_foreach(item, lspci_output) {
> @@ -330,7 +332,7 @@ static int aspm_check_configuration(fwts_framework *fw)
>
>   	ret = facp_get_aspm_control(fw, &aspm_facp);
>   	if (ret == FWTS_ERROR) {
> -		fwts_log_info(fw, "No valid FACP information present: cannot test aspm.");
> +		fwts_log_info(fw, "No valid FACP information present: cannot test ASPM.");
>   		return FWTS_ERROR;
>   	}
>
>
Acked-by: Alex Hung <alex.hung@canonical.com>

Patch

diff --git a/src/pci/aspm/aspm.c b/src/pci/aspm/aspm.c
index a2cda8c..7d1e53f 100644
--- a/src/pci/aspm/aspm.c
+++ b/src/pci/aspm/aspm.c
@@ -100,10 +100,10 @@  static int facp_get_aspm_control(fwts_framework *fw, int *aspm)
 
 	if ((fadt->iapc_boot_arch & FWTS_FACP_IAPC_BOOT_ARCH_PCIE_ASPM_CONTROLS) == 0) {
 		*aspm = 1;
-		fwts_log_info(fw, "PCIE ASPM is controlled by Linux kernel.");
+		fwts_log_info(fw, "PCIe ASPM is controlled by Linux kernel.");
 	} else {
 		*aspm = 0;
-		fwts_log_info(fw, "PCIE ASPM is not controlled by Linux kernel.");
+		fwts_log_info(fw, "PCIe ASPM is not controlled by Linux kernel.");
 		fwts_advice(fw,
 			"BIOS reports that Linux kernel should not modify ASPM "
 			"settings that BIOS configured. It can be intentional "
@@ -192,11 +192,11 @@  static int pcie_compare_rp_dev_aspm_registers(fwts_framework *fw,
 	rp_aspm_cntrl = rp_cap->link_contrl & FWTS_PCIE_ASPM_CONTROL_FIELD;
 	device_aspm_cntrl = device_cap->link_contrl & FWTS_PCIE_ASPM_CONTROL_FIELD;
 	if (rp_aspm_cntrl != device_aspm_cntrl) {
-		fwts_failed(fw, LOG_LEVEL_MEDIUM, "PCIEASPM_UNMATCHED",
-			"PCIE aspm setting was not matched.");
-		fwts_log_error(fw, "RP %02Xh:%02Xh.%02Xh has aspm = %02Xh."
+		fwts_failed(fw, LOG_LEVEL_MEDIUM, "PCIEASPM_Unmatched",
+			"PCIe ASPM setting was not matched.");
+		fwts_log_error(fw, "RP %02Xh:%02Xh.%02Xh has ASPM = %02Xh."
 			, rp->bus, rp->dev, rp->func, rp_aspm_cntrl);
-		fwts_log_error(fw, "Device %02Xh:%02Xh.%02Xh has aspm = %02Xh.",
+		fwts_log_error(fw, "Device %02Xh:%02Xh.%02Xh has ASPM = %02Xh.",
 			dev->bus, dev->dev, dev->func, device_aspm_cntrl);
 		fwts_advice(fw,
 			"ASPM control registers between root port and device "
@@ -205,7 +205,7 @@  static int pcie_compare_rp_dev_aspm_registers(fwts_framework *fw,
 			"ASPM correctly and the system is not saving power "
 			"at its full potential.");
 	} else {
-		fwts_passed(fw, "PCIE aspm setting matched was matched.");
+		fwts_passed(fw, "PCIe ASPM setting matched was matched.");
 	}
 
 	return ret;
@@ -234,11 +234,13 @@  static int pcie_check_aspm_registers(fwts_framework *fw)
 	snprintf(command, sizeof(command), "%s", fw->lspci);
 
 	if (fwts_pipe_exec(command, &lspci_output, &status) != FWTS_OK) {
-		fwts_log_warning(fw, "Could not execute %s", command);
+		fwts_log_warning(fw, "Could not execute %s.", command);
 		return FWTS_ERROR;
 	}
-	if (lspci_output == NULL)
+	if (lspci_output == NULL) {
+		fwts_log_warning(fw, "Output from lspci was empty.");
 		return FWTS_ERROR;
+	}
 
 	/* Get the list of pci devices and their configuration */
 	fwts_list_foreach(item, lspci_output) {
@@ -330,7 +332,7 @@  static int aspm_check_configuration(fwts_framework *fw)
 
 	ret = facp_get_aspm_control(fw, &aspm_facp);
 	if (ret == FWTS_ERROR) {
-		fwts_log_info(fw, "No valid FACP information present: cannot test aspm.");
+		fwts_log_info(fw, "No valid FACP information present: cannot test ASPM.");
 		return FWTS_ERROR;
 	}