qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Sameeh Jubran <sameeh@daynix.com>
To: qemu-devel@nongnu.org, Jason Wang <jasowang@redhat.com>
Cc: Dmitry Fleytman <dmitry@daynix.com>, Yan Vugenfirer <yan@daynix.com>
Subject: [Qemu-devel] [PATCH] e1000: Removing unnecessary if statement
Date: Sun, 29 May 2016 09:37:25 +0300	[thread overview]
Message-ID: <1464503845-29545-1-git-send-email-sameeh@daynix.com> (raw)

Since mit_delay can never be 0 this if statement is
superfluous.

Signed-off-by: Sameeh Jubran <sameeh@daynix.com>
---
 hw/net/e1000.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/hw/net/e1000.c b/hw/net/e1000.c
index 8e79b55..eb903a9 100644
--- a/hw/net/e1000.c
+++ b/hw/net/e1000.c
@@ -365,11 +365,9 @@ set_interrupt_cause(E1000State *s, int index, uint32_t val)
              */
             mit_delay = (mit_delay < 500) ? 500 : mit_delay;
 
-            if (mit_delay) {
-                s->mit_timer_on = 1;
-                timer_mod(s->mit_timer, qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) +
-                          mit_delay * 256);
-            }
+            s->mit_timer_on = 1;
+            timer_mod(s->mit_timer, qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) +
+                      mit_delay * 256);
             s->mit_ide = 0;
         }
     }
-- 
2.5.5

             reply	other threads:[~2016-05-29  6:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-29  6:37 Sameeh Jubran [this message]
2016-05-29  6:44 ` [Qemu-devel] [PATCH] e1000: Removing unnecessary if statement Stefan Weil
2016-05-29  8:42   ` Michael Tokarev

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=1464503845-29545-1-git-send-email-sameeh@daynix.com \
    --to=sameeh@daynix.com \
    --cc=dmitry@daynix.com \
    --cc=jasowang@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=yan@daynix.com \
    /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).