[PATCH v4 11/15] tools/intel_gpu_top: Replace index with strchr

Zbigniew Kempczyński zbigniew.kempczynski at intel.com
Wed May 14 12:54:45 UTC 2025


On Wed, May 07, 2025 at 04:01:44PM +0000, Jeevaka Prabu Badrappan wrote:
> As index is deprecated, replace index with strchr.
> 
> Signed-off-by: Jeevaka Prabu Badrappan <jeevaka.badrappan at intel.com>
> ---
>  tools/intel_gpu_top.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/intel_gpu_top.c b/tools/intel_gpu_top.c
> index 68d27089b..54e71e559 100644
> --- a/tools/intel_gpu_top.c
> +++ b/tools/intel_gpu_top.c
> @@ -290,7 +290,7 @@ get_pmu_config(int dirfd, const char *name, const char *counter)
>  	if (ret <= 0)
>  		return -1;
>  
> -	p = index(buf, '0');
> +	p = strchr(buf, '0');

Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>

--
Zbigniew

>  	if (!p)
>  		return -1;
>  
> -- 
> 2.34.1
> 


More information about the igt-dev mailing list