usb: gadget: tegra-xudc: Avoid GFP_ATOMIC where it is not needed
diff mbox series

Message ID 20200809072948.743269-1-christophe.jaillet@wanadoo.fr
State In Next
Commit ed75f187319b680f8b5084380952931e3c880b2d
Headers show
Series
  • usb: gadget: tegra-xudc: Avoid GFP_ATOMIC where it is not needed
Related show

Commit Message

Christophe JAILLET Aug. 9, 2020, 7:29 a.m. UTC
There is no need to use GFP_ATOMIC here. It is a probe function, no
spinlock is taken.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/usb/gadget/udc/tegra-xudc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Thierry Reding Aug. 10, 2020, 2 p.m. UTC | #1
On Sun, Aug 09, 2020 at 09:29:48AM +0200, Christophe JAILLET wrote:
> There is no need to use GFP_ATOMIC here. It is a probe function, no
> spinlock is taken.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
>  drivers/usb/gadget/udc/tegra-xudc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Looks good to me. I can't think of any reason why this would have to be
an atomic allocation. Nagarjuna, please shout if this is really needed,
otherwise:

Acked-by: Thierry Reding <treding@nvidia.com>
JC Kuo Aug. 11, 2020, 1:18 a.m. UTC | #2
Looks good to me.

Reviewed-by: JC Kuo <jckuo@nvidia.com>

On 8/10/20 10:00 PM, Thierry Reding wrote:
> On Sun, Aug 09, 2020 at 09:29:48AM +0200, Christophe JAILLET wrote:
>> There is no need to use GFP_ATOMIC here. It is a probe function, no
>> spinlock is taken.
>>
>> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
>> ---
>>  drivers/usb/gadget/udc/tegra-xudc.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
> Looks good to me. I can't think of any reason why this would have to be
> an atomic allocation. Nagarjuna, please shout if this is really needed,
> otherwise:
>
> Acked-by: Thierry Reding <treding@nvidia.com>

Patch
diff mbox series

diff --git a/drivers/usb/gadget/udc/tegra-xudc.c b/drivers/usb/gadget/udc/tegra-xudc.c
index d6ff68c06911..9aa4815c1c59 100644
--- a/drivers/usb/gadget/udc/tegra-xudc.c
+++ b/drivers/usb/gadget/udc/tegra-xudc.c
@@ -3733,7 +3733,7 @@  static int tegra_xudc_probe(struct platform_device *pdev)
 	unsigned int i;
 	int err;
 
-	xudc = devm_kzalloc(&pdev->dev, sizeof(*xudc), GFP_ATOMIC);
+	xudc = devm_kzalloc(&pdev->dev, sizeof(*xudc), GFP_KERNEL);
 	if (!xudc)
 		return -ENOMEM;