linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Roskin <proski@gnu.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: David Howells <dhowells@redhat.com>,
	Al Viro <viro@zeniv.linux.org.uk>,
	linux-sparse@vger.kernel.org,
	Josh Triplett <josh@freedesktop.org>
Subject: Re: [PATCH 2/2] Simplify (and warn about) right shifts that result in zero
Date: Thu, 24 Apr 2008 20:34:30 -0400	[thread overview]
Message-ID: <1209083670.12561.68.camel@dv> (raw)
In-Reply-To: <alpine.LFD.1.10.0804241658520.2779@woody.linux-foundation.org>

On Thu, 2008-04-24 at 17:03 -0700, Linus Torvalds wrote:

> Heh. That does look like somebody is shifting the wrong way, and 
> apparently the new warning was worth something ;)

Yes, definitely.  The patch is on the way to linux-wireless.  Losing 24
bits of entropy in the initialization vector is not good, to put it
mildly.

The only other "shift" warning in the kernel for my configuration
indicates dead code in drivers/serial/serial_core.c:

tmp.port_high = (long) port->iobase >> HIGH_BITS_OFFSET;

HIGH_BITS_OFFSET is 32 bit on 64-bit systems, and port->iobase is always
int.  On 32-bit systems, HIGH_BITS_OFFSET is 0 and the code would not be
executed.  The code predates the dawn of git.  The whole thing needs
some serious cleanup, but apart from that, the warning appears to be
harmless.

There are no more warnings mentioning "shift", and the only two warnings
are useful, or which one may be a serious bug.  That's a pretty good
result!

-- 
Regards,
Pavel Roskin

  reply	other threads:[~2008-04-25  0:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20080424193856.14737.16718.stgit@warthog.procyon.org.uk>
     [not found] ` <alpine.LFD.1.10.0804241248290.2779@woody.linux-foundation.org>
2008-04-24 21:52   ` [PATCH 1/2] Fix cast instruction generation Linus Torvalds
2008-04-24 21:54     ` [PATCH 2/2] Simplify (and warn about) right shifts that result in zero Linus Torvalds
2008-04-24 23:52       ` Pavel Roskin
2008-04-25  0:03         ` Linus Torvalds
2008-04-25  0:34           ` Pavel Roskin [this message]
2008-04-25  2:32           ` Josh Triplett
2008-04-25  2:29       ` Josh Triplett
2008-04-25  2:24     ` [PATCH 1/2] Fix cast instruction generation Josh Triplett

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=1209083670.12561.68.camel@dv \
    --to=proski@gnu.org \
    --cc=dhowells@redhat.com \
    --cc=josh@freedesktop.org \
    --cc=linux-sparse@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@zeniv.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;
as well as URLs for NNTP newsgroup(s).