public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Boaz Harrosh <bharrosh@panasas.com>
Cc: linux-scsi <linux-scsi@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Andi Kleen <ak@suse.de>
Subject: Re: ultrastor.c is a bit-rot
Date: Mon, 17 Mar 2008 12:25:35 -0500	[thread overview]
Message-ID: <1205774735.6767.148.camel@localhost.localdomain> (raw)
In-Reply-To: <47DEA3F3.7070908@panasas.com>

On Mon, 2008-03-17 at 19:01 +0200, Boaz Harrosh wrote:
> In Hebrew we say: "You make me drink Kerosene". 

Slàinte mhath as we say in English.

> An "obvious enough to apply the best straight line fix" submitted below:
> 
> I say dump it, it's unused.
> 
> Boaz
> ---
> From: Boaz Harrosh <bharrosh@panasas.com>
> Date: Mon, 17 Mar 2008 18:40:03 +0200
> Subject: [PATCH] ultrastor: Fix for ISA DMA allocation
> 
> "obvious enough to apply the best straight line fix" submitted
> below.
> 
> Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
> CC: Andi Kleen <ak@suse.de>
> ---
>  drivers/scsi/ultrastor.c |   24 +++++++++++++++++++++---
>  1 files changed, 21 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/scsi/ultrastor.c b/drivers/scsi/ultrastor.c
> index f385dce..04441eb 100644
> --- a/drivers/scsi/ultrastor.c
> +++ b/drivers/scsi/ultrastor.c
> @@ -255,8 +255,9 @@ static struct ultrastor_config
>    unsigned long mscp_free;
>  #endif
>    volatile unsigned char aborted[ULTRASTOR_MAX_CMDS];
> -  struct mscp mscp[ULTRASTOR_MAX_CMDS];
> -} config = {0};
> +  struct mscp *mscp;
> +  dma_addr_t dma;
> +} config;
>  
>  /* Set this to 1 to reset the SCSI bus on error.  */
>  static int ultrastor_bus_reset;
> @@ -646,12 +647,29 @@ static int ultrastor_24f_detect(struct scsi_host_template * tpnt)
>  
>  static int ultrastor_detect(struct scsi_host_template * tpnt)
>  {
> +	int ret;
> +
>  	tpnt->proc_name = "ultrastor";
> -	return ultrastor_14f_detect(tpnt) || ultrastor_24f_detect(tpnt);
> +
> +	if (!config.mscp)
> +		config.mscp = dma_alloc_coherent(NULL,
> +			sizeof(*config.mscp) * ULTRASTOR_MAX_CMDS,
> +			&config.dma, GFP_KERNEL);

Error handling here, I'm afraid; dma_alloc_coherent can return NULL.

Other than that, looks great.

James



  reply	other threads:[~2008-03-17 17:25 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-17 14:59 ultrastor.c is a bit-rot Boaz Harrosh
2008-03-17 15:23 ` James Bottomley
2008-03-17 16:00   ` Boaz Harrosh
2008-03-17 16:03     ` James Bottomley
2008-03-17 17:01       ` Boaz Harrosh
2008-03-17 17:25         ` James Bottomley [this message]
2008-03-17 15:23 ` Matthew Wilcox
2008-03-21 20:41   ` H. Peter Anvin
2008-03-23  9:54     ` Boaz Harrosh
2008-03-23 16:24       ` H. Peter Anvin
2008-03-23 17:16         ` Al Viro
2008-03-23 17:18           ` H. Peter Anvin
2008-03-17 16:07 ` Alan Cox
2008-03-18 22:07 ` Benny Amorsen

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=1205774735.6767.148.camel@localhost.localdomain \
    --to=james.bottomley@hansenpartnership.com \
    --cc=ak@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=bharrosh@panasas.com \
    --cc=linux-kernel@vger.kernel.org \
    --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