Skip to contentSkip to conversation

trivial: remove various pointless things

PATCH In review Matthew Daley 4 participants 10 messages Nov 8, 2013 – Nov 11, 2013

lore
Share & tools
lore
#0 lore raw

No functional changes (hopefully).

 extras/mini-os/lwip-net.c        |    2 --
 tools/libxc/xc_domain.c          |    3 +--
 tools/libxl/xl_cmdimpl.c         |    4 ++--
 xen/arch/x86/hvm/svm/nestedsvm.c |    1 -
 xen/common/device_tree.c         |    2 +-
 xen/drivers/video/arm_hdlcd.c    |    2 +-
 6 files changed, 5 insertions(+), 9 deletions(-)
#1 lore raw

PATCH 1/6 nestedsvm: remove pointless BUG_ON

It's already handled just above.

---
 xen/arch/x86/hvm/svm/nestedsvm.c |    1 -
 1 file changed, 1 deletion(-)
xen/arch/x86/hvm/svm/nestedsvm.c +0 -1
index e32c872..705b653 100644
@@ -847,7 +847,6 @@ nsvm_vmcb_guest_intercepts_msr(unsigned long *msr_bitmap,
         /* MSR not in the permission map: Let the guest handle it. */
         return NESTEDHVM_VMEXIT_INJECT;
 
-    BUG_ON(msr_bit == NULL);
     msr &= 0x1fff;
 
     if (write)
Signature · 1 line
1.7.10.4
Acked-by on v1 1/6
#2 lore raw

Re: [PATCH 1/6] nestedsvm: remove pointless BUG_ON

Quoted 12 lines · Matthew Daley

It's already handled just above.

---
  xen/arch/x86/hvm/svm/nestedsvm.c |    1 -
  1 file changed, 1 deletion(-)
xen/arch/x86/hvm/svm/nestedsvm.c +0 -0
index e32c872..705b653 100644

xen/arch/x86/hvm/svm/nestedsvm.c nsvm_vmcb_guest_intercepts_msr(unsigned long *msr_bitmap, · line 852

Quoted 7 lines
xen/arch/x86/hvm/svm/nestedsvm.c +0 -1
@@ -847,7 +847,6 @@ nsvm_vmcb_guest_intercepts_msr(unsigned long *msr_bitmap,
          /* MSR not in the permission map: Let the guest handle it. */
          return NESTEDHVM_VMEXIT_INJECT;
 
-    BUG_ON(msr_bit == NULL);
      msr &= 0x1fff;
 
      if (write)
#3 lore raw

PATCH 2/6 xen/arm: remove pointless if subcondition

In reply to Matthew Daley

It's already handled just above.

---
 xen/common/device_tree.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/common/device_tree.c +1 -1
index f7d0215..44253da 100644
@@ -906,7 +906,7 @@ static int dt_translate_one(const struct dt_device_node *parent,
         dt_printk(XENLOG_ERR "DT: no ranges; cannot translate\n");
         return 1;
     }
-    if ( ranges == NULL || rlen == 0 )
+    if ( rlen == 0 )
     {
         offset = dt_read_number(addr, na);
         memset(addr, 0, pna * 4);
Signature · 1 line
1.7.10.4
#4 lore raw

PATCH 3/6 xen/video: remove pointless if subcondition

In reply to Matthew Daley

It's already handled just above.

---
 xen/drivers/video/arm_hdlcd.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/drivers/video/arm_hdlcd.c +1 -1
index dffda9a..647f22c 100644
@@ -150,7 +150,7 @@ void __init video_init(void)
         return;
     }
 
-    if ( !hdlcd_start || !framebuffer_start )
+    if ( !framebuffer_start )
     {
         early_printk(KERN_ERR "HDLCD: framebuffer address missing from device tree, disabling driver\n");
         return;
Signature · 1 line
1.7.10.4
#5 lore raw

PATCH 4/6 libxc: remove pointless null pointer check

In reply to Matthew Daley

ctxt_buf is guaranteed non-null here.

---
 tools/libxc/xc_domain.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
tools/libxc/xc_domain.c +1 -2
index 2cea6e3..1ccafc5 100644
@@ -444,8 +444,7 @@ int xc_domain_hvm_getcontext_partial(xc_interface *xch,
 
     ret = do_domctl(xch, &domctl);
 
-    if ( ctxt_buf )
-        xc_hypercall_bounce_post(xch, ctxt_buf);
+    xc_hypercall_bounce_post(xch, ctxt_buf);
 
     return ret ? -1 : 0;
 }
Signature · 1 line
1.7.10.4
#6 lore raw

PATCH 5/6 xl: remove pointless null pointer check

In reply to Matthew Daley

poolinfo is guaranteed non-null here.

---
 tools/libxl/xl_cmdimpl.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/libxl/xl_cmdimpl.c +2 -2
index 40feb7d..5bd9b15 100644
@@ -5095,8 +5095,8 @@ static int sched_domain_output(libxl_scheduler sched, int (*output)(int),
                 break;
         }
     }
-    if (poolinfo)
-        libxl_cpupoolinfo_list_free(poolinfo, n_pools);
+
+    libxl_cpupoolinfo_list_free(poolinfo, n_pools);
     return 0;
 }
 
Signature · 1 line
1.7.10.4
#7 lore raw

PATCH 6/6 mini-os: remove repeated statement in netfront_input

In reply to Matthew Daley
---
 extras/mini-os/lwip-net.c |    2 --
 1 file changed, 2 deletions(-)
extras/mini-os/lwip-net.c +0 -2
index 9fded11..449b70f 100644
@@ -194,8 +194,6 @@ netfront_input(struct netif *netif, unsigned char* data, int len)
 
   /* points to packet payload, which starts with an Ethernet header */
   ethhdr = p->payload;
-
-  ethhdr = p->payload;
     
   switch (htons(ethhdr->type)) {
   /* IP packet? */
Signature · 1 line
1.7.10.4
Acked-by on v1 6/6
#8 lore raw

Re: [PATCH 6/6] mini-os: remove repeated statement in netfront_input

Quoted 1 line · Matthew Daley, le Fri 08 Nov 2013 13:45:12 +1300, a écrit :
Quoted 20 lines
---
 extras/mini-os/lwip-net.c |    2 --
 1 file changed, 2 deletions(-)
extras/mini-os/lwip-net.c +0 -2
index 9fded11..449b70f 100644
@@ -194,8 +194,6 @@ netfront_input(struct netif *netif, unsigned char* data, int len)
 
   /* points to packet payload, which starts with an Ethernet header */
   ethhdr = p->payload;
-
-  ethhdr = p->payload;
 
   switch (htons(ethhdr->type)) {
   /* IP packet? */
Signature · 1 line
1.7.10.4
Signature · 2 lines
Samuel
<studdud> what the fuck is wtf
#9 lore raw
In reply to Matthew Daley
Quoted 1 line · Matthew Daley

No functional changes (hopefully).

Looks like someone picked up the first and last (x86 & mini-os). The middle 4 (arm + libxl + libxc ones) I've just acked + applied. thanks.

Quoted 14 lines
 extras/mini-os/lwip-net.c        |    2 --
 tools/libxc/xc_domain.c          |    3 +--
 tools/libxl/xl_cmdimpl.c         |    4 ++--
 xen/arch/x86/hvm/svm/nestedsvm.c |    1 -
 xen/common/device_tree.c         |    2 +-
 xen/drivers/video/arm_hdlcd.c    |    2 +-
 6 files changed, 5 insertions(+), 9 deletions(-)

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel