lkml.org 
[lkml]   [2016]   [Nov]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRE: RE: [PATCH v2] usb: core:hub.c: do not print error log on -enomem
From
Date
 changes in v2
- added braces as suggested.

drivers/usb/core/hub.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 749d595..82059f26 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -816,9 +816,10 @@ int usb_hub_clear_tt_buffer(struct urb *urb)
* there can be many TTs per hub). even if they're uncommon.
*/
clear = kmalloc(sizeof *clear, GFP_ATOMIC);
- if (clear == NULL)
+ if (clear == NULL) {
/* FIXME recover somehow ... RESET_TT? */
return -ENOMEM;
+ }

/* info that CLEAR_TT_BUFFER needs */
clear->tt = tt->multi ? udev->ttport : 1;
--
2.10.2.windows.1


> s/enomem/ENOMEM
>
> On 30-11-16, 06:32, Atul Raj wrote:
> > All kmalloc-based functions print enough information on failures.
> >
> > Signed-off-by: Atul Raj <atul.r@samsung.com>
> > ---
> > drivers/usb/core/hub.c | 4 +---
> > 1 file changed, 1 insertion(+), 3 deletions(-)
> >
> > diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
> > index cbb1467..749d595 100644
> > --- a/drivers/usb/core/hub.c
> > +++ b/drivers/usb/core/hub.c
> > @@ -816,11 +816,9 @@ int usb_hub_clear_tt_buffer(struct urb *urb)
> > * there can be many TTs per hub). even if they're uncommon.
> > */
> > clear = kmalloc(sizeof *clear, GFP_ATOMIC);
> > - if (clear == NULL) {
> > - dev_err(&udev->dev, "can't save CLEAR_TT_BUFFER state\n");
> > + if (clear == NULL)
> > /* FIXME recover somehow ... RESET_TT? */
> > return -ENOMEM;
>
> It is still preferred to keep {} here as comment also takes a line.
>
> > - }
> >
> > /* info that CLEAR_TT_BUFFER needs */
> > clear->tt = tt->multi ? udev->ttport : 1;
> > --
> > 2.10.2.windows.1
>
>
> --
> viresh
>
>
\
 
 \ /
  Last update: 2016-11-30 12:40    [W:1.165 / U:0.764 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site