Re: [PATCH] NTB: Rename NTB messaging API methods

From: Logan Gunthorpe
Date: Tue Aug 08 2017 - 13:33:10 EST




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