From: Bart Van Assche <Bart.VanAssche-Sjgp3cTcYWE@public.gmane.org>
To: "nmoreychaisemartin-IBi9RG/b67k@public.gmane.org"
<nmoreychaisemartin-IBi9RG/b67k@public.gmane.org>,
"linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Cc: "bvanassche-HInyCGIudOg@public.gmane.org"
<bvanassche-HInyCGIudOg@public.gmane.org>,
"stable-Xl5UnYtxxKxKUA01WzcqbQ@public.gmane.org"
<stable-Xl5UnYtxxKxKUA01WzcqbQ@public.gmane.org>,
"hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org"
<hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
Subject: Re: [PATCH rdma-core 2/2] srp_daemon: fix CQ handling
Date: Tue, 12 Dec 2017 17:04:54 +0000 [thread overview]
Message-ID: <1513098293.2999.15.camel@wdc.com> (raw)
In-Reply-To: <19c1241b-6a22-f8c2-32a2-6233f62cc39c-IBi9RG/b67k@public.gmane.org>
On Tue, 2017-12-12 at 15:08 +0100, Nicolas Morey-Chaisemartin wrote:
> +static int poll_cq_once(struct sync_resources *sync_res, struct ibv_cq *cq,
> + struct ibv_wc *wc)
> +{
> + int ret;
> + ret = ibv_poll_cq(cq, 1, wc);
Please leave one blank line between declarations and statements.
> + if (ret < 0) {
> + pr_err("poll CQ failed\n");
> + return ret;
> + }
> +
> + if (ret > 0 && wc->status != IBV_WC_SUCCESS) {
> + if (!stop_threads(sync_res))
> + pr_err("got bad completion with status: 0x%x\n",
> + wc->status);
> + return -ret;
> + }
> +
> + return ret;
> +}
This function can return negative values, positive values or zero. Please
modify it such that either 0 or a negative Unix error code is returned. This
will make it easier to read this function and also the code that calls this
function.
Thanks,
Bart.
next prev parent reply other threads:[~2017-12-12 17:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <05bbb67fea5e3cae535c0d9d21866cf8ad76f74f.1513087686.git.NMoreyChaisemartin@suse.com>
[not found] ` <05bbb67fea5e3cae535c0d9d21866cf8ad76f74f.1513087686.git.NMoreyChaisemartin-IBi9RG/b67k@public.gmane.org>
2017-12-12 14:08 ` [PATCH rdma-core 2/2] srp_daemon: fix CQ handling Nicolas Morey-Chaisemartin
[not found] ` <19c1241b-6a22-f8c2-32a2-6233f62cc39c-IBi9RG/b67k@public.gmane.org>
2017-12-12 17:04 ` Bart Van Assche [this message]
[not found] ` <1513098293.2999.15.camel-Sjgp3cTcYWE@public.gmane.org>
2017-12-12 17:28 ` Nicolas Morey-Chaisemartin
[not found] ` <e584830f-64a0-d5b6-c3b7-1cb6e0f4df90-IBi9RG/b67k@public.gmane.org>
2017-12-12 17:38 ` Bart Van Assche
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=1513098293.2999.15.camel@wdc.com \
--to=bart.vanassche-sjgp3ctcywe@public.gmane.org \
--cc=bvanassche-HInyCGIudOg@public.gmane.org \
--cc=hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=nmoreychaisemartin-IBi9RG/b67k@public.gmane.org \
--cc=stable-Xl5UnYtxxKxKUA01WzcqbQ@public.gmane.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