Re: [PATCH 13/40] staging: lustre: Dynamic LNet Configuration (DLC) show command

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux