User can set max freq to specific cpu by
"xenpm set-scaling-maxfreq [cpuid] <HZ>"
or set max freq to all cpu with default cpuid by
"xenpm set-scaling-maxfreq <HZ>".
Set max freq with default cpuid will cause
segmentation fault after commit id
d4906b5d05.
This patch will fix this issue and add ability
to set max freq with default cpuid.
Signed-off-by: Luwei Kang <luwei.kang@intel.com>
Compile-tested-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
Release-acked-by: Julien Grall <julien.grall@arm.com>
exit(EINVAL);
}
- parse_cpuid(argv[0], cpuid);
- if ( sscanf(argv[1], "%d", val) != 1 )
+ if ( argc > 1 )
+ parse_cpuid(argv[0], cpuid);
+
+ if ( sscanf(argv[argc > 1], "%d", val) != 1 )
{
- fprintf(stderr, "Invalid %s '%s'\n", what, argv[1]);
+ fprintf(stderr, "Invalid %s '%s'\n", what, argv[argc > 1]);
exit(EINVAL);
}
}