* [PATCH] sr: don't use GFP_DMA in get_capabilities
@ 2021-12-22 9:01 Christoph Hellwig
2021-12-22 9:06 ` Christoph Hellwig
2021-12-28 0:34 ` Tyrel Datwyler
0 siblings, 2 replies; 3+ messages in thread
From: Christoph Hellwig @ 2021-12-22 9:01 UTC (permalink / raw)
To: martin.petersen; +Cc: linux-scsi, bhe
The allocated buffer is used as a command payload, for which the block
layer and/or DMA API do the proper bounce buffering if needed.
Reported-by: Baoquan He <bhe@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/scsi/sr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c
index 14c122839c409..f925b1f1f9ada 100644
--- a/drivers/scsi/sr.c
+++ b/drivers/scsi/sr.c
@@ -855,7 +855,7 @@ static void get_capabilities(struct scsi_cd *cd)
/* allocate transfer buffer */
- buffer = kmalloc(512, GFP_KERNEL | GFP_DMA);
+ buffer = kmalloc(512, GFP_KERNEL);
if (!buffer) {
sr_printk(KERN_ERR, cd, "out of memory.\n");
return;
--
2.30.2
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] sr: don't use GFP_DMA in get_capabilities
2021-12-22 9:01 [PATCH] sr: don't use GFP_DMA in get_capabilities Christoph Hellwig
@ 2021-12-22 9:06 ` Christoph Hellwig
2021-12-28 0:34 ` Tyrel Datwyler
1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2021-12-22 9:06 UTC (permalink / raw)
To: martin.petersen; +Cc: linux-scsi, bhe
Sorry, I'll replace this with a v2 also covering the callsites in
sr_vendor.c.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] sr: don't use GFP_DMA in get_capabilities
2021-12-22 9:01 [PATCH] sr: don't use GFP_DMA in get_capabilities Christoph Hellwig
2021-12-22 9:06 ` Christoph Hellwig
@ 2021-12-28 0:34 ` Tyrel Datwyler
1 sibling, 0 replies; 3+ messages in thread
From: Tyrel Datwyler @ 2021-12-28 0:34 UTC (permalink / raw)
To: Christoph Hellwig, martin.petersen; +Cc: linux-scsi, bhe
On 12/22/21 1:01 AM, Christoph Hellwig wrote:
> The allocated buffer is used as a command payload, for which the block
> layer and/or DMA API do the proper bounce buffering if needed.
>
> Reported-by: Baoquan He <bhe@redhat.com>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> drivers/scsi/sr.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c
> index 14c122839c409..f925b1f1f9ada 100644
> --- a/drivers/scsi/sr.c
> +++ b/drivers/scsi/sr.c
> @@ -855,7 +855,7 @@ static void get_capabilities(struct scsi_cd *cd)
>
>
> /* allocate transfer buffer */
> - buffer = kmalloc(512, GFP_KERNEL | GFP_DMA);
> + buffer = kmalloc(512, GFP_KERNEL);
> if (!buffer) {
> sr_printk(KERN_ERR, cd, "out of memory.\n");
A separate trivial cleanup is the unnecessary memory allocation failure message
here since the mm layer will already report such things.
-Tyrel
> return;
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-12-28 0:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-22 9:01 [PATCH] sr: don't use GFP_DMA in get_capabilities Christoph Hellwig
2021-12-22 9:06 ` Christoph Hellwig
2021-12-28 0:34 ` Tyrel Datwyler
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox