All of lore.kernel.org
 help / color / mirror / Atom feed
From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
To: Seunghun Lee <waydi1@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] fat: Simplify calc_fat_clusters code
Date: Wed, 03 Sep 2014 00:37:29 +0900	[thread overview]
Message-ID: <87k35m3ufa.fsf@devron.myhome.or.jp> (raw)
In-Reply-To: <1409664810-31960-1-git-send-email-waydi1@gmail.com> (Seunghun Lee's message of "Tue, 2 Sep 2014 22:33:30 +0900")

Seunghun Lee <waydi1@gmail.com> writes:

> diff --git a/fs/fat/inode.c b/fs/fat/inode.c
> index 756aead..6992dea 100644
> --- a/fs/fat/inode.c
> +++ b/fs/fat/inode.c
> @@ -1307,12 +1307,9 @@ static unsigned long calc_fat_clusters(struct super_block *sb)
>  	struct msdos_sb_info *sbi = MSDOS_SB(sb);
>  
>  	/* Divide first to avoid overflow */
> -	if (sbi->fat_bits != 12) {
> -		unsigned long ent_per_sec = sb->s_blocksize * 8 / sbi->fat_bits;
> -		return ent_per_sec * sbi->fat_length;
> -	}
> +	unsigned long ent_per_sec = sb->s_blocksize * 8 / sbi->fat_bits;
>  
> -	return sbi->fat_length * sb->s_blocksize * 8 / sbi->fat_bits;
> +	return ent_per_sec * sbi->fat_length;
>  }

When sbi->fat_bits == 12, it doesn't work, right? (there is the remainder)

Thanks.
-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

  reply	other threads:[~2014-09-02 16:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-02 13:33 [PATCH] fat: Simplify calc_fat_clusters code Seunghun Lee
2014-09-02 15:37 ` OGAWA Hirofumi [this message]
2014-09-02 16:41   ` Seunghun Lee

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=87k35m3ufa.fsf@devron.myhome.or.jp \
    --to=hirofumi@mail.parknet.co.jp \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=waydi1@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.