Re: [PATCH 1/3] IB/core: Don't allow default GID addition at non-reserved slots

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

 



On Fri, 2018-04-13 at 01:24 +0300, Leon Romanovsky wrote:
>  				/* Found an invalid (free) entry; allocate it */
> -				if (data->props & GID_TABLE_ENTRY_DEFAULT) {
> -					if (default_gid)
> +				if (default_gid) {
> +					/* If default GID is requested than, it
                                                                       ^^^^^
                                                                       then?

Additionally, please use the recommended comment style (start with /* on a line
by itself).

> +					 * should be one of the reserved entry.
> +					 * This ensures that only reserved slots
> +					 * are used for reserved GID.
> +					 */
> +					if (data->props & GID_TABLE_ENTRY_DEFAULT)
>  						empty = curr_index;
>  				} else {
>  					empty = curr_index;

Has it been considered to change the above nested if-statement into the following,
which is more compact?

				if (!default_gid || (data->props & GID_TABLE_ENTRY_DEFAULT))
					empty = curr_index

Thanks,

Bart.



��.n��������+%������w��{.n�����{���fk��ܨ}���Ơz�j:+v�����w����ޙ��&�)ߡ�a����z�ޗ���ݢj��w�f




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux