public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ben Dooks <ben-linux@fluff.org>
To: Stefan Roas <sroas@roath.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH]: Fix compiler warning in drivers/scsi/dpt_i2o.c
Date: Mon, 14 Mar 2005 18:24:44 +0000	[thread overview]
Message-ID: <20050314182444.GA6903@home.fluff.org> (raw)
In-Reply-To: <20050313224351.GA1731@roath.org>

On Sun, Mar 13, 2005 at 11:43:51PM +0100, Stefan Roas wrote:
> Hi there!
> 
> The attachted patch fixes a compiler warning in drivers/scsi/dpt_i2o.c.
> 
> If you reply to this post, please CC me as I'm not suscribed to the
> list.

This patch looks suspiciously like it is sweeping the problem
`under the carpet`. Does bus_to_virt() return an `void __iomem *`?

reply should really be an `void __iomem *` 
 
> Best Regards
> 
> -- 
> Stefan Roas
> sroas@roath.org

> diff -rNu a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c
> --- a/drivers/scsi/dpt_i2o.c	2005-03-02 14:01:26.910737000 +0100
> +++ b/drivers/scsi/dpt_i2o.c	2005-03-04 11:28:57.339003000 +0100
> @@ -2027,8 +2027,8 @@
>  		}
>  		reply = (ulong)bus_to_virt(m);
>  
> -		if (readl(reply) & MSG_FAIL) {
> -			u32 old_m = readl(reply+28); 
> +		if (readl((void *)reply) & MSG_FAIL) {
> +			u32 old_m = readl((void *)reply+28); 
>  			ulong msg;
>  			u32 old_context;
>  			PDEBUG("%s: Failed message\n",pHba->name);
> @@ -2039,34 +2039,34 @@
>  			}
>  			// Transaction context is 0 in failed reply frame
>  			msg = (ulong)(pHba->msg_addr_virt + old_m);
> -			old_context = readl(msg+12);
> +			old_context = readl((void *)msg+12);
>  			writel(old_context, reply+12);
>  			adpt_send_nop(pHba, old_m);
>  		} 
> -		context = readl(reply+8);
> +		context = readl((void *)reply+8);
>  		if(context & 0x40000000){ // IOCTL
> -			ulong p = (ulong)(readl(reply+12));
> +			ulong p = (ulong)(readl((void *)reply+12));
>  			if( p != 0) {
>  				memcpy((void*)p, (void*)reply, REPLY_FRAME_SIZE * 4);
>  			}
>  			// All IOCTLs will also be post wait
>  		}
>  		if(context & 0x80000000){ // Post wait message
> -			status = readl(reply+16);
> +			status = readl((void *)reply+16);
>  			if(status  >> 24){
>  				status &=  0xffff; /* Get detail status */
>  			} else {
>  				status = I2O_POST_WAIT_OK;
>  			}
>  			if(!(context & 0x40000000)) {
> -				cmd = (struct scsi_cmnd*) readl(reply+12); 
> +				cmd = (struct scsi_cmnd*) readl((void *)reply+12); 
>  				if(cmd != NULL) {
>  					printk(KERN_WARNING"%s: Apparent SCSI cmd in Post Wait Context - cmd=%p context=%x\n", pHba->name, cmd, context);
>  				}
>  			}
>  			adpt_i2o_post_wait_complete(context, status);
>  		} else { // SCSI message
> -			cmd = (struct scsi_cmnd*) readl(reply+12); 
> +			cmd = (struct scsi_cmnd*) readl((void *)reply+12); 
>  			if(cmd != NULL){
>  				if(cmd->serial_number != 0) { // If not timedout
>  					adpt_i2o_to_scsi(reply, cmd);
> @@ -2236,16 +2236,16 @@
>  	adpt_hba* pHba;
>  	u32 hba_status;
>  	u32 dev_status;
> -	u32 reply_flags = readl(reply) & 0xff00; // Leave it shifted up 8 bits 
> +	u32 reply_flags = readl((void *)reply) & 0xff00; // Leave it shifted up 8 bits 
>  	// I know this would look cleaner if I just read bytes
>  	// but the model I have been using for all the rest of the
>  	// io is in 4 byte words - so I keep that model
> -	u16 detailed_status = readl(reply+16) &0xffff;
> +	u16 detailed_status = readl((void *)reply+16) &0xffff;
>  	dev_status = (detailed_status & 0xff);
>  	hba_status = detailed_status >> 8;
>  
>  	// calculate resid for sg 
> -	cmd->resid = cmd->request_bufflen - readl(reply+5);
> +	cmd->resid = cmd->request_bufflen - readl((void *)reply+5);
>  
>  	pHba = (adpt_hba*) cmd->device->host->hostdata[0];
>  
> @@ -2256,7 +2256,7 @@
>  		case I2O_SCSI_DSC_SUCCESS:
>  			cmd->result = (DID_OK << 16);
>  			// handle underflow
> -			if(readl(reply+5) < cmd->underflow ) {
> +			if(readl((void *)reply+5) < cmd->underflow ) {
>  				cmd->result = (DID_ERROR <<16);
>  				printk(KERN_WARNING"%s: SCSI CMD underflow\n",pHba->name);
>  			}




-- 
Ben (ben@fluff.org, http://www.fluff.org/)

  'a smiley only costs 4 bytes'

  reply	other threads:[~2005-03-14 18:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-13 22:43 [PATCH]: Fix compiler warning in drivers/scsi/dpt_i2o.c Stefan Roas
2005-03-14 18:24 ` Ben Dooks [this message]
2005-03-14 20:06   ` Stefan Roas
2005-03-14 23:26     ` Russell King

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=20050314182444.GA6903@home.fluff.org \
    --to=ben-linux@fluff.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sroas@roath.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