[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 1/3] x86/nmi: Corrections and improvements to do_nmi_stats()



On 17.02.2020 12:17, Andrew Cooper wrote:
> --- a/xen/arch/x86/nmi.c
> +++ b/xen/arch/x86/nmi.c
> @@ -587,25 +587,25 @@ static void do_nmi_trigger(unsigned char key)
>  
>  static void do_nmi_stats(unsigned char key)
>  {
> -    int i;
> -    struct domain *d;
> -    struct vcpu *v;
> +    const struct vcpu *v;
> +    unsigned int cpu;
> +    bool pend, mask;
>  
>      printk("CPU\tNMI\n");
> -    for_each_online_cpu ( i )
> -        printk("%3d\t%3d\n", i, nmi_count(i));
> +    for_each_online_cpu ( cpu )
> +        printk("%3d\t%3d\n", cpu, nmi_count(cpu));

%3u twice then please. With this
Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
but I have one more remark:

> -    if ( ((d = hardware_domain) == NULL) || (d->vcpu == NULL) ||
> -         ((v = d->vcpu[0]) == NULL) )
> +    if ( !hardware_domain || !hardware_domain->vcpu ||
> +         !(v = hardware_domain->vcpu[0]) )

Perhaps, just for readability and consistency, use domain_vcpu()
here?

Jan

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.