[PATCH i-g-t 06/12] lib/igt_drm_fdinfo: Stop ignoring space where not needed

Umesh Nerlige Ramappa umesh.nerlige.ramappa at intel.com
Thu Apr 18 22:34:33 UTC 2024


On Fri, Apr 05, 2024 at 01:00:50AM -0500, Lucas De Marchi wrote:
>strto[ul]l() family of functions already ignore leading spaces. There's
>no need to be explicit.
>
>Signed-off-by: Lucas De Marchi <lucas.demarchi at intel.com>

Reviewed-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa at intel.com>

>---
> lib/igt_drm_fdinfo.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
>diff --git a/lib/igt_drm_fdinfo.c b/lib/igt_drm_fdinfo.c
>index 8eb5e5eed..5f05f210e 100644
>--- a/lib/igt_drm_fdinfo.c
>+++ b/lib/igt_drm_fdinfo.c
>@@ -103,10 +103,8 @@ static int parse_engine(const char *name, struct drm_client_fdinfo *info,
> 		}
> 	}
>
>-	if (found >= 0) {
>-		p = ignore_space(p);
>+	if (found >= 0)
> 		*val = strtoull(p, NULL, 10);
>-	}
>
> 	return found;
> }
>@@ -159,7 +157,6 @@ static int parse_region(const char *name, struct drm_client_fdinfo *info,
> 	if (found < 0)
> 		goto out;
>
>-	p = ignore_space(p);
> 	*val = strtoull(p, NULL, 10);
>
> 	p = strchr(p, ' ');
>-- 
>2.44.0
>


More information about the igt-dev mailing list