Commit c09a5618 authored by Matthew Wilcox's avatar Matthew Wilcox Committed by Christoph Hellwig

[PATCH] Remove naked GFP_DMA from drivers/scsi/sr.c

In get_sectorsize(), we can already sleep in scsi_wait_req().
In get_capabilities(), we can use GFP_KERNEL because it is only called
from sr_attach() which already does a GFP_KERNEL allocation.
parent 8e902961
...@@ -604,7 +604,7 @@ static void get_sectorsize(struct scsi_cd *cd) ...@@ -604,7 +604,7 @@ static void get_sectorsize(struct scsi_cd *cd)
struct scsi_request *SRpnt = NULL; struct scsi_request *SRpnt = NULL;
request_queue_t *queue; request_queue_t *queue;
buffer = kmalloc(512, GFP_DMA); buffer = kmalloc(512, GFP_KERNEL | GFP_DMA);
if (!buffer) if (!buffer)
goto Enomem; goto Enomem;
SRpnt = scsi_allocate_request(cd->device); SRpnt = scsi_allocate_request(cd->device);
...@@ -698,7 +698,7 @@ static void get_sectorsize(struct scsi_cd *cd) ...@@ -698,7 +698,7 @@ static void get_sectorsize(struct scsi_cd *cd)
goto out; goto out;
} }
void get_capabilities(struct scsi_cd *cd) static void get_capabilities(struct scsi_cd *cd)
{ {
struct cdrom_generic_command cgc; struct cdrom_generic_command cgc;
unsigned char *buffer; unsigned char *buffer;
...@@ -716,9 +716,8 @@ void get_capabilities(struct scsi_cd *cd) ...@@ -716,9 +716,8 @@ void get_capabilities(struct scsi_cd *cd)
"" ""
}; };
buffer = kmalloc(512, GFP_DMA); buffer = kmalloc(512, GFP_KERNEL | GFP_DMA);
if (!buffer) if (!buffer) {
{
printk(KERN_ERR "sr: out of memory.\n"); printk(KERN_ERR "sr: out of memory.\n");
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment