 /* we must lengthen transfers to end on a 32-bit boundary */ qc->pad_len = sg->length & 3; if (qc->pad_len) { void *pad_buf = ap->pad + (qc->tag * ATA_DMA_PAD_SZ); struct scatterlist *psg = &qc->pad_sgent;  assert(qc->dev->class == ATA_DEV_ATAPI);  memset(pad_buf, 0, ATA_DMA_PAD_SZ);  if (qc->tf.flags & ATA_TFLAG_WRITE) memcpy(pad_buf, qc->buf_virt + sg->length - qc->pad_len, qc->pad_len);  sg_dma_address(psg) = ap->pad_dma + (qc->tag * ATA_DMA_PAD_SZ); sg_dma_len(psg) = ATA_DMA_PAD_SZ; /* trim sg */ sg->length -= qc->pad_len;  DPRINTK("padding done, sg->length=%u pad_len=%u\n", sg->length, qc->pad_len); } 
static int ata_sg_setup_one(struct ata_queued_cmd *qc){	struct ata_port *ap = qc->ap;	int dir = qc->dma_dir;	struct scatterlist *sg = qc->sg;	dma_addr_t dma_address;	dma_address = dma_map_single(ap->host_set->dev, qc->buf_virt,				     sg->length, dir);	if (dma_mapping_error(dma_address))		return -1;	sg_dma_address(sg) = dma_address;	sg_dma_len(sg) = sg->length;	DPRINTK("mapped buffer of %d bytes for %s\n", sg_dma_len(sg),		qc->tf.flags & ATA_TFLAG_WRITE ? "write" : "read");	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/cedc9a478d8c6265879dc3839ef3d4849a709184/libata-core.c/clean/drivers/scsi/libata-core.c