From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752255AbdHHRdF (ORCPT ); Tue, 8 Aug 2017 13:33:05 -0400 Received: from ale.deltatee.com ([207.54.116.67]:57272 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752070AbdHHRdE (ORCPT ); Tue, 8 Aug 2017 13:33:04 -0400 To: Serge Semin , 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 References: <20170808101047.24518-1-fancer.lancer@gmail.com> From: Logan Gunthorpe Message-ID: <8fb6cd0d-65e7-8c63-2dc0-8f5190f05b52@deltatee.com> Date: Tue, 8 Aug 2017 11:32:56 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170808101047.24518-1-fancer.lancer@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 172.16.1.162 X-SA-Exim-Rcpt-To: linux-kernel@vger.kernel.org, linux-ntb@googlegroups.com, Sergey.Semin@t-platforms.ru, gary.hook@amd.com, Xiangliang.Yu@amd.com, Shyam-sundar.S-k@amd.com, Allen.Hubbe@emc.com, dave.jiang@intel.com, jdmason@kudzu.us, fancer.lancer@gmail.com X-SA-Exim-Mail-From: logang@deltatee.com Subject: Re: [PATCH] NTB: Rename NTB messaging API methods X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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