From: Guoqing Jiang <guoqing.jiang@cloud.ionos.com>
To: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>, axboe@kernel.dk
Cc: linux-block@vger.kernel.org, hch@lst.de
Subject: Re: [PATCH] block: return NULL in blk_alloc_queue() on error
Date: Sat, 28 Mar 2020 22:32:11 +0100 [thread overview]
Message-ID: <22e5e0bf-49db-03a8-d81f-00733f117765@cloud.ionos.com> (raw)
In-Reply-To: <20200328182734.5585-1-chaitanya.kulkarni@wdc.com>
On 3/28/20 7:27 PM, Chaitanya Kulkarni wrote:
> This patch fixes follwoing warning:
>
> block/blk-core.c: In function ‘blk_alloc_queue’:
> block/blk-core.c:558:10: warning: returning ‘int’ from a function with return type ‘struct request_queue *’ makes pointer from integer without a cast [-Wint-conversion]
> return -EINVAL;
>
> Fixes: 3d745ea5b095a ("block: simplify queue allocation")
> Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
> ---
> block/blk-core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/block/blk-core.c b/block/blk-core.c
> index 18b8c09d093e..7e4a1da0715e 100644
> --- a/block/blk-core.c
> +++ b/block/blk-core.c
> @@ -555,7 +555,7 @@ struct request_queue *blk_alloc_queue(make_request_fn make_request, int node_id)
> struct request_queue *q;
>
> if (WARN_ON_ONCE(!make_request))
> - return -EINVAL;
> + return NULL;
Maybe return ERR_PTR(-EINVAL) is better.
Thanks,
Guoqing
next prev parent reply other threads:[~2020-03-28 21:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-28 18:27 [PATCH] block: return NULL in blk_alloc_queue() on error Chaitanya Kulkarni
2020-03-28 21:32 ` Guoqing Jiang [this message]
2020-03-28 23:42 ` Chaitanya Kulkarni
2020-03-29 12:10 ` hch
2020-03-29 12:09 ` Christoph Hellwig
2020-03-29 16:08 ` Jens Axboe
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=22e5e0bf-49db-03a8-d81f-00733f117765@cloud.ionos.com \
--to=guoqing.jiang@cloud.ionos.com \
--cc=axboe@kernel.dk \
--cc=chaitanya.kulkarni@wdc.com \
--cc=hch@lst.de \
--cc=linux-block@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).