On 21/03/2023 11:47 am, Sergey Dyasli wrote: > diff --git a/tools/libs/ctrl/xc_misc.c b/tools/libs/ctrl/xc_misc.c > index 265f15ec2d..f2f6e4348e 100644 > --- a/tools/libs/ctrl/xc_misc.c > +++ b/tools/libs/ctrl/xc_misc.c > @@ -226,6 +226,26 @@ int xc_microcode_update(xc_interface *xch, const void > *buf, size_t len) > return ret; > } > > +int xc_get_cpu_version(xc_interface *xch, struct xenpf_pcpu_version *cpu_ver) > +{ > + int ret; > + DECLARE_PLATFORM_OP; > + > + if ( !xch || !cpu_ver ) > + return -1;
We don't check parameters like this anywhere else. It's library code, and the caller is required to DTRT. Also, we're phasing out the use of the DECLARE macros. This wants to change to struct xen_platform_op op = { .cmd = XENPF_get_cpu_version, .u.pcpu_version.xen_cpuid = cpu_ver->xen_cpuid, }; Both can be fixed on commit, if you're happy. ~Andrew