public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Grant Grundler <grundler@parisc-linux.org>
To: James Bottomley <James.Bottomley@hansenpartnership.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
	akpm@linux-foundation.org, linux-scsi@vger.kernel.org,
	fujita.tomonori@lab.ntt.co.jp
Subject: Re: [patch 13/17] drivers/scsi/initio.c: suppress compile warning
Date: Sat, 5 Apr 2008 10:14:22 -0600	[thread overview]
Message-ID: <20080405161422.GA19742@colo.lackof.org> (raw)
In-Reply-To: <da824cf30804040005w7ae131c5he1248462041a658a@mail.gmail.com>

On Fri, Apr 04, 2008 at 12:05:01AM -0700, Grant Grundler wrote:
> On Fri, Mar 28, 2008 at 8:09 PM, James Bottomley
> <James.Bottomley@hansenpartnership.com> wrote:
> ...
> >  If you can verify my analysis of the way the driver works, then the
> >  complete fix should be pretty simple: just remove the cpu_to_le32 from
> >  everywhere except the sg list construction.

Ok...here's a patch that builds clean on parisc (Big endian) and I *think*
addresses the issues we found.

thanks,
grant

---

Most of the cpu_to_le32() usage was wrong in one way or another.
Compiler warning on BE builds was just the tip of the iceberg.
This patch attempts to make this driver work on BE though I
don't have the HW to test it.

Signed-off-by: Grant Grundler <grundler@parisc-linux.org>

diff --git a/drivers/scsi/initio.c b/drivers/scsi/initio.c
index 0cc8868..dbae3fd 100644
--- a/drivers/scsi/initio.c
+++ b/drivers/scsi/initio.c
@@ -2581,8 +2581,8 @@ static void initio_build_scb(struct initio_host * host, struct scsi_ctrl_blk * c
 	/* Map the sense buffer into bus memory */
 	dma_addr = dma_map_single(&host->pci_dev->dev, cmnd->sense_buffer,
 				  SENSE_SIZE, DMA_FROM_DEVICE);
-	cblk->senseptr = cpu_to_le32((u32)dma_addr);
-	cblk->senselen = cpu_to_le32(SENSE_SIZE);
+	cblk->senseptr = (u32)dma_addr;
+	cblk->senselen = SENSE_SIZE;
 	cmnd->SCp.ptr = (char *)(unsigned long)dma_addr;
 	cblk->cdblen = cmnd->cmd_len;
 
@@ -2606,7 +2606,7 @@ static void initio_build_scb(struct initio_host * host, struct scsi_ctrl_blk * c
 		dma_addr = dma_map_single(&host->pci_dev->dev, &cblk->sglist[0],
 					  sizeof(struct sg_entry) * TOTAL_SG_ENTRY,
 					  DMA_BIDIRECTIONAL);
-		cblk->bufptr = cpu_to_le32((u32)dma_addr);
+		cblk->bufptr = (u32)dma_addr;
 		cmnd->SCp.dma_handle = dma_addr;
 
 		cblk->sglen = nseg;
@@ -2616,7 +2616,8 @@ static void initio_build_scb(struct initio_host * host, struct scsi_ctrl_blk * c
 		sg = &cblk->sglist[0];
 		scsi_for_each_sg(cmnd, sglist, cblk->sglen, i) {
 			sg->data = cpu_to_le32((u32)sg_dma_address(sglist));
-			total_len += sg->len = cpu_to_le32((u32)sg_dma_len(sglist));
+			sg->len = cpu_to_le32((u32)sg_dma_len(sglist));
+			total_len += sg_dma_len(sglist);
 			++sg;
 		}
 

      reply	other threads:[~2008-04-05 16:14 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-28 21:48 [patch 13/17] drivers/scsi/initio.c: suppress compile warning akpm
2008-03-28 21:55 ` Grant Grundler
2008-03-28 22:13   ` Andrew Morton
2008-03-28 22:26   ` James Bottomley
2008-03-28 22:43     ` Alan Cox
2008-03-28 23:51       ` James Bottomley
2008-03-29  0:49         ` Grant Grundler
2008-03-29  3:09           ` James Bottomley
2008-03-31  4:50             ` Grant Grundler
2008-03-31 14:56               ` James Bottomley
2008-03-31 16:23                 ` Grant Grundler
2008-04-04  7:05             ` Grant Grundler
2008-04-05 16:14               ` Grant Grundler [this message]

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=20080405161422.GA19742@colo.lackof.org \
    --to=grundler@parisc-linux.org \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=fujita.tomonori@lab.ntt.co.jp \
    --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