ACK: [PATCH 04/20] fwts_log_scan: move fwts_log_remove_timestamp

Colin Ian King colin.king at canonical.com
Thu Jun 21 15:49:04 UTC 2018


On 20/06/18 13:14, Marcello Sylvester Bauer wrote:
> Note: will be relevant for the other functions.
> 
> Signed-off-by: Marcello Sylvester Bauer <info at marcellobauer.com>
> ---
>  src/lib/include/fwts_log_scan.h |  1 +
>  src/lib/src/fwts_klog.c         | 13 +------------
>  src/lib/src/fwts_log_scan.c     | 16 ++++++++++++++++
>  3 files changed, 18 insertions(+), 12 deletions(-)
> 
> diff --git a/src/lib/include/fwts_log_scan.h b/src/lib/include/fwts_log_scan.h
> index 34ac07e7..e08d0aac 100644
> --- a/src/lib/include/fwts_log_scan.h
> +++ b/src/lib/include/fwts_log_scan.h
> @@ -40,5 +40,6 @@ typedef struct {
>  
>  void       fwts_log_free(fwts_list *list);
>  fwts_list *fwts_log_find_changes(fwts_list *log_old, fwts_list *log_new);
> +char      *fwts_log_remove_timestamp(char *text);
>  
>  #endif
> diff --git a/src/lib/src/fwts_klog.c b/src/lib/src/fwts_klog.c
> index bf5ac20f..25491815 100644
> --- a/src/lib/src/fwts_klog.c
> +++ b/src/lib/src/fwts_klog.c
> @@ -83,18 +83,7 @@ fwts_list *fwts_klog_read(void)
>  
>  char *fwts_klog_remove_timestamp(char *text)
>  {
> -	char *ptr = text;
> -
> -	if ((ptr[0] == '<') && (ptr[2] == '>'))
> -		ptr += 3;
> -
> -	if (*ptr == '[')
> -		while (*ptr && *ptr != ']')
> -			ptr++;
> -	if (*ptr == ']')
> -		ptr += 2;	/* Skip ] and trailing space */
> -
> -	return ptr;
> +	return fwts_log_remove_timestamp(text);
>  }
>  
>  int fwts_klog_scan(fwts_framework *fw,
> diff --git a/src/lib/src/fwts_log_scan.c b/src/lib/src/fwts_log_scan.c
> index c5d174cb..f6050fbc 100644
> --- a/src/lib/src/fwts_log_scan.c
> +++ b/src/lib/src/fwts_log_scan.c
> @@ -91,3 +91,19 @@ fwts_list *fwts_log_find_changes(fwts_list *log_old, fwts_list *log_new)
>          }
>          return log_diff;
>  }
> +
> +char *fwts_log_remove_timestamp(char *text)
> +{
> +        char *ptr = text;
> +
> +        if ((ptr[0] == '<') && (ptr[2] == '>'))
> +                ptr += 3;
> +
> +        if (*ptr == '[')
> +                while (*ptr && *ptr != ']')
> +                        ptr++;
> +        if (*ptr == ']')
> +                ptr += 2;       /* Skip ] and trailing space */
> +
> +        return ptr;
> +}
> 
Acked-by: Colin Ian King <colin.king at canonical.com>



More information about the fwts-devel mailing list