staging: unisys: visornic: Replace GFP_ATOMIC with GFP_KERNEL
PATCH 1/1 staging: unisys: visornic: Replace GFP_ATOMIC with GFP_KERNEL
As per below information
GFP_KERNEL FLAG
This is a normal allocation and might block. This is the flag to use in process context code when it is safe to sleep.
GFP_ATOMIC FLAG
The allocation is high-priority and does not sleep. This is the flag to use in interrupt handlers, bottom halves and other situations where you cannot sleep
And we can take advantage of GFP_KERNEL , as when system is in low memory chances of getting success is high compared to GFP_ATOMIC.
As visornic_probe is in process context we can use GPF_KERNEL.
--- drivers/staging/unisys/visornic/visornic_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/unisys/visornic/visornic_main.c +2 -2
@@ -1861,12 +1861,12 @@ static int visornic_probe(struct visor_device *dev)skb_queue_head_init (&devdata->xmitbufhead);/* create a cmdrsp we can use to post and unpost rcv buffers */ - devdata->cmdrsp_rcv =kmalloc (SIZEOF_CMDRSP ,GFP_ATOMIC ); + devdata->cmdrsp_rcv =kmalloc (SIZEOF_CMDRSP ,GFP_KERNEL );if (!devdata->cmdrsp_rcv) { err = -ENOMEM ; goto cleanup_rcvbuf; } - devdata->xmit_cmdrsp =kmalloc (SIZEOF_CMDRSP ,GFP_ATOMIC ); + devdata->xmit_cmdrsp =kmalloc (SIZEOF_CMDRSP ,GFP_KERNEL );if (!devdata->xmit_cmdrsp) { err = -ENOMEM ; goto cleanup_cmdrsp_rcv;
Signature · 1 line
2.7.4
Greg Kroah-Hartman
maintainerQuoted 9 lines · Hariprasad Kelam
As per below information
GFP_KERNELFLAGThis is a normal allocation and might block. This is the flag to use in process context code when it is safe to sleep.
GFP_ATOMICFLAG
Quoted 8 lines
The allocation is high-priority and does not sleep. This is the flag to use in interrupt handlers, bottom halves and other situations where you cannot sleep
And we can take advantage of
GFP_KERNEL, as when system is in low memory chances of getting success is high compared toGFP_ATOMIC.As
visornic_probeis in process context we can useGPF_KERNEL.
Ah, nice catch! Will go queue this up now, thanks.
greg k-h