diff options
author | Jia-Ju Bai <baijiaju1990@gmail.com> | 2018-07-26 22:52:49 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-08-02 19:10:56 -0400 |
commit | 730129e9ba4dd668452371eba900e6e46f63b778 (patch) | |
tree | e7fd80f63ae587086f5110eaaf567c9ad9214453 /drivers | |
parent | f46bdacdc06a2256187f98d7d063d1bd5c318b12 (diff) |
media: dvb-frontends: rtl2832_sdr: Replace GFP_ATOMIC with GFP_KERNEL
rtl2832_sdr_submit_urbs(), rtl2832_sdr_alloc_stream_bufs(), and
rtl2832_sdr_alloc_urbs() are never called in atomic context.
They call usb_submit_urb(), usb_alloc_coherent() and usb_alloc_urb()
with GFP_ATOMIC, which is not necessary.
GFP_ATOMIC can be replaced with GFP_KERNEL.
This is found by a static analysis tool named DCNS written by myself.
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/dvb-frontends/rtl2832_sdr.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/media/dvb-frontends/rtl2832_sdr.c b/drivers/media/dvb-frontends/rtl2832_sdr.c index c6e78d870ccd..d448d9d4879c 100644 --- a/drivers/media/dvb-frontends/rtl2832_sdr.c +++ b/drivers/media/dvb-frontends/rtl2832_sdr.c | |||
@@ -301,7 +301,7 @@ static int rtl2832_sdr_submit_urbs(struct rtl2832_sdr_dev *dev) | |||
301 | 301 | ||
302 | for (i = 0; i < dev->urbs_initialized; i++) { | 302 | for (i = 0; i < dev->urbs_initialized; i++) { |
303 | dev_dbg(&pdev->dev, "submit urb=%d\n", i); | 303 | dev_dbg(&pdev->dev, "submit urb=%d\n", i); |
304 | ret = usb_submit_urb(dev->urb_list[i], GFP_ATOMIC); | 304 | ret = usb_submit_urb(dev->urb_list[i], GFP_KERNEL); |
305 | if (ret) { | 305 | if (ret) { |
306 | dev_err(&pdev->dev, | 306 | dev_err(&pdev->dev, |
307 | "Could not submit urb no. %d - get them all back\n", | 307 | "Could not submit urb no. %d - get them all back\n", |
@@ -345,7 +345,7 @@ static int rtl2832_sdr_alloc_stream_bufs(struct rtl2832_sdr_dev *dev) | |||
345 | 345 | ||
346 | for (dev->buf_num = 0; dev->buf_num < MAX_BULK_BUFS; dev->buf_num++) { | 346 | for (dev->buf_num = 0; dev->buf_num < MAX_BULK_BUFS; dev->buf_num++) { |
347 | dev->buf_list[dev->buf_num] = usb_alloc_coherent(dev->udev, | 347 | dev->buf_list[dev->buf_num] = usb_alloc_coherent(dev->udev, |
348 | BULK_BUFFER_SIZE, GFP_ATOMIC, | 348 | BULK_BUFFER_SIZE, GFP_KERNEL, |
349 | &dev->dma_addr[dev->buf_num]); | 349 | &dev->dma_addr[dev->buf_num]); |
350 | if (!dev->buf_list[dev->buf_num]) { | 350 | if (!dev->buf_list[dev->buf_num]) { |
351 | dev_dbg(&pdev->dev, "alloc buf=%d failed\n", | 351 | dev_dbg(&pdev->dev, "alloc buf=%d failed\n", |
@@ -390,7 +390,7 @@ static int rtl2832_sdr_alloc_urbs(struct rtl2832_sdr_dev *dev) | |||
390 | /* allocate the URBs */ | 390 | /* allocate the URBs */ |
391 | for (i = 0; i < MAX_BULK_BUFS; i++) { | 391 | for (i = 0; i < MAX_BULK_BUFS; i++) { |
392 | dev_dbg(&pdev->dev, "alloc urb=%d\n", i); | 392 | dev_dbg(&pdev->dev, "alloc urb=%d\n", i); |
393 | dev->urb_list[i] = usb_alloc_urb(0, GFP_ATOMIC); | 393 | dev->urb_list[i] = usb_alloc_urb(0, GFP_KERNEL); |
394 | if (!dev->urb_list[i]) { | 394 | if (!dev->urb_list[i]) { |
395 | for (j = 0; j < i; j++) | 395 | for (j = 0; j < i; j++) |
396 | usb_free_urb(dev->urb_list[j]); | 396 | usb_free_urb(dev->urb_list[j]); |