public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Jerry Leo <jerryleo860202@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] quota: integer constant is too large for ‘long’ type in
Date: Tue, 15 Dec 2009 22:28:05 +0100	[thread overview]
Message-ID: <20091215212805.GA9554@quack.suse.cz> (raw)
In-Reply-To: <6304b52b0912150527v48056ccam8d1c318bcd7e085b@mail.gmail.com>

On Tue 15-12-09 21:27:50, Jerry Leo wrote:
> Hi, Jan Kara,
> 
> the Patch is for this:
> 
> CC      fs/quota/quota_v2.o
> fs/quota/quota_v2.c: In function ‘v2_read_file_info’:
> fs/quota/quota_v2.c:123: warning: integer constant is too large for ‘long’ type
> fs/quota/quota_v2.c:124: warning: integer constant is too large for ‘long’ type
> 
> 
> Can this patch be fixed?
  Ops, yes. I didn't see these warnings because I'm using 64-bit
machines... Thanks for the fix. You actually have to use ULL as Joe pointed
out. So I've merged the patch below:

>From 0ec834cacfc98633133b5a90c951f2d02e341048 Mon Sep 17 00:00:00 2001
From: Jan Kara <jack@suse.cz>
Date: Tue, 15 Dec 2009 22:24:36 +0100
Subject: [PATCH] quota: Fix 64-bit limits setting on 32-bit archs
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Fix warnings:
fs/quota/quota_v2.c: In function ‘v2_read_file_info’:
fs/quota/quota_v2.c:123: warning: integer constant is too large for ‘long’ type
fs/quota/quota_v2.c:124: warning: integer constant is too large for ‘long’ type

Reported-by: Jerry Leo <jerryleo860202@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
---
 fs/quota/quota_v2.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/quota/quota_v2.c b/fs/quota/quota_v2.c
index 3dfc23e..669855c 100644
--- a/fs/quota/quota_v2.c
+++ b/fs/quota/quota_v2.c
@@ -120,8 +120,8 @@ static int v2_read_file_info(struct super_block *sb, int type)
 		info->dqi_maxilimit = 0xffffffff;
 	} else {
 		/* used space is stored as unsigned 64-bit value */
-		info->dqi_maxblimit = 0xffffffffffffffff;	/* 2^64-1 */
-		info->dqi_maxilimit = 0xffffffffffffffff;
+		info->dqi_maxblimit = 0xffffffffffffffffULL;	/* 2^64-1 */
+		info->dqi_maxilimit = 0xffffffffffffffffULL;
 	}
 	info->dqi_bgrace = le32_to_cpu(dinfo.dqi_bgrace);
 	info->dqi_igrace = le32_to_cpu(dinfo.dqi_igrace);
-- 
1.6.4.2

-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

      parent reply	other threads:[~2009-12-15 21:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-15 13:27 [PATCH] quota: integer constant is too large for ‘long’ type in Jerry Leo
2009-12-15 15:24 ` Joe Perches
2009-12-15 21:30   ` Jan Kara
2009-12-15 21:28 ` Jan Kara [this message]

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=20091215212805.GA9554@quack.suse.cz \
    --to=jack@suse.cz \
    --cc=jerryleo860202@gmail.com \
    --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