`Jan Engelhardt wrote:> +	if (is_prime(number) == true)> +		return 0;> +	if (is_prime(number) == false)> +		return 1;> +> +should be:> +> +	if (is_prime(number))> +		return 0;> +	if (!is_prime(number))> +		return 1;> +> +As far as pointers or functions returning an integer are concerned,> +using long form tests helps to distinguish between pointers and bools> +or functions returning boolean or integer, respectively.> +Examples are:> +> +	if (p == NULL)> +		return 1;> +	if (!p)> +		return 0;> +> +	if (strcmp(haystack, needle) == 0)> +		return 1;> +	if (!strcmp(haystack, needle))> +		return 0;The latter two examples seem odd.  Didn't you mean the following?	if (p == NULL)		return 1;	if (p)		return 0;	if (strcmp(haystack, needle) == 0)		return 1;	if (strcmp(haystack, needle))		return 0;Perhaps better:	if (p == NULL)		return NO_MEMORY;	if (p)		return MEMORY;	if (strcmp(haystack, needle) == 0)		return IS_SAME;	if (strcmp(haystack, needle))		return IS_DIFFERENT;However, to follow your argument about non-boolean expressions, thefollowing would be more consequently going into your direction:	if (p == NULL)		return NO_MEMORY;	if (p != NULL)		return MEMORY;	if (strcmp(haystack, needle) == 0)		return IS_SAME;	if (strcmp(haystack, needle) != 0)		return IS_DIFFERENT;I.e., why do the explicit comparison with 0 or NULL only when it istested for equality, but not when testing for inequality?However, I agree with Scott Preece that these rules should be left outof CodingStyle because they are contentious.(Disclosure:  I am personally used to "if (p)" and "if (!p)" tests ofpointers and many integer expressions, but I tend to the longer form inless obvious cases like "if (strcmp(a, b) != 0)".)-- Stefan Richter-=====-=-=== -=-= ==-==http://arcgraph.de/sr/-To unsubscribe from this list: send the line "unsubscribe linux-kernel" inthe body of a message to majordomo@vger.kernel.orgMore majordomo info at  http://vger.kernel.org/majordomo-info.htmlPlease read the FAQ at  http://www.tux.org/lkml/`