[dpdk-dev] [PATCH v1 1/4] test/power: fix check for cpu frequency

Pattan, Reshma reshma.pattan at intel.com
Thu Apr 29 12:34:33 CEST 2021



> -----Original Message-----
> From: dev <dev-bounces at dpdk.org> On Behalf Of David Hunt
> +		TEST_POWER_SYSFILE_SCALING_FREQ, lcore_id) < 0) {

>  		return 0;

[Reshma]:  Do we need to return -1 here and in other failure scenarios below.

>  	}
>  	f = fopen(fullpath, "r");
>  	if (f == NULL) {
> -		return 0;
> +		if (snprintf(fullpath, sizeof(fullpath),
> +			TEST_POWER_SYSFILE_CPUINFO_FREQ, lcore_id) < 0) {
> +			return 0;
> +		}
> +		f = fopen(fullpath, "r");
> +		if (f == NULL) {
> +			return 0;
> +		}
>  	}
>  	for (i = 0; i < MAX_LOOP; i++) {
>  		fflush(f);
> --
> 2.17.1



More information about the dev mailing list