xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xen.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Keir Fraser <keir@xen.org>, Jan Beulich <JBeulich@suse.com>
Subject: [PATCH 1/4] xen/irq: irq_to_desc() can't return NULL
Date: Tue, 24 Sep 2013 13:10:35 +0100	[thread overview]
Message-ID: <1380024638-14983-2-git-send-email-andrew.cooper3@citrix.com> (raw)
In-Reply-To: <1380024638-14983-1-git-send-email-andrew.cooper3@citrix.com>

So NULL checks are logically dead code.

Coverity IDs: 1055247, 1087147

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Keir Fraser <keir@xen.org>
CC: Jan Beulich <JBeulich@suse.com>
---
 xen/arch/x86/hvm/vmsi.c |    2 --
 xen/arch/x86/irq.c      |    2 --
 2 files changed, 4 deletions(-)

diff --git a/xen/arch/x86/hvm/vmsi.c b/xen/arch/x86/hvm/vmsi.c
index 4826b4a..b0766a4 100644
--- a/xen/arch/x86/hvm/vmsi.c
+++ b/xen/arch/x86/hvm/vmsi.c
@@ -304,8 +304,6 @@ static int msixtbl_write(struct vcpu *v, unsigned long address,
         goto out;
     
     desc = irq_to_desc(msi_desc->irq);
-    if ( !desc )
-        goto out;
 
     spin_lock_irqsave(&desc->lock, flags);
 
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index c61cc46..e6036ec 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -646,8 +646,6 @@ void irq_move_cleanup_interrupt(struct cpu_user_regs *regs)
             continue;
 
         desc = irq_to_desc(irq);
-        if (!desc)
-            continue;
 
         spin_lock(&desc->lock);
         if (!desc->arch.move_cleanup_count)
-- 
1.7.10.4

  reply	other threads:[~2013-09-24 12:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-24 12:10 [PATCH 0/4] Misc Xen fixes identified by Coverity Andrew Cooper
2013-09-24 12:10 ` Andrew Cooper [this message]
2013-09-24 13:05   ` [PATCH 1/4] xen/irq: irq_to_desc() can't return NULL Jan Beulich
2013-09-24 12:10 ` [PATCH 2/4] x86/hap: Remove bogus assertion in hap_free_p2m_page() Andrew Cooper
2013-09-24 12:26   ` Tim Deegan
2013-09-24 12:10 ` [PATCH 3/4] common/page_alloc: Remove node id ASSERT()s Andrew Cooper
2013-09-24 13:13   ` Jan Beulich
2013-09-24 12:10 ` [PATCH 4/4] x86/microcode_amd: Fail attempts to load a 0-length microcode blob Andrew Cooper
2013-09-24 13:19   ` Jan Beulich
2013-09-24 14:26     ` Boris Ostrovsky
2013-09-24 14:31       ` Jan Beulich
2013-09-24 14:31       ` Andrew Cooper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1380024638-14983-2-git-send-email-andrew.cooper3@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=keir@xen.org \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).