x86/xen: clean up clang build warning
authorColin Ian King <colin.king@canonical.com>
Mon, 18 Sep 2017 09:03:12 +0000 (10:03 +0100)
committerBoris Ostrovsky <boris.ostrovsky@oracle.com>
Thu, 21 Sep 2017 16:34:03 +0000 (12:34 -0400)
In the case where sizeof(maddr) != sizeof(long) p is initialized and
never read and clang throws a warning on this.  Move declaration of
p to clean up the clang build warning:

warning: Value stored to 'p' during its initialization is never read

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
arch/x86/include/asm/xen/hypercall.h

index 9606688caa4bea8db0175fe71fe61d9706108aba..e089c1675a7c667bb1020c63003d53501129fe11 100644 (file)
@@ -552,13 +552,13 @@ static inline void
 MULTI_update_descriptor(struct multicall_entry *mcl, u64 maddr,
                        struct desc_struct desc)
 {
-       u32 *p = (u32 *) &desc;
-
        mcl->op = __HYPERVISOR_update_descriptor;
        if (sizeof(maddr) == sizeof(long)) {
                mcl->args[0] = maddr;
                mcl->args[1] = *(unsigned long *)&desc;
        } else {
+               u32 *p = (u32 *)&desc;
+
                mcl->args[0] = maddr;
                mcl->args[1] = maddr >> 32;
                mcl->args[2] = *p++;