aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/DAC960.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/block/DAC960.c')
-rw-r--r--drivers/block/DAC960.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/drivers/block/DAC960.c b/drivers/block/DAC960.c
index 9bdea2a5cf0e..45bcda544880 100644
--- a/drivers/block/DAC960.c
+++ b/drivers/block/DAC960.c
@@ -41,6 +41,7 @@
41#include <linux/timer.h> 41#include <linux/timer.h>
42#include <linux/pci.h> 42#include <linux/pci.h>
43#include <linux/init.h> 43#include <linux/init.h>
44#include <linux/jiffies.h>
44#include <linux/random.h> 45#include <linux/random.h>
45#include <asm/io.h> 46#include <asm/io.h>
46#include <asm/uaccess.h> 47#include <asm/uaccess.h>
@@ -311,11 +312,10 @@ static boolean DAC960_CreateAuxiliaryStructures(DAC960_Controller_T *Controller)
311 CommandsRemaining = CommandAllocationGroupSize; 312 CommandsRemaining = CommandAllocationGroupSize;
312 CommandGroupByteCount = 313 CommandGroupByteCount =
313 CommandsRemaining * CommandAllocationLength; 314 CommandsRemaining * CommandAllocationLength;
314 AllocationPointer = kmalloc(CommandGroupByteCount, GFP_ATOMIC); 315 AllocationPointer = kzalloc(CommandGroupByteCount, GFP_ATOMIC);
315 if (AllocationPointer == NULL) 316 if (AllocationPointer == NULL)
316 return DAC960_Failure(Controller, 317 return DAC960_Failure(Controller,
317 "AUXILIARY STRUCTURE CREATION"); 318 "AUXILIARY STRUCTURE CREATION");
318 memset(AllocationPointer, 0, CommandGroupByteCount);
319 } 319 }
320 Command = (DAC960_Command_T *) AllocationPointer; 320 Command = (DAC960_Command_T *) AllocationPointer;
321 AllocationPointer += CommandAllocationLength; 321 AllocationPointer += CommandAllocationLength;
@@ -2709,14 +2709,12 @@ DAC960_DetectController(struct pci_dev *PCI_Device,
2709 void __iomem *BaseAddress; 2709 void __iomem *BaseAddress;
2710 int i; 2710 int i;
2711 2711
2712 Controller = (DAC960_Controller_T *) 2712 Controller = kzalloc(sizeof(DAC960_Controller_T), GFP_ATOMIC);
2713 kmalloc(sizeof(DAC960_Controller_T), GFP_ATOMIC);
2714 if (Controller == NULL) { 2713 if (Controller == NULL) {
2715 DAC960_Error("Unable to allocate Controller structure for " 2714 DAC960_Error("Unable to allocate Controller structure for "
2716 "Controller at\n", NULL); 2715 "Controller at\n", NULL);
2717 return NULL; 2716 return NULL;
2718 } 2717 }
2719 memset(Controller, 0, sizeof(DAC960_Controller_T));
2720 Controller->ControllerNumber = DAC960_ControllerCount; 2718 Controller->ControllerNumber = DAC960_ControllerCount;
2721 DAC960_Controllers[DAC960_ControllerCount++] = Controller; 2719 DAC960_Controllers[DAC960_ControllerCount++] = Controller;
2722 Controller->Bus = PCI_Device->bus->number; 2720 Controller->Bus = PCI_Device->bus->number;
@@ -3657,8 +3655,8 @@ static void DAC960_V1_ProcessCompletedCommand(DAC960_Command_T *Command)
3657 (NewEnquiry->EventLogSequenceNumber != 3655 (NewEnquiry->EventLogSequenceNumber !=
3658 OldEnquiry->EventLogSequenceNumber) || 3656 OldEnquiry->EventLogSequenceNumber) ||
3659 Controller->MonitoringTimerCount == 0 || 3657 Controller->MonitoringTimerCount == 0 ||
3660 (jiffies - Controller->SecondaryMonitoringTime 3658 time_after_eq(jiffies, Controller->SecondaryMonitoringTime
3661 >= DAC960_SecondaryMonitoringInterval)) 3659 + DAC960_SecondaryMonitoringInterval))
3662 { 3660 {
3663 Controller->V1.NeedLogicalDriveInformation = true; 3661 Controller->V1.NeedLogicalDriveInformation = true;
3664 Controller->V1.NewEventLogSequenceNumber = 3662 Controller->V1.NewEventLogSequenceNumber =
@@ -5643,8 +5641,8 @@ static void DAC960_MonitoringTimerFunction(unsigned long TimerData)
5643 unsigned int StatusChangeCounter = 5641 unsigned int StatusChangeCounter =
5644 Controller->V2.HealthStatusBuffer->StatusChangeCounter; 5642 Controller->V2.HealthStatusBuffer->StatusChangeCounter;
5645 boolean ForceMonitoringCommand = false; 5643 boolean ForceMonitoringCommand = false;
5646 if (jiffies - Controller->SecondaryMonitoringTime 5644 if (time_after(jiffies, Controller->SecondaryMonitoringTime
5647 > DAC960_SecondaryMonitoringInterval) 5645 + DAC960_SecondaryMonitoringInterval))
5648 { 5646 {
5649 int LogicalDriveNumber; 5647 int LogicalDriveNumber;
5650 for (LogicalDriveNumber = 0; 5648 for (LogicalDriveNumber = 0;
@@ -5672,8 +5670,8 @@ static void DAC960_MonitoringTimerFunction(unsigned long TimerData)
5672 ControllerInfo->ConsistencyChecksActive + 5670 ControllerInfo->ConsistencyChecksActive +
5673 ControllerInfo->RebuildsActive + 5671 ControllerInfo->RebuildsActive +
5674 ControllerInfo->OnlineExpansionsActive == 0 || 5672 ControllerInfo->OnlineExpansionsActive == 0 ||
5675 jiffies - Controller->PrimaryMonitoringTime 5673 time_before(jiffies, Controller->PrimaryMonitoringTime
5676 < DAC960_MonitoringTimerInterval) && 5674 + DAC960_MonitoringTimerInterval)) &&
5677 !ForceMonitoringCommand) 5675 !ForceMonitoringCommand)
5678 { 5676 {
5679 Controller->MonitoringTimer.expires = 5677 Controller->MonitoringTimer.expires =
@@ -5810,8 +5808,8 @@ static void DAC960_Message(DAC960_MessageLevel_T MessageLevel,
5810 Controller->ProgressBufferLength = Length; 5808 Controller->ProgressBufferLength = Length;
5811 if (Controller->EphemeralProgressMessage) 5809 if (Controller->EphemeralProgressMessage)
5812 { 5810 {
5813 if (jiffies - Controller->LastProgressReportTime 5811 if (time_after_eq(jiffies, Controller->LastProgressReportTime
5814 >= DAC960_ProgressReportingInterval) 5812 + DAC960_ProgressReportingInterval))
5815 { 5813 {
5816 printk("%sDAC960#%d: %s", DAC960_MessageLevelMap[MessageLevel], 5814 printk("%sDAC960#%d: %s", DAC960_MessageLevelMap[MessageLevel],
5817 Controller->ControllerNumber, Buffer); 5815 Controller->ControllerNumber, Buffer);