[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1205774735.6767.148.camel@localhost.localdomain>
Date: Mon, 17 Mar 2008 12:25:35 -0500
From: James Bottomley <James.Bottomley@...senPartnership.com>
To: Boaz Harrosh <bharrosh@...asas.com>
Cc: linux-scsi <linux-scsi@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel <linux-kernel@...r.kernel.org>,
Andi Kleen <ak@...e.de>
Subject: Re: ultrastor.c is a bit-rot
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@...asas.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@...asas.com>
> CC: Andi Kleen <ak@...e.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists