Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1706777
| From | Logan Gunthorpe <logang@deltatee.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] NTB: Rename NTB messaging API methods |
| Date | 2017-08-08 19:40 +0200 |
| Message-ID | <ucgE1-3bf-13@gated-at.bofh.it> (permalink) |
| References | <uc9Md-6Rb-11@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH] NTB: Rename NTB messaging API methods Serge Semin <fancer.lancer@gmail.com> - 2017-08-08 12:20 +0200 Re: [PATCH] NTB: Rename NTB messaging API methods Logan Gunthorpe <logang@deltatee.com> - 2017-08-08 19:40 +0200
csiph-web