[PATCH] [SCSI] sg.c: SG_DXFER_TO_FROM_DEV mean DMA_BIDIRECTIONAL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



SG_DXFER_TO_FROM_DEV means DMA_BIDIRECTIONAL, not
DMA_FROM_DEVICE.

Signed-off-by: Luben Tuikov <ltuikov@xxxxxxxxx>
---
 drivers/scsi/sg.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

This patch is 8 months old.

     Luben
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index 5a0a193..3f81477 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -608,12 +608,11 @@ sg_write(struct file *filp, const char _
 	if (hp->dxfer_direction == SG_DXFER_TO_FROM_DEV)
 		if (printk_ratelimit())
 			printk(KERN_WARNING
-			       "sg_write: data in/out %d/%d bytes for SCSI command 0x%x--"
-			       "guessing data in;\n" KERN_WARNING "   "
-			       "program %s not setting count and/or reply_len properly\n",
+			       "sg_write: program %s: data in/out %d/%d bytes for SCSI command 0x%x--"
+			       "bidirectional;\n",
+			       current->comm,
 			       old_hdr.reply_len - (int)SZ_SG_HEADER,
-			       input_size, (unsigned int) cmnd[0],
-			       current->comm);
+			       input_size, (unsigned int) cmnd[0]);
 	k = sg_common_write(sfp, srp, cmnd, sfp->timeout, blocking);
 	return (k < 0) ? k : count;
 }
@@ -724,13 +723,13 @@ sg_common_write(Sg_fd * sfp, Sg_request
 	}
 
 	switch (hp->dxfer_direction) {
-	case SG_DXFER_TO_FROM_DEV:
 	case SG_DXFER_FROM_DEV:
 		data_dir = DMA_FROM_DEVICE;
 		break;
 	case SG_DXFER_TO_DEV:
 		data_dir = DMA_TO_DEVICE;
 		break;
+	case SG_DXFER_TO_FROM_DEV:
 	case SG_DXFER_UNKNOWN:
 		data_dir = DMA_BIDIRECTIONAL;
 		break;
-- 
1.4.3.3.g8478


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux