linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: William Lee Irwin III <wli@holomorphy.com>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: 2.6.5-mc2
Date: Wed, 7 Apr 2004 11:04:30 -0700	[thread overview]
Message-ID: <20040407180430.GA30117@holomorphy.com> (raw)
In-Reply-To: <20040406221744.2bd7c7e4.akpm@osdl.org>

On Tue, Apr 06, 2004 at 10:17:44PM -0700, Andrew Morton wrote:
> ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.5/2.6.5-mc2/
> This tree is the accumulation of things which will be sent to Linus next
> week.

fs/open.c: In function `vfs_statfs_native':
fs/open.c:67: warning: comparison is always true due to limited range of data type
fs/open.c:70: warning: comparison is always true due to limited range of data type


Index: wli-2.6.5-3/fs/open.c
===================================================================
--- wli-2.6.5-3.orig/fs/open.c	2004-04-07 07:18:19.000000000 -0700
+++ wli-2.6.5-3/fs/open.c	2004-04-07 10:57:00.000000000 -0700
@@ -44,6 +44,13 @@
 
 EXPORT_SYMBOL(vfs_statfs);
 
+static inline int vfs_statfs_overflow(unsigned long x)
+{
+	if (sizeof(unsigned long) == 8)
+		return 0;
+	return x != ~0UL && x > ((1UL << (BITS_PER_LONG/2)) - 1);
+}
+
 static int vfs_statfs_native(struct super_block *sb, struct statfs *buf)
 {
 	struct kstatfs st;
@@ -64,11 +71,9 @@
 			 * f_files and f_ffree may be -1; it's okay to stuff
 			 * that into 32 bits
 			 */
-			if (st.f_files != 0xffffffffffffffffULL &&
-			    (st.f_files & 0xffffffff00000000ULL))
+			if (vfs_statfs_overflow(st.f_files))
 				return -EOVERFLOW;
-			if (st.f_ffree != 0xffffffffffffffffULL &&
-			    (st.f_ffree & 0xffffffff00000000ULL))
+			if (vfs_statfs_overflow(st.f_ffree))
 				return -EOVERFLOW;
 		}
 

  parent reply	other threads:[~2004-04-07 18:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-07  5:17 2.6.5-mc2 Andrew Morton
2004-04-07 15:29 ` 2.6.5-mc2 (compile stats) John Cherry
2004-04-07 16:12   ` John Cherry
2004-04-07 16:06 ` 2.6.5-mc2 Gerd Knorr
2004-04-07 18:04 ` William Lee Irwin III [this message]
2004-04-07 18:09   ` 2.6.5-mc2 William Lee Irwin III
2004-04-07 18:27     ` 2.6.5-mc2 Andrew Morton
2004-04-07 18:34       ` 2.6.5-mc2 William Lee Irwin III
2004-04-07 18:52         ` 2.6.5-mc2 Andrew Morton
2004-04-07 19:27           ` 2.6.5-mc2 William Lee Irwin III

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=20040407180430.GA30117@holomorphy.com \
    --to=wli@holomorphy.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    /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).