linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jack Hammer <jack_hammer@adaptec.com>
To: akmpm@osdl.org, James.Bottomley@steeleye.com,
	linux-scsi@vger.kernel.org, ipslinux@adaptec.com
Subject: ips.c warnings
Date: Thu, 20 Oct 2005 12:59:54 -0400	[thread overview]
Message-ID: <4357CD0A.10300@adaptec.com> (raw)

This patch ( applied to 2.6.14-rc4-mm1 ) keeps all the ips code intact for both 2.4 and 2.6 kernels, and should eliminate the compiler warnings ( in 2.6 ) reported by Andrew.

I did not use kmap() because these routines can be called from the interrupt handler context and kmap() can sleep.


--- 2.6.14-rc4/drivers/scsi/ips.c	Thu Oct 20 11:26:50 2005
+++ devel/drivers/scsi/ips.c	Thu Oct 20 11:33:39 2005
@@ -220,13 +220,15 @@
 #include <linux/blk.h>
 #include "sd.h"
 #define IPS_SG_ADDRESS(sg)       ((sg)->address)
+#define IPS_CHECK_SG_ADDRESS(sg) ((sg)->address)
 #define IPS_LOCK_SAVE(lock,flags) spin_lock_irqsave(&io_request_lock,flags)
 #define IPS_UNLOCK_RESTORE(lock,flags) spin_unlock_irqrestore(&io_request_lock,flags)
 #ifndef __devexit_p
 #define __devexit_p(x) x
 #endif
 #else
-#define IPS_SG_ADDRESS(sg)      (page_address((sg)->page) ? \
+#define IPS_SG_ADDRESS(sg)       page_address((sg)->page)+(sg)->offset
+#define IPS_CHECK_SG_ADDRESS(sg) (page_address((sg)->page) ? \
                                    page_address((sg)->page)+(sg)->offset : NULL)
 #define IPS_LOCK_SAVE(lock,flags) do{spin_lock(lock);(void)flags;}while(0)
 #define IPS_UNLOCK_RESTORE(lock,flags) do{spin_unlock(lock);(void)flags;}while(0)
@@ -3659,7 +3661,7 @@
 		struct scatterlist *sg = scmd->request_buffer;
 		for (i = 0, xfer_cnt = 0;
 		     (i < scmd->use_sg) && (xfer_cnt < count); i++) {
-			if (!IPS_SG_ADDRESS(&sg[i]))
+			if (!IPS_CHECK_SG_ADDRESS(&sg[i]))
 				return;
 			min_cnt = min(count - xfer_cnt, sg[i].length);
 			memcpy(IPS_SG_ADDRESS(&sg[i]), &cdata[xfer_cnt],
@@ -3691,7 +3693,7 @@
 		struct scatterlist *sg = scmd->request_buffer;
 		for (i = 0, xfer_cnt = 0;
 		     (i < scmd->use_sg) && (xfer_cnt < count); i++) {
-			if (!IPS_SG_ADDRESS(&sg[i]))
+			if (!IPS_CHECK_SG_ADDRESS(&sg[i]))
 				return;
 			min_cnt = min(count - xfer_cnt, sg[i].length);
 			memcpy(&cdata[xfer_cnt], IPS_SG_ADDRESS(&sg[i]),

             reply	other threads:[~2005-10-20 17:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-20 16:59 Jack Hammer [this message]
2005-10-20 17:05 ` ips.c warnings Matthew Wilcox
  -- strict thread matches above, loose matches on Subject: below --
2005-10-20 17:59 IpsLinux
2005-10-20 17:38 Salyzyn, Mark
2005-10-20 17:39 ` Christoph Hellwig
2005-10-20 17:33 IpsLinux
2005-10-20 17:25 Hammer, Jack
2005-10-20 17:29 ` Christoph Hellwig
2005-10-20 17:54   ` James Bottomley
2005-10-16 21:08 Andrew Morton
2005-10-16 22:44 ` James Bottomley
2005-10-16 22:57   ` Andrew Morton
2005-10-16 23:11     ` James Bottomley
2005-10-16 23:24       ` Andrew Morton

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=4357CD0A.10300@adaptec.com \
    --to=jack_hammer@adaptec.com \
    --cc=James.Bottomley@steeleye.com \
    --cc=akmpm@osdl.org \
    --cc=ipslinux@adaptec.com \
    --cc=linux-scsi@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;
as well as URLs for NNTP newsgroup(s).