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] [day] [month] [year] [list]
Date:	Sun, 25 Jul 2010 14:44:47 -0700
From:	Randy Dunlap <rdunlap@...otime.net>
To:	Parmenides <mobile.parmenides@...il.com>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: why are there some redundant variable definition

On Mon, 26 Jul 2010 05:29:04 +0800 Parmenides wrote:

> Hi,
>   I have read a macro like this
> ++++ include/linux/kernel.h
> 159: #define min_t(type,x,y) \
> 160: ({ type __x = (x); type __y = (y); __x < __y ? __x: __y; })
> ++++ net/ipv4/tcp_output.c
> 654: int full_space = min_t(int, tp->window_clamp, tcp_full_space(sk));
> 
> The definitions of __x and __y are somewhat redundant. I think a more
> --

The local variables __x and __y are used so that 'x' and 'y' are not
re-evaluated multiple times.  That could be a problem if either one of
them is an expression.

Anything else?

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ