[SCSI] fusion - mptctl - Event Log Fix
authorMoore, Eric <Eric.Moore@lsil.com>
Fri, 3 Feb 2006 00:19:40 +0000 (17:19 -0700)
committer <jejb@mulgrave.il.steeleye.com> <>
Sat, 4 Feb 2006 22:32:18 +0000 (16:32 -0600)
Use the hard coded value MPTCTL_EVENT_LOG_SIZE to fix
bug where in certain cases, the ioc->eventLogSize was
initialized.

Signed-off-by: Eric Moore <Eric.Moore@lsil.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
drivers/message/fusion/mptbase.c
drivers/message/fusion/mptctl.c
drivers/message/fusion/mptscsih.c

index 9a2c7605d49c930a45c10aaad9b3cc772dd2805e..a3751d86216eb421b4e41dc0d5b45345f317f4cc 100644 (file)
@@ -6142,7 +6142,7 @@ ProcessEventNotification(MPT_ADAPTER *ioc, EventNotificationReply_t *pEventReply
        if (ioc->events && (ioc->eventTypes & ( 1 << event))) {
                int idx;
 
-               idx = ioc->eventContext % ioc->eventLogSize;
+               idx = ioc->eventContext % MPTCTL_EVENT_LOG_SIZE;
 
                ioc->events[idx].event = event;
                ioc->events[idx].eventContext = ioc->eventContext;
index 8e2369ff3322f0db68bdae392264d058d33d132d..b603fb8e604b82a43371cb8bed0596beef7b5a54 100644 (file)
@@ -1501,7 +1501,7 @@ mptctl_eventquery (unsigned long arg)
                return -ENODEV;
        }
 
-       karg.eventEntries = ioc->eventLogSize;
+       karg.eventEntries = MPTCTL_EVENT_LOG_SIZE;
        karg.eventTypes = ioc->eventTypes;
 
        /* Copy the data from kernel memory to user memory
@@ -1551,7 +1551,6 @@ mptctl_eventenable (unsigned long arg)
                memset(ioc->events, 0, sz);
                ioc->alloc_total += sz;
 
-               ioc->eventLogSize = MPTCTL_EVENT_LOG_SIZE;
                ioc->eventContext = 0;
         }
 
@@ -1591,7 +1590,7 @@ mptctl_eventreport (unsigned long arg)
        maxEvents = numBytes/sizeof(MPT_IOCTL_EVENTS);
 
 
-       max = ioc->eventLogSize < maxEvents ? ioc->eventLogSize : maxEvents;
+       max = MPTCTL_EVENT_LOG_SIZE < maxEvents ? MPTCTL_EVENT_LOG_SIZE : maxEvents;
 
        /* If fewer than 1 event is requested, there must have
         * been some type of error.
index 05789e50546491df632331c58b6b5ff3e867f4fa..4fee6befc93d0e900fa66fae4e837ef8ac054b51 100644 (file)
@@ -2489,7 +2489,7 @@ mptscsih_copy_sense_data(struct scsi_cmnd *sc, MPT_SCSI_HOST *hd, MPT_FRAME_HDR
                                int idx;
                                MPT_ADAPTER *ioc = hd->ioc;
 
-                               idx = ioc->eventContext % ioc->eventLogSize;
+                               idx = ioc->eventContext % MPTCTL_EVENT_LOG_SIZE;
                                ioc->events[idx].event = MPI_EVENT_SCSI_DEVICE_STATUS_CHANGE;
                                ioc->events[idx].eventContext = ioc->eventContext;