linux-um archives
 help / color / mirror / Atom feed
From: Blaisorblade <blaisorblade@yahoo.it>
To: user-mode-linux-devel@lists.sourceforge.net
Subject: [uml-devel] Introducing new bugs with fixups - one safe story
Date: Mon, 19 Dec 2005 17:32:43 +0100	[thread overview]
Message-ID: <200512191732.43333.blaisorblade@yahoo.it> (raw)

One nice day a clumsy programmer (let's say me) on a "call for fixing" day 
wrote the following patch (host_kern.c):

-       start = (long long) (page->index << PAGE_CACHE_SHIFT) + from;
+       start = ((long long) page->index) << PAGE_CACHE_SHIFT + from;

to make sure page->index was casted before shifting, to avoid losing 
information. But look below. Does the new line:

        start = ((long long) page->index) << PAGE_CACHE_SHIFT + from;

must be interpreted as:

        start = (((long long) page->index) << PAGE_CACHE_SHIFT) + from;
(what I meant) or as 
        start = ((long long) page->index) << (PAGE_CACHE_SHIFT + from);

?

This message is given as help:

  CC [M]  fs/hostfs/hostfs_kern.o
/home/paolo/Admin/kernel/6/VCS/linux-2.6.git/fs/hostfs/hostfs_kern.c: In 
function `hostfs_commit_write':
/home/paolo/Admin/kernel/6/VCS/linux-2.6.git/fs/hostfs/hostfs_kern.c:504: 
warning: suggest parentheses around + or - inside shift

Luckily, however, the clumsy programmer saw the message and learned The Way 
(tm). And the patch hadn't been merged yet. Another point for GCC.
-- 
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894)
http://www.user-mode-linux.org/~blaisorblade

		
___________________________________ 
Yahoo! Messenger: chiamate gratuite in tutto il mondo 
http://it.messenger.yahoo.com



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

                 reply	other threads:[~2005-12-19 16:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=200512191732.43333.blaisorblade@yahoo.it \
    --to=blaisorblade@yahoo.it \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    /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