From: Bart Van Assche <bvanassche@acm.org>
To: Guo Zhengkui <guozhengkui@vivo.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
Max Gurtovoy <mgurtovoy@nvidia.com>,
Mike Christie <michael.christie@oracle.com>,
Varun Prakash <varun@chelsio.com>,
"open list:SCSI TARGET SUBSYSTEM" <linux-scsi@vger.kernel.org>,
"open list:SCSI TARGET SUBSYSTEM" <target-devel@vger.kernel.org>,
open list <linux-kernel@vger.kernel.org>
Cc: zhengkui_guo@outlook.com
Subject: Re: [PATCH linux-next] scsi: target: cxgbit: replace ternary operator with min()
Date: Fri, 13 May 2022 19:41:35 -0700 [thread overview]
Message-ID: <7e12e950-fece-845f-6784-d3e59480f810@acm.org> (raw)
In-Reply-To: <20220512133754.40849-1-guozhengkui@vivo.com>
On 5/12/22 06:37, Guo Zhengkui wrote:
> diff --git a/drivers/target/iscsi/cxgbit/cxgbit_cm.c b/drivers/target/iscsi/cxgbit/cxgbit_cm.c
> index 3336d2b78bf7..6d9a13da6cb7 100644
> --- a/drivers/target/iscsi/cxgbit/cxgbit_cm.c
> +++ b/drivers/target/iscsi/cxgbit/cxgbit_cm.c
> @@ -1008,7 +1008,7 @@ int cxgbit_ofld_send(struct cxgbit_device *cdev, struct sk_buff *skb)
> ret = cxgb4_ofld_send(cdev->lldi.ports[0], skb);
> if (ret < 0)
> kfree_skb(skb);
> - return ret < 0 ? ret : 0;
> + return min(ret, 0);
> }
>
> static void cxgbit_release_tid(struct cxgbit_device *cdev, u32 tid)
> @@ -1039,7 +1039,7 @@ cxgbit_l2t_send(struct cxgbit_device *cdev, struct sk_buff *skb,
> ret = cxgb4_l2t_send(cdev->lldi.ports[0], skb, l2e);
> if (ret < 0)
> kfree_skb(skb);
> - return ret < 0 ? ret : 0;
> + return min(ret, 0);
> }
>
> static void cxgbit_send_rx_credits(struct cxgbit_sock *csk, struct sk_buff *skb)
I prefer to keep the existing code since "return min(ret, 0)" is not how
humans write kernel code.
Thanks,
Bart.
prev parent reply other threads:[~2022-05-14 2:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-12 13:37 Guo Zhengkui
2022-05-14 2:41 ` Bart Van Assche [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=7e12e950-fece-845f-6784-d3e59480f810@acm.org \
--to=bvanassche@acm.org \
--cc=guozhengkui@vivo.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=mgurtovoy@nvidia.com \
--cc=michael.christie@oracle.com \
--cc=target-devel@vger.kernel.org \
--cc=varun@chelsio.com \
--cc=zhengkui_guo@outlook.com \
/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®