mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Atul Raj" <atul.r@samsung.com>
To: "Viresh Kumar" <viresh.kumar@linaro.org>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"mathias.nyman@linux.intel.com" <mathias.nyman@linux.intel.com>,
	"stern@rowland.harvard.edu" <stern@rowland.harvard.edu>,
	"baolu.lu@linux.intel.com" <baolu.lu@linux.intel.com>,
	"oneukum@suse.com" <oneukum@suse.com>,
	"hansy@nvidia.com" <hansy@nvidia.com>,
	"alcooperx@gmail.com" <alcooperx@gmail.com>
Cc: "atulraj.nith@gmail.com" <atulraj.nith@gmail.com>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: RE: [PATCH v2] usb: core:hub.c: do not print error log on -enomem
Date: Wed, 30 Nov 2016 11:40:28 +0000	[thread overview]
Message-ID: <20161130114028epcms5p8f4d171c212743cb3c9644869beb85fe2@epcms5p8> (raw)
In-Reply-To: <20161130063238epcms5p5b82d469df3d562bdfb1b6ca53ea1e226@epcms5p5>

[-- Attachment #1: Type: text/plain, Size: 2026 bytes --]

 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
 >  
 >

       reply	other threads:[~2016-11-30 11:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20161130063238epcms5p5b82d469df3d562bdfb1b6ca53ea1e226@epcms5p5>
     [not found] ` <20161130063238epcms5p5b82d469df3d562bdfb1b6ca53ea1e226@epcms5p5>
2016-11-30 11:40   ` Atul Raj [this message]
2016-11-30 11:55     ` gregkh
2016-11-30 11:51   ` [PATCH] usb:hub: readibility and consistency in coding style Atul Raj
2016-11-30 12:02     ` gregkh
2016-11-30 12:35     ` Atul Raj
2016-11-30 13:49       ` gregkh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161130114028epcms5p8f4d171c212743cb3c9644869beb85fe2@epcms5p8 \
    --to=atul.r@samsung.com \
    --cc=alcooperx@gmail.com \
    --cc=atulraj.nith@gmail.com \
    --cc=baolu.lu@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hansy@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathias.nyman@linux.intel.com \
    --cc=oneukum@suse.com \
    --cc=stern@rowland.harvard.edu \
    --cc=viresh.kumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®