mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Paul Mackerras <paulus@samba.org>
Cc: Al Viro <viro@ftp.linux.org.uk>,
	Alexey Dobriyan <adobriyan@sw.ru>,
	akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
	herbert@gondor.apana.org.au
Subject: Re: WARN_ON() which sometimes sucks
Date: Tue, 31 Jul 2007 21:05:43 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LFD.0.999.0707312101410.3582@woody.linux-foundation.org> (raw)
In-Reply-To: <18096.949.934194.648312@cargo.ozlabs.ibm.com>



On Wed, 1 Aug 2007, Paul Mackerras wrote:
>
> It will mean more code on architectures which have a
> conditional-trap-on-nonzero instruction, such as powerpc, since the
> compiler will generate instructions to evaluate !!x.  But I don't see
> any reason why ret_warn_on couldn't be a long.

Umm. The WARN_ON() might actually get a "long long" value for all we know. 
Ie it's perfectly possible that the WARN_ON might look like

	/* Must not have high bits on */
	WARN_ON(offset & 0xffffffff00000000);

which on a 32-bit pcc would apparently do the wrong thing entirely as it 
stands now. No?

I think I'll commit the !!(x) version, and you guys can try to figure out 
what the right thing is long-term. For all I know, the proper solution is 
to just revert the whole mess, and *not* make WARN_ON() return a value at 
all, since that seems to be the fundamental mistake here.

			Linus

  reply	other threads:[~2007-08-01  4:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-31 15:55 Alexey Dobriyan
2007-07-31 16:02 ` Al Viro
2007-08-01  3:53   ` Paul Mackerras
2007-08-01  4:05     ` Linus Torvalds [this message]
2007-08-01  4:20       ` Paul Mackerras
2007-08-01 15:17         ` Joe Korty

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.0.999.0707312101410.3582@woody.linux-foundation.org \
    --to=torvalds@linux-foundation.org \
    --cc=adobriyan@sw.ru \
    --cc=akpm@linux-foundation.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulus@samba.org \
    --cc=viro@ftp.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®