lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 3 Aug 2012 14:23:50 -0600
From:	Jean Sacren <sakiwit@...il.com>
To:	David Miller <davem@...emloft.net>
Cc:	netdev@...r.kernel.org, eric.dumazet@...il.com
Subject: Re: [PATCH] ipv4: remove parentheses in return statement

From: David Miller <davem@...emloft.net>
Date: Fri, 03 Aug 2012 01:52:43 -0700
>
> From: Jean Sacren <sakiwit@...il.com>
> Date: Fri,  3 Aug 2012 01:43:10 -0600
> 
> > Signed-off-by: Jean Sacren <sakiwit@...il.com>
> 
> > -	return ((val ^ (val >> 8) ^ (val >> 16) ^ (val >> 24)) &
> > -		(IN4_ADDR_HSIZE - 1));
> > +	return (val ^ (val >> 8) ^ (val >> 16) ^ (val >> 24)) &
> > +	       (IN4_ADDR_HSIZE - 1);
> 
> Those parenthesis are there to make the evaluation order and
> grouping explicit.
> 
> The other ones you changed are wrong for similar reasons.

Barring the speed issue raised by Eric Dumazet, this patch is correct.

To illustrate, the patch merely changes

	return (A);

to

	return A;

where A is nothing but an expression, regardless if it is a simple one
or a compound one.

Whatever A is, it evaluates to a value. The parentheses do _not_
contribute to the evaluation. They do not alter precedence. They do not
make the evaluation order explicit. They are there to serve no purpose,
yet they do make return statement look like a function call.

Moreover, A is one single entity. It does not group with anything else.
I really don't see the significance of making A a group by itself.

Thank you for reviewing the patch. With all due respect, your assessment
is hard to agree with this moment.

-- 
Jean Sacren
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists