From: Pierre Chevalier <pierrechevalier83@gmail.com>
To: agk@redhat.com
Cc: linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org,
Pierre Chevalier <pierrechevalier83@gmail.com>
Subject: [PATCH] drivers: md: remove duplication with time_after
Date: Thu, 5 Feb 2015 21:39:30 +0000 [thread overview]
Message-ID: <1423172370-32113-1-git-send-email-pierrechevalier83@gmail.com> (raw)
The logic that was expressed previously was equivalent of calling
time_after.
Remove duplication.
Signed-off-by: Pierre Chevalier <pierrechevalier83@gmail.com>
---
drivers/md/dm-cache-target.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/md/dm-cache-target.c b/drivers/md/dm-cache-target.c
index e165053..855e3b3 100644
--- a/drivers/md/dm-cache-target.c
+++ b/drivers/md/dm-cache-target.c
@@ -14,6 +14,7 @@
#include <linux/init.h>
#include <linux/mempool.h>
#include <linux/module.h>
+#include <linux/jiffies.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
@@ -1562,8 +1563,7 @@ static void process_bio(struct cache *cache, struct prealloc *structs,
static int need_commit_due_to_time(struct cache *cache)
{
- return jiffies < cache->last_commit_jiffies ||
- jiffies > cache->last_commit_jiffies + COMMIT_PERIOD;
+ return time_after(jiffies, cache->last_commit_jiffies + COMMIT_PERIOD);
}
static int commit_if_needed(struct cache *cache)
--
2.2.2
reply other threads:[~2015-02-05 21:40 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1423172370-32113-1-git-send-email-pierrechevalier83@gmail.com \
--to=pierrechevalier83@gmail.com \
--cc=agk@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-raid@vger.kernel.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
all inboxes | Powered by JetHome®