Re: [PATCH] PowerPC: Remove trailing comma in cpu_name.

William Cohen <[email protected]>
Newsgroups gmane.linux.oprofile
Message-ID <[email protected]>
On 03/27/2018 04:07 PM, Carl Love wrote:
> Will:
>
> I redid the patch as follows per your suggestions.  I was able to get
> on to a system where the issue occurs and test the patch.  The patch
> seems to work fine.
>
>                    Carl Love

Thanks for the patch.  It has been merged into the upstream oprofile. -Will

>
> -----------------------------------------------------------------------
>
> The processor type for some Power 9 systems had a comma after POWER9.
> Remove the comma before returning the string for the CPU.
> ---
>  libop/op_cpu_type.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/libop/op_cpu_type.c b/libop/op_cpu_type.c
> index feea948..d2babd1 100644
> --- a/libop/op_cpu_type.c
> +++ b/libop/op_cpu_type.c
> @@ -154,17 +154,17 @@ static char * _get_cpuinfo_cpu_type_line(char * buf, int len, const char * prefi
>  			/* if token param 0 then read the whole line else
>  			 * first token only. */
>  			if (token == 0) {
> -				/* Trim trailing whitespace */
> +				/* Trim trailing whitespace and commas */
>  				end = buf + strlen(buf) - 1;
> -				while (isspace(*end))
> +				while (isspace(*end) || *end == ',')
>  					--end;
>  				*(++end) = '\0';
>  				break;
>  			} else {
>  				/* Scan ahead to the end of the token */
> -				while (*buf && !isspace(*buf))
> +				while (*buf && !(isspace(*buf) || *buf == ','))
>  					++buf;
> -				/* Trim trailing whitespace */
> +				/* Trim trailing whitespace and commas */
>  				*buf = '\0';
>  				break;
>  			}



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
oprofile-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oprofile-list
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.