public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@fb.com>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Ming Lei <ming.lei@canonical.com>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] block: fix checking return value of blk_mq_init_queue
Date: Fri, 2 Jan 2015 10:40:09 -0700	[thread overview]
Message-ID: <54A6D7F9.3090203@fb.com> (raw)
In-Reply-To: <20150102173447.GS22149@ZenIV.linux.org.uk>

On 01/02/2015 10:34 AM, Al Viro wrote:
> On Fri, Jan 02, 2015 at 08:53:11AM -0700, Jens Axboe wrote:
>> On 01/02/2015 07:25 AM, Ming Lei wrote:
>>> Check IS_ERR_OR_NULL(return value) instead of just return value.
>>
>> Thanks Ming, applied.
>
> Umm...  Looking at the callers, I'd suggest making it _never_ return NULL -
> it's always treates as ERR_PTR(-ENOMEM) anyway.  Then the checks would be
> just IS_ERR(...).
>
> IS_ERR_OR_NULL() is very often a sign of lousy calling conventions and
> this case is no exception...

I actually made that change when committing it:

http://git.kernel.dk/?p=linux-block.git;a=commit;h=35b489d32fcc37e8735f41aa794b24cf9d1e74f5


-- 
Jens Axboe


      reply	other threads:[~2015-01-02 17:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-02 14:25 [PATCH] block: fix checking return value of blk_mq_init_queue Ming Lei
2015-01-02 15:53 ` Jens Axboe
2015-01-02 17:34   ` Al Viro
2015-01-02 17:40     ` Jens Axboe [this message]

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=54A6D7F9.3090203@fb.com \
    --to=axboe@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ming.lei@canonical.com \
    --cc=viro@ZenIV.linux.org.uk \
    /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