ACK: [PATCH] fwts_acpi_tables: add newline after declaration and before statement

ivanhu ivan.hu at canonical.com
Mon Apr 12 07:30:44 UTC 2021



On 4/11/21 9:13 PM, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
> 
> Keep to fwts coding covention and add a newline between declarations
> and first executable statement.
> 
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
>  src/lib/src/fwts_acpi_tables.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/src/lib/src/fwts_acpi_tables.c b/src/lib/src/fwts_acpi_tables.c
> index b870bffd..e8ee05fb 100644
> --- a/src/lib/src/fwts_acpi_tables.c
> +++ b/src/lib/src/fwts_acpi_tables.c
> @@ -1413,6 +1413,7 @@ bool fwts_acpi_obj_find(fwts_framework *fw, const char *obj_name)
>  	/* Search for object */
>  	fwts_list_foreach(item, objects) {
>  		char *name = fwts_list_data(char*, item);
> +
>  		if (strcmp(expanded, name) == 0) {
>  			found = true;
>  			break;
> @@ -1437,6 +1438,7 @@ void fwts_acpi_reserved_zero_check_(
>  {
>  	if (value != 0) {
>  		char label[20];
> +
>  		strncpy(label, table, 4);	/* ACPI table name is 4 char long */
>  		strncpy(label + 4, "ReservedNonZero", sizeof(label) - 4);
>  
> @@ -1591,6 +1593,7 @@ void fwts_acpi_reserved_type_check(
>  {
>  	if (value < min || value >= reserved) {
>  		char label[20];
> +
>  		strncpy(label, table, 4);	/* ACPI name is 4 char long */
>  		strncpy(label + 4, "BadSubTableType", sizeof(label) - 4);
>  
> @@ -1707,6 +1710,7 @@ bool fwts_acpi_table_length_check(
>  {
>  	if (length < size) {
>  		char label[30];
> +
>  		strncpy(label, table, 4);	/* ACPI name is 4 char long */
>  		strncpy(label + 4, "TooShort", sizeof(label) - 4);
>  		fwts_failed(fw, LOG_LEVEL_HIGH, label,
> @@ -1731,6 +1735,7 @@ bool fwts_acpi_structure_length_check(
>  {
>  	if (length != size) {
>  		char label[30];
> +
>  		strncpy(label, table, 4);	/* ACPI name is 4 char long */
>  		strncpy(label + 4, "BadStructureLength", sizeof(label) - 4);
>  		fwts_failed(fw, LOG_LEVEL_CRITICAL, label,
> @@ -1754,6 +1759,7 @@ bool fwts_acpi_structure_length_zero_check(
>  {
>  	if (length == 0) {
>  		char label[30];
> +
>  		strncpy(label, table, 4);	/* ACPI name is 4 char long */
>  		strncpy(label + 4, "StructLengthZero", sizeof(label) - 4);
>  		fwts_failed(fw, LOG_LEVEL_CRITICAL, label,
> @@ -1776,6 +1782,7 @@ bool fwts_acpi_structure_range_check(
>  {
>  	if (offset > table_length) {
>  		char label[30];
> +
>  		strncpy(label, table, 4);	/* ACPI name is 4 char long */
>  		strncpy(label + 4, "BadTableLength", sizeof(label) - 4);
>  		fwts_failed(fw, LOG_LEVEL_CRITICAL, label,
> @@ -1797,6 +1804,7 @@ void fwts_acpi_structure_type_error(
>  	const uint8_t type)
>  {
>  	char label[30];
> +
>  	strncpy(label, table, 4);	/* ACPI name is 4 char long */
>  	strncpy(label + 4, "BadSubtableType", sizeof(label) - 4);
>  	fwts_failed(fw, LOG_LEVEL_HIGH, label,
> 

Acked-by: Ivan Hu <ivan.hu at canonical.com>



More information about the fwts-devel mailing list