staging: vt6656: replace GFP_ATOMIC with GFP_KERNEL for urb allocation
PATCH 1/1 staging: vt6656: replace GFP_ATOMIC with GFP_KERNEL for urb allocation
Replace one instance of GFP_ATOMIC w GFP_KERNEL during urb buffer allocation. This makes vnt_alloc_bufs() consistent in setting GFP_KERNEL during kmalloc() and usb_alloc_urb(). GFP_KERNEL is safe because we are in process context, not in an intr handler, nor holding any spinlock.
--- drivers/staging/vt6656/main_usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/vt6656/main_usb.c +1 -1
@@ -439,7 +439,7 @@ static bool vnt_alloc_bufs(struct vnt_private *priv) tx_context->pkt_no = ii;/* allocate URBs */ - tx_context->urb =usb_alloc_urb (0 ,GFP_ATOMIC ); + tx_context->urb =usb_alloc_urb (0 ,GFP_KERNEL );if (!tx_context->urb) {dev_err (&priv->usb->dev,"alloc tx urb failed\n" ); goto free_tx;
Signature · 1 line
2.1.4
PATCH v2 1/1 staging: vt6656: replace GFP_ATOMIC with GFP_KERNEL for urb allocation
Replace one instance of GFP_ATOMIC with GFP_KERNEL during urb buffer allocation. This makes vnt_alloc_bufs() consistent in setting GFP_KERNEL during kmalloc() and usb_alloc_urb(). GFP_KERNEL is safe because we are in process context, not in an interrupt handler, nor holding any spinlock.
---
Changes in v2:
expanded abbreviations in commit message
drivers/staging/vt6656/main_usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/vt6656/main_usb.c +1 -1
@@ -439,7 +439,7 @@ static bool vnt_alloc_bufs(struct vnt_private *priv) tx_context->pkt_no = ii;/* allocate URBs */ - tx_context->urb =usb_alloc_urb (0 ,GFP_ATOMIC ); + tx_context->urb =usb_alloc_urb (0 ,GFP_KERNEL );if (!tx_context->urb) {dev_err (&priv->usb->dev,"alloc tx urb failed\n" ); goto free_tx;
Signature · 1 line
2.1.4
Quoted 6 lines · Alison Schofield
Replace one instance of
GFP_ATOMICwithGFP_KERNELduring urb buffer allocation. This makesvnt_alloc_bufs()consistent in settingGFP_KERNELduringkmalloc()andusb_alloc_urb().GFP_KERNELis safe because we are in process context, not in an interrupt handler, nor holding any spinlock.Signed-off-by Alison Schofield <[email protected]>
Really nice idea. While at it please also fix the allocations in the same function for priv->interrupt_urb and rcb->urb.
Quoted 29 lines
---
Changes in v2:
expanded abbreviations in commit messagedrivers/staging/vt6656/main_usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/vt6656/main_usb.c +1
-2@@ -439,7 +439,7 @@ static bool vnt_alloc_bufs(struct vnt_private *priv) tx_context->pkt_no = ii;/* allocate URBs */ - tx_context->urb =usb_alloc_urb (0 ,GFP_ATOMIC ); + tx_context->urb =usb_alloc_urb (0 ,GFP_KERNEL );if (!tx_context->urb) {dev_err (&priv->usb->dev,"alloc tx urb failed\n" ); goto free_tx; --2.1.4
--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1455262646-14649-1-git-send-email-amsfield22%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
Quoted 10 lines · Daniel Baluta
Quoted 6 lines · Alison Schofield
Replace one instance of
GFP_ATOMICwithGFP_KERNELduring urb buffer allocation. This makesvnt_alloc_bufs()consistent in settingGFP_KERNELduringkmalloc()andusb_alloc_urb().GFP_KERNELis safe because we are in process context, not in an interrupt handler, nor holding any spinlock.Signed-off-by Alison Schofield <[email protected]>Really nice idea. While at it please also fix the allocations in the same function for
priv->interrupt_urbandrcb->urb.
Credit goes to Julia's eagle eye!
Sending patch update.
alison
Quoted 30 lines
Quoted 30 lines
---
Changes in v2:
expanded abbreviations in commit messagedrivers/staging/vt6656/main_usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/vt6656/main_usb.c +1
-2@@ -439,7 +439,7 @@ static bool vnt_alloc_bufs(struct vnt_private *priv) tx_context->pkt_no = ii;/* allocate URBs */ - tx_context->urb =usb_alloc_urb (0 ,GFP_ATOMIC ); + tx_context->urb =usb_alloc_urb (0 ,GFP_KERNEL );if (!tx_context->urb) {dev_err (&priv->usb->dev,"alloc tx urb failed\n" ); goto free_tx; --2.1.4
--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1455262646-14649-1-git-send-email-amsfield22%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
PATCH v3 1/1 staging: vt6656: replace GFP_ATOMIC with GFP_KERNEL for urb allocation
In reply to Alison SchofieldReplace GFP_ATOMIC with GFP_KERNEL during urb buffer allocation. This makes vnt_alloc_bufs() consistent in setting GFP_KERNEL during kmalloc() and usb_alloc_urb(). GFP_KERNEL is safe because we are in process context, not in an interrupt handler, nor holding any spinlock.
---
Changes in v3:
- changed 2 additional instances in same function
- modified changelog
Changes in v2:
- expanded abbreviations changelog
drivers/staging/vt6656/main_usb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/vt6656/main_usb.c +3 -3
@@ -439,7 +439,7 @@ static bool vnt_alloc_bufs(struct vnt_private *priv) tx_context->pkt_no = ii;/* allocate URBs */ - tx_context->urb =usb_alloc_urb (0 ,GFP_ATOMIC ); + tx_context->urb =usb_alloc_urb (0 ,GFP_KERNEL );if (!tx_context->urb) {dev_err (&priv->usb->dev,"alloc tx urb failed\n" ); goto free_tx;
@@ -461,7 +461,7 @@ static bool vnt_alloc_bufs(struct vnt_private *priv) rcb->priv = priv;/* allocate URBs */ - rcb->urb =usb_alloc_urb (0 ,GFP_ATOMIC ); + rcb->urb =usb_alloc_urb (0 ,GFP_KERNEL );if (!rcb->urb) {dev_err (&priv->usb->dev,"Failed to alloc rx urb\n" ); goto free_rx_tx;
@@ -478,7 +478,7 @@ static bool vnt_alloc_bufs(struct vnt_private *priv) goto free_rx_tx; } - priv->interrupt_urb =usb_alloc_urb (0 ,GFP_ATOMIC ); + priv->interrupt_urb =usb_alloc_urb (0 ,GFP_KERNEL );if (!priv->interrupt_urb) {dev_err (&priv->usb->dev,"Failed to alloc int urb\n" ); goto free_rx_tx;
Signature · 1 line
2.1.4