From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758062AbbLBMBm (ORCPT ); Wed, 2 Dec 2015 07:01:42 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:33431 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757914AbbLBMBk (ORCPT ); Wed, 2 Dec 2015 07:01:40 -0500 Date: Wed, 2 Dec 2015 15:00:56 +0300 From: Dan Carpenter To: James Simmons Cc: Greg Kroah-Hartman , devel@driverdev.osuosl.org, Oleg Drokin , Andreas Dilger , Amir Shehata , Linux Kernel Mailing List , lustre-devel@lists.lustre.org Subject: Re: [PATCH 13/40] staging: lustre: Dynamic LNet Configuration (DLC) show command Message-ID: <20151202120056.GO18797@mwanda> References: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> <1448062576-23757-14-git-send-email-jsimmons@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1448062576-23757-14-git-send-email-jsimmons@infradead.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: aserv0022.oracle.com [141.146.126.234] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 20, 2015 at 06:35:49PM -0500, James Simmons wrote: > +int lnet_get_peers(int count, __u64 *nid, char *aliveness, > + int *ncpt, int *refcount, > + int *ni_peer_tx_credits, int *peer_tx_credits, > + int *peer_rtr_credits, int *peer_min_rtr_credits, > + int *peer_tx_qnob) > +{ > + struct lnet_peer_table *peer_table; > + lnet_peer_t *lp; > + int j; > + int lncpt, found = 0; > + > + /* get the number of CPTs */ > + lncpt = cfs_percpt_number(the_lnet.ln_peer_tables); > + > + /* > + * if the cpt number to be examined is >= the number of cpts in > + * the system then indicate that there are no more cpts to examin > + */ > + if (*ncpt > lncpt) > + return -1; The comment is correct but the code is off by one. if (*ncpt >= lncpt) return -EINVAL; Also not a correct error code. I assume that you will review the whole patchset again and fix all the -1 returns, of course. regards, dan carpenter