Re: [PATCH] ibmvscsi driver - sixth version

From: James Bottomley
Date: Wed Mar 31 2004 - 17:07:45 EST

On Wed, 2004-03-31 at 16:26, Dave Boutcher wrote:
> Comments always welcomed. I would like to get this upstream if I can,
> since the linux distributors are complaining slightly that it is not.

Actually, this:

+ (u64) (unsigned long)dma_map_single(dev, cmd->request_buffer,
+ cmd->request_bufflen,
+ if (pci_dma_mapping_error(data->virtual_address)) {
+ printk(KERN_ERR
+ "ibmvscsi: Unable to map request_buffer for command!\n");
+ return 0;

Should be


I have no idea why there are two identical APIs for the mapping error,
but since you use the DMA API, you should use its version. You can also
drop the #include <linux/pci.h> as well.


+ sg_mapped = dma_map_sg(dev, sg, cmd->use_sg, DMA_BIDIRECTIONAL);
+ if (pci_dma_mapping_error(sg_dma_address(&sg[0])))
+ return 0;

Is wrong. dma_map_sg returns zero if there's a mapping error, you
should check for that.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at