[PATCH igt 4/9] msm/mapping: Handle BO names with spaces

Kamil Konieczny kamil.konieczny at linux.intel.com
Tue Jul 1 16:13:42 UTC 2025


Hi Rob,
On 2025-06-30 at 11:08:58 -0700, Rob Clark wrote:
> From: Rob Clark <rob.clark at oss.qualcomm.com>
> 
> Instead of trimming at the first space, scan from the end of the string
> until we reach the first non-space char.
> 
> Signed-off-by: Rob Clark <rob.clark at oss.qualcomm.com>
> ---
>  tests/msm/msm_mapping.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/msm/msm_mapping.c b/tests/msm/msm_mapping.c
> index f536db82aba2..5afbcd081fc7 100644
> --- a/tests/msm/msm_mapping.c
> +++ b/tests/msm/msm_mapping.c
> @@ -101,13 +101,14 @@ endswith(const char *str, const char *end)
>  
>  	/* Trim trailing whitespace: */
>  	if (p) {
> -		char *c = p;
> -		while (c) {
> +		char *c = p + strlen(p) - 1;

Add empty line here.

> +		while (c > p ) {

Remove space after 'p':

		while (c > p) {

Regards,
Kamil

>  			if (isspace(*c)) {
>  				*c = '\0';
> +			} else {
>  				break;
>  			}
> -			c++;
> +			c--;
>  		}
>  	}
>  
> -- 
> 2.50.0
> 


More information about the igt-dev mailing list