mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: domen@coderock.org
To: dmo@osdl.org
Cc: linux-kernel@vger.kernel.org,
	Marcelo Feitoza Parisi <marcelo@feitoza.com.br>,
	domen@coderock.org
Subject: [patch 1/1] drivers/block/DAC960.c : Use of time_after(), time_after_eq() and time_before() macros
Date: Sun, 31 Jul 2005 13:10:39 +0200	[thread overview]
Message-ID: <20050731111039.202166000@homer> (raw)

[-- Attachment #1: time_after-drivers_block_DAC960 --]
[-- Type: text/plain, Size: 2778 bytes --]

From: Marcelo Feitoza Parisi <marcelo@feitoza.com.br>




Use of time_after(), time_after_eq() and time_before() macros, define at
linux/jiffies.h, which deal with wrapping correctly and are nicer to read.

Signed-off-by: Marcelo Feitoza Parisi <marcelo@feitoza.com.br>
Signed-off-by: Domen Puncer <domen@coderock.org>

---
 DAC960.c |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)

Index: quilt/drivers/block/DAC960.c
===================================================================
--- quilt.orig/drivers/block/DAC960.c
+++ quilt/drivers/block/DAC960.c
@@ -42,6 +42,7 @@
 #include <linux/pci.h>
 #include <linux/init.h>
 #include <linux/wait.h>
+#include <linux/jiffies.h>
 #include <asm/io.h>
 #include <asm/uaccess.h>
 #include "DAC960.h"
@@ -3674,8 +3675,8 @@ static void DAC960_V1_ProcessCompletedCo
 	      (NewEnquiry->EventLogSequenceNumber !=
 	       OldEnquiry->EventLogSequenceNumber) ||
 	      Controller->MonitoringTimerCount == 0 ||
-	      (jiffies - Controller->SecondaryMonitoringTime
-	       >= DAC960_SecondaryMonitoringInterval))
+	      (time_after_eq(jiffies, Controller->SecondaryMonitoringTime
+	       + DAC960_SecondaryMonitoringInterval)))
 	    {
 	      Controller->V1.NeedLogicalDriveInformation = true;
 	      Controller->V1.NewEventLogSequenceNumber =
@@ -5660,8 +5661,8 @@ static void DAC960_MonitoringTimerFuncti
       unsigned int StatusChangeCounter =
 	Controller->V2.HealthStatusBuffer->StatusChangeCounter;
       boolean ForceMonitoringCommand = false;
-      if (jiffies - Controller->SecondaryMonitoringTime
-	  > DAC960_SecondaryMonitoringInterval)
+      if (time_after(jiffies, Controller->SecondaryMonitoringTime
+	  + DAC960_SecondaryMonitoringInterval))
 	{
 	  int LogicalDriveNumber;
 	  for (LogicalDriveNumber = 0;
@@ -5689,8 +5690,8 @@ static void DAC960_MonitoringTimerFuncti
 	   ControllerInfo->ConsistencyChecksActive +
 	   ControllerInfo->RebuildsActive +
 	   ControllerInfo->OnlineExpansionsActive == 0 ||
-	   jiffies - Controller->PrimaryMonitoringTime
-	   < DAC960_MonitoringTimerInterval) &&
+	   time_before(jiffies, Controller->PrimaryMonitoringTime
+	   + DAC960_MonitoringTimerInterval)) &&
 	  !ForceMonitoringCommand)
 	{
 	  Controller->MonitoringTimer.expires =
@@ -5827,8 +5828,8 @@ static void DAC960_Message(DAC960_Messag
       Controller->ProgressBufferLength = Length;
       if (Controller->EphemeralProgressMessage)
 	{
-	  if (jiffies - Controller->LastProgressReportTime
-	      >= DAC960_ProgressReportingInterval)
+	  if (time_after_eq(jiffies, Controller->LastProgressReportTime
+	      + DAC960_ProgressReportingInterval))
 	    {
 	      printk("%sDAC960#%d: %s", DAC960_MessageLevelMap[MessageLevel],
 		     Controller->ControllerNumber, Buffer);

--

                 reply	other threads:[~2005-07-31 11:10 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=20050731111039.202166000@homer \
    --to=domen@coderock.org \
    --cc=dmo@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo@feitoza.com.br \
    /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®