Patchwork [1/3] kernel: version: strip off trailing newline

login
register
mail settings
Submitter Colin King
Date May 29, 2012, 1:11 p.m.
Message ID <1338297111-19168-2-git-send-email-colin.king@canonical.com>
Download mbox | patch
Permalink /patch/161742/
State Accepted
Headers show

Comments

Colin King - May 29, 2012, 1:11 p.m.
From: Colin Ian King <colin.king@canonical.com>

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/kernel/version/version.c |    3 +++
 1 file changed, 3 insertions(+)
Alex Hung - May 29, 2012, 2:16 p.m.
On 05/29/2012 09:11 PM, Colin King wrote:
> From: Colin Ian King<colin.king@canonical.com>
>
> Signed-off-by: Colin Ian King<colin.king@canonical.com>
> ---
>   src/kernel/version/version.c |    3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/src/kernel/version/version.c b/src/kernel/version/version.c
> index c56882b..37ed5b5 100644
> --- a/src/kernel/version/version.c
> +++ b/src/kernel/version/version.c
> @@ -28,6 +28,7 @@ static int version_test1(fwts_framework *fw)
>   		fwts_warning(fw,
>   			"Cannot get version signature info from /proc/version_signature (This is Ubuntu specific, and not necessarily a failure).");
>   	else {
> +		fwts_chop_newline(str);
>   		fwts_passed(fw, "Signature: %s", str);
>   		free(str);
>   	}
> @@ -44,6 +45,7 @@ static int version_test2(fwts_framework *fw)
>   			"KernelProcVersion",
>   			"Cannot get version info from /proc/version");
>   	else {
> +		fwts_chop_newline(str);
>   		fwts_passed(fw, "Kernel Version: %s", str);
>   		free(str);
>   	}
> @@ -60,6 +62,7 @@ static int version_test3(fwts_framework *fw)
>   			"KernelACPIVersion",
>   			"Cannot get ACPI version info from /sys/module/acpi/parameters/acpica_version or /proc/acpi/info");
>   	else {
> +		fwts_chop_newline(str);
>   		fwts_passed(fw, "ACPI Version: %s", str);
>   		free(str);
>   	}

Acked-by: Alex Hung <alex.hung@canonical.com>
Keng-Yu Lin - May 31, 2012, 6:56 a.m.
On Tue, May 29, 2012 at 9:11 PM, Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/kernel/version/version.c |    3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/src/kernel/version/version.c b/src/kernel/version/version.c
> index c56882b..37ed5b5 100644
> --- a/src/kernel/version/version.c
> +++ b/src/kernel/version/version.c
> @@ -28,6 +28,7 @@ static int version_test1(fwts_framework *fw)
>                fwts_warning(fw,
>                        "Cannot get version signature info from /proc/version_signature (This is Ubuntu specific, and not necessarily a failure).");
>        else {
> +               fwts_chop_newline(str);
>                fwts_passed(fw, "Signature: %s", str);
>                free(str);
>        }
> @@ -44,6 +45,7 @@ static int version_test2(fwts_framework *fw)
>                        "KernelProcVersion",
>                        "Cannot get version info from /proc/version");
>        else {
> +               fwts_chop_newline(str);
>                fwts_passed(fw, "Kernel Version: %s", str);
>                free(str);
>        }
> @@ -60,6 +62,7 @@ static int version_test3(fwts_framework *fw)
>                        "KernelACPIVersion",
>                        "Cannot get ACPI version info from /sys/module/acpi/parameters/acpica_version or /proc/acpi/info");
>        else {
> +               fwts_chop_newline(str);
>                fwts_passed(fw, "ACPI Version: %s", str);
>                free(str);
>        }
> --
> 1.7.10
>
Acked-by: Keng-Yu Lin <kengyu@canonical.com>
Ivan Hu - June 1, 2012, 1:42 a.m.
On 05/29/2012 09:11 PM, Colin King wrote:
> From: Colin Ian King<colin.king@canonical.com>
>
> Signed-off-by: Colin Ian King<colin.king@canonical.com>
> ---
>   src/kernel/version/version.c |    3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/src/kernel/version/version.c b/src/kernel/version/version.c
> index c56882b..37ed5b5 100644
> --- a/src/kernel/version/version.c
> +++ b/src/kernel/version/version.c
> @@ -28,6 +28,7 @@ static int version_test1(fwts_framework *fw)
>   		fwts_warning(fw,
>   			"Cannot get version signature info from /proc/version_signature (This is Ubuntu specific, and not necessarily a failure).");
>   	else {
> +		fwts_chop_newline(str);
>   		fwts_passed(fw, "Signature: %s", str);
>   		free(str);
>   	}
> @@ -44,6 +45,7 @@ static int version_test2(fwts_framework *fw)
>   			"KernelProcVersion",
>   			"Cannot get version info from /proc/version");
>   	else {
> +		fwts_chop_newline(str);
>   		fwts_passed(fw, "Kernel Version: %s", str);
>   		free(str);
>   	}
> @@ -60,6 +62,7 @@ static int version_test3(fwts_framework *fw)
>   			"KernelACPIVersion",
>   			"Cannot get ACPI version info from /sys/module/acpi/parameters/acpica_version or /proc/acpi/info");
>   	else {
> +		fwts_chop_newline(str);
>   		fwts_passed(fw, "ACPI Version: %s", str);
>   		free(str);
>   	}
Acked-by: Ivan Hu<ivan.hu@canonical.com>

Patch

diff --git a/src/kernel/version/version.c b/src/kernel/version/version.c
index c56882b..37ed5b5 100644
--- a/src/kernel/version/version.c
+++ b/src/kernel/version/version.c
@@ -28,6 +28,7 @@  static int version_test1(fwts_framework *fw)
 		fwts_warning(fw,
 			"Cannot get version signature info from /proc/version_signature (This is Ubuntu specific, and not necessarily a failure).");
 	else {
+		fwts_chop_newline(str);
 		fwts_passed(fw, "Signature: %s", str);
 		free(str);
 	}
@@ -44,6 +45,7 @@  static int version_test2(fwts_framework *fw)
 			"KernelProcVersion",
 			"Cannot get version info from /proc/version");
 	else {
+		fwts_chop_newline(str);
 		fwts_passed(fw, "Kernel Version: %s", str);
 		free(str);
 	}
@@ -60,6 +62,7 @@  static int version_test3(fwts_framework *fw)
 			"KernelACPIVersion",
 			"Cannot get ACPI version info from /sys/module/acpi/parameters/acpica_version or /proc/acpi/info");
 	else {
+		fwts_chop_newline(str);
 		fwts_passed(fw, "ACPI Version: %s", str);
 		free(str);
 	}