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

Re: [Xen-devel] [PATCH v2] x86/domctl: remove impossible condition in XEN_DOMCTL_getpageframeinfo3



>>> On 09.03.18 at 17:23, <olaf@xxxxxxxxx> wrote:
> --- a/xen/arch/x86/domctl.c
> +++ b/xen/arch/x86/domctl.c
> @@ -415,14 +415,13 @@ long arch_do_domctl(
>  
>      case XEN_DOMCTL_getpageframeinfo3:
>      {
> -        unsigned int num = domctl->u.getpageframeinfo3.num;
> +        unsigned long num = domctl->u.getpageframeinfo3.num;
>          unsigned int width = has_32bit_shinfo(currd) ? 4 : 8;
>  
>          /* Games to allow this code block to handle a compat guest. */
>          void __user *guest_handle = domctl->u.getpageframeinfo3.array.p;
>  
> -        if ( unlikely(num > XEN_GETPAGEFRAMEINFO3_MAX_SIZE) ||
> -             unlikely(num != domctl->u.getpageframeinfo3.num) )
> +        if ( unlikely(num > XEN_GETPAGEFRAMEINFO3_MAX_SIZE) )

IMO this doesn't improve anything. If you wanted the types to
remain in sync (and document that), you'd need to use typeof().

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®.