public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Olien <dmo@osdl.org>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] DAC960, remove redundant (and uninitialized) PciDevice pointer.
Date: Mon, 22 Sep 2003 10:31:23 -0700	[thread overview]
Message-ID: <20030922173123.GA8745@osdl.org> (raw)


this patch fixes a bug that appeared only on Alpha hardware with
DAC960 controllers.  The Command->PciDevice structure member was
never initialized.  This was passed to the pci scatter/gather functions.
This didn't cause a problem for x86 platforms because the scatter/gather
funtions never really used that information.  Alpha platforms do use
that pointer.

The Command->PciDevice field was also redundant with the Controller->PCIDevice
field, which IS initialized properly.  So, eliminating the redundant
structure member and substituting the Controller's member fixes the bug.

-------------------------------------------------------------------------

diff -ur linux-2.6.0-test5-mm4_original/drivers/block/DAC960.c linux-2.6.0-test5-mm4_DAC/drivers/block/DAC960.c
--- linux-2.6.0-test5-mm4_original/drivers/block/DAC960.c	2003-09-22 10:11:29.000000000 -0700
+++ linux-2.6.0-test5-mm4_DAC/drivers/block/DAC960.c	2003-09-22 10:20:35.000000000 -0700
@@ -3300,7 +3300,7 @@
   Command->SegmentCount = blk_rq_map_sg(Controller->RequestQueue,
 		  Command->Request, Command->cmd_sglist);
   /* pci_map_sg MAY change the value of SegCount */
-  Command->SegmentCount = pci_map_sg(Command->PciDevice, Command->cmd_sglist,
+  Command->SegmentCount = pci_map_sg(Controller->PCIDevice, Command->cmd_sglist,
 		 Command->SegmentCount, Command->DmaDirection);
 
   DAC960_QueueReadWriteCommand(Command);
@@ -3336,7 +3336,7 @@
   (void)blk_rq_map_sg(Controller->RequestQueue, Command->Request,
                                         Command->cmd_sglist);
 
-  (void)pci_map_sg(Command->PciDevice, Command->cmd_sglist, 1,
+  (void)pci_map_sg(Controller->PCIDevice, Command->cmd_sglist, 1,
 		                        Command->DmaDirection);
   /*
    * Resubmitting the request sector at a time is really tedious.
@@ -3377,7 +3377,7 @@
 	if (SuccessfulIO)
 		UpToDate = 1;
 
-	pci_unmap_sg(Command->PciDevice, Command->cmd_sglist,
+	pci_unmap_sg(Command->Controller->PCIDevice, Command->cmd_sglist,
 		Command->SegmentCount, Command->DmaDirection);
 
 	 if (!end_that_request_first(Request, UpToDate, Command->BlockCount)) {
diff -ur linux-2.6.0-test5-mm4_original/drivers/block/DAC960.h linux-2.6.0-test5-mm4_DAC/drivers/block/DAC960.h
--- linux-2.6.0-test5-mm4_original/drivers/block/DAC960.h	2003-09-08 12:50:21.000000000 -0700
+++ linux-2.6.0-test5-mm4_DAC/drivers/block/DAC960.h	2003-09-22 10:20:35.000000000 -0700
@@ -2248,7 +2248,6 @@
   int	DmaDirection;
   struct scatterlist *cmd_sglist;
   struct request *Request;
-  struct pci_dev *PciDevice;
   union {
     struct {
       DAC960_V1_CommandMailbox_T CommandMailbox;

                 reply	other threads:[~2003-09-22 17:30 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=20030922173123.GA8745@osdl.org \
    --to=dmo@osdl.org \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@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