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]
Message-Id: <20130627225139.798e7b00.akpm@linux-foundation.org>
Date:	Thu, 27 Jun 2013 22:51:39 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Randy Dunlap <rdunlap@...radead.org>
Cc:	mm-commits@...r.kernel.org, linux-kernel@...r.kernel.org,
	linux-mm@...ck.org, linux-fsdevel@...r.kernel.org,
	linux-next@...r.kernel.org, Oleg Nesterov <oleg@...hat.com>
Subject: Re: mmotm 2013-06-27-16-36 uploaded (wait event common)

On Thu, 27 Jun 2013 22:30:41 -0700 Randy Dunlap <rdunlap@...radead.org> wrote:

> On 06/27/13 16:37, akpm@...ux-foundation.org wrote:
> > The mm-of-the-moment snapshot 2013-06-27-16-36 has been uploaded to
> > 
> >    http://www.ozlabs.org/~akpm/mmotm/
> > 
> > mmotm-readme.txt says
> > 
> > README for mm-of-the-moment:
> > 
> > http://www.ozlabs.org/~akpm/mmotm/
> > 
> 
> My builds are littered with hundreds of warnings like this one:
> 
> drivers/tty/tty_ioctl.c:220:6: warning: the omitted middle operand in ?: will always be 'true', suggest explicit middle operand [-Wparentheses]
> 
> I guess due to this line from wait_event_common():
> 
> +		__ret = __wait_no_timeout(tout) ?: (tout) ?: 1;
> 

Ah, sorry, I missed that.  Had I noticed it, I would have spat it back
on taste grounds alone, it being unfit for human consumption.

Something like this?

--- a/include/linux/wait.h~wait-introduce-wait_event_commonwq-condition-state-timeout-fix
+++ a/include/linux/wait.h
@@ -196,7 +196,11 @@ wait_queue_head_t *bit_waitqueue(void *,
 	for (;;) {							\
 		prepare_to_wait(&wq, &__wait, state);			\
 		if (condition) {					\
-			__ret = __wait_no_timeout(tout) ?: __tout ?: 1;	\
+			__ret = __wait_no_timeout(tout);		\
+			if (!__ret)					\
+				__ret = __tout;				\
+				if (!__ret)				\
+					__ret = 1;			\
 			break;						\
 		}							\
 									\


--
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