Skip to contentSkip to conversation

ch: don't use GFP_DMA

PATCH Applied Christoph Hellwig 2 participants 2 messages Dec 22, 2021 – Dec 23, 2021 SCSI

v1 of 2 Applied Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ch: don't use GFP_DMA

The allocated buffers are used as a command payload, for which the block layer and/or DMA API do the proper bounce buffering if needed.

---
 drivers/scsi/ch.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/scsi/ch.c +3 -3
index 6fa300daa31ea..9088548698646 100644
@@ -239,7 +239,7 @@ ch_read_element_status(scsi_changer *ch, u_int elem, char *data)
 	u_char  *buffer;
 	int     result;
 
-	buffer = kmalloc(512, GFP_KERNEL | GFP_DMA);
+	buffer = kmalloc(512, GFP_KERNEL);
 	if(!buffer)
 		return -ENOMEM;
 
@@ -297,7 +297,7 @@ ch_readconfig(scsi_changer *ch)
 	int     result,id,lun,i;
 	u_int   elem;
 
-	buffer = kzalloc(512, GFP_KERNEL | GFP_DMA);
+	buffer = kzalloc(512, GFP_KERNEL);
 	if (!buffer)
 		return -ENOMEM;
 
@@ -783,7 +783,7 @@ static long ch_ioctl(struct file *file,
 			return -EINVAL;
 		elem = ch->firsts[cge.cge_type] + cge.cge_unit;
 
-		buffer = kmalloc(512, GFP_KERNEL | GFP_DMA);
+		buffer = kmalloc(512, GFP_KERNEL);
 		if (!buffer)
 			return -ENOMEM;
 		mutex_lock(&ch->lock);
Signature · 1 line
2.30.2
#1 lore raw

Christoph,

Quoted 2 lines

The allocated buffers are used as a command payload, for which the block layer and/or DMA API do the proper bounce buffering if needed.

Applied to 5.17/scsi-staging, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering