mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Logan Gunthorpe <logang@deltatee.com>
To: Serge Semin <fancer.lancer@gmail.com>,
	jdmason@kudzu.us, dave.jiang@intel.com, Allen.Hubbe@emc.com,
	Shyam-sundar.S-k@amd.com, Xiangliang.Yu@amd.com,
	gary.hook@amd.com
Cc: Sergey.Semin@t-platforms.ru, linux-ntb@googlegroups.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] NTB: Rename NTB messaging API methods
Date: Tue, 8 Aug 2017 11:32:56 -0600	[thread overview]
Message-ID: <8fb6cd0d-65e7-8c63-2dc0-8f5190f05b52@deltatee.com> (raw)
In-Reply-To: <20170808101047.24518-1-fancer.lancer@gmail.com>



On 08/08/17 04:10 AM, Serge Semin wrote:
> There is a common methods signature form used over all the NTB API
> like functions naming scheme, arguments names and order, etc.
> Recently added NTB messaging API IO callbacks were named a bit
> different so should be renamed to be in compliance with the rest
> of the API.

This could describe the actual change(s) a bit better and
justifications. What is this common method signature and why do we
actually want to make these changes?

> -static inline int ntb_msg_read(struct ntb_dev *ntb, int midx, int *pidx,
> -			       u32 *msg)
> +static inline u32 ntb_msg_read(struct ntb_dev *ntb, int *pidx, int midx)
>  {
>  	if (!ntb->ops->msg_read)
> -		return -EINVAL;
> +		return ~(u32)0;

I don't like this change at all. It makes error handling impossible to
do correctly because the msg returned could easily be zero or -1. The
way you had it originally is much better. Also, dropping the standard
kernel error codes for 0 and -1 don't seem useful.

Logan

  reply	other threads:[~2017-08-08 17:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-08 10:10 Serge Semin
2017-08-08 17:32 ` Logan Gunthorpe [this message]
2017-11-30 21:34 ` [PATCH v2] " Serge Semin

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=8fb6cd0d-65e7-8c63-2dc0-8f5190f05b52@deltatee.com \
    --to=logang@deltatee.com \
    --cc=Allen.Hubbe@emc.com \
    --cc=Sergey.Semin@t-platforms.ru \
    --cc=Shyam-sundar.S-k@amd.com \
    --cc=Xiangliang.Yu@amd.com \
    --cc=dave.jiang@intel.com \
    --cc=fancer.lancer@gmail.com \
    --cc=gary.hook@amd.com \
    --cc=jdmason@kudzu.us \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-ntb@googlegroups.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®