public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Rusty Trivial Russell <rusty@rustcorp.com.au>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: linux-scsi@vger.kernel.org
Subject: [TRIVIAL] [PATCH ] remove check_region from drivers_scsi_cpqfcTSinit.c
Date: Tue, 14 Jan 2003 13:46:38 +1100	[thread overview]
Message-ID: <20030114025452.E7CC92C279@lists.samba.org> (raw)

From:  william stinson <wstinson@wanadoo.fr>

  Hi Amy,
  
  this proposed patch for drivers/scsi/cpqfcTSinit.c scsi driver for Linux removes two calls to check_region using request_region instead
  
  I don't have this hardware so patch is not tested. This patch removes all references to check_region in this driver.
  
  Patch also available at the following URL:
              
          http://www.chez.com/wstinson/linux/kernel/patch-scsi-cpqfcTSinit
     
  This is patch number 28 in a series of check_region patches I am doing as
   part of the kernel janitors project. Removal of check_region is one of the
   items on the kernel janitors TODO list (http://www.kerneljanitors.org/TODO)
   - get rid of check_region, use just request_region checking its return (2.2
   request_region returned void) and now the driver init sequence is not to be
   serialized anymore, so races are possible (look at cardbus/pcihotplug code)
  
  Best regards
  William Stinson
  

--- trivial-2.5.57/drivers/scsi/cpqfcTSinit.c.orig	2003-01-14 12:54:31.000000000 +1100
+++ trivial-2.5.57/drivers/scsi/cpqfcTSinit.c	2003-01-14 12:54:31.000000000 +1100
@@ -384,7 +384,8 @@
 
       // Since we have two 256-byte I/O port ranges (upper
       // and lower), check them both
-      if( check_region( cpqfcHBAdata->fcChip.Registers.IOBaseU, 0xff) )
+      if( !request_region( cpqfcHBAdata->fcChip.Registers.IOBaseU,
+      	                   0xff, DEV_NAME ) )
       {
 	printk("  cpqfcTS address in use: %x\n", 
 			cpqfcHBAdata->fcChip.Registers.IOBaseU);
@@ -393,21 +394,21 @@
 	continue;
       }	
       
-      if( check_region( cpqfcHBAdata->fcChip.Registers.IOBaseL, 0xff) )
+      if( !request_region( cpqfcHBAdata->fcChip.Registers.IOBaseL,
+      			   0xff, DEV_NAME ) )
       {
   	printk("  cpqfcTS address in use: %x\n", 
 	      			cpqfcHBAdata->fcChip.Registers.IOBaseL);
+	release_region( cpqfcHBAdata->fcChip.Registers.IOBaseU, 0xff );
 	free_irq( HostAdapter->irq, HostAdapter);
         scsi_unregister( HostAdapter);
 	continue;
       }	
       
-      // OK, we should be able to grab everything we need now.
-      request_region( cpqfcHBAdata->fcChip.Registers.IOBaseL, 0xff, DEV_NAME);
-      request_region( cpqfcHBAdata->fcChip.Registers.IOBaseU, 0xff, DEV_NAME);
-      DEBUG_PCI(printk("  Requesting 255 I/O addresses @ %x\n",
+      // OK, we have grabbed everything we need now.
+      DEBUG_PCI(printk("  Reserved 255 I/O addresses @ %x\n",
         cpqfcHBAdata->fcChip.Registers.IOBaseL ));
-      DEBUG_PCI(printk("  Requesting 255 I/O addresses @ %x\n",
+      DEBUG_PCI(printk("  Reserved 255 I/O addresses @ %x\n",
         cpqfcHBAdata->fcChip.Registers.IOBaseU ));
 
      
-- 
  Don't blame me: the Monkey is driving
  File: william stinson <wstinson@wanadoo.fr>: [PATCH ] remove check_region from drivers_scsi_cpqfcTSinit.c

             reply	other threads:[~2003-01-14  2:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-14  2:46 Rusty Trivial Russell [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-01-06  4:04 [TRIVIAL] [PATCH ] remove check_region from drivers_scsi_cpqfcTSinit.c Rusty Trivial Russell

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=20030114025452.E7CC92C279@lists.samba.org \
    --to=rusty@rustcorp.com.au \
    --cc=linux-scsi@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /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