All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tuomas Tynkkynen <tuomas@tuxera.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/1] fs: fat: avoid useless conversion when calling getcluster
Date: Tue, 13 Feb 2018 23:50:08 +0200	[thread overview]
Message-ID: <20180213235008.047f4552@duuni> (raw)
In-Reply-To: <20180213181858.10063-1-xypron.glpk@gmx.de>

Hi,

On Tue, 13 Feb 2018 19:18:58 +0100
Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:

> Parameter size of function get_cluster() is of type unsigned long. It makes
> no sense to convert actsize to int before passing it to get_cluster as
> size.
> 
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
>  fs/fat/fat.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/fat/fat.c b/fs/fat/fat.c
> index dd7888cd6d4..a3c7bf604eb 100644
> --- a/fs/fat/fat.c
> +++ b/fs/fat/fat.c
> @@ -353,7 +353,7 @@ static int get_contents(fsdata *mydata, dir_entry *dentptr, loff_t pos,
>  	if (pos) {
>  		actsize = min(filesize, (loff_t)bytesperclust);
>  		if (get_cluster(mydata, curclust, get_contents_vfatname_block,
> -				(int)actsize) != 0) {
> +				(unsigned long)actsize) != 0) {
>  			printf("Error reading cluster\n");

If the type is unsigned long, the explicit cast here seems redundant.

  parent reply	other threads:[~2018-02-13 21:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-13 18:18 [U-Boot] [PATCH 1/1] fs: fat: avoid useless conversion when calling getcluster Heinrich Schuchardt
2018-02-13 21:27 ` Lukasz Majewski
2018-02-13 21:50 ` Tuomas Tynkkynen [this message]
2018-02-14  7:17   ` Heinrich Schuchardt

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=20180213235008.047f4552@duuni \
    --to=tuomas@tuxera.com \
    --cc=u-boot@lists.denx.de \
    /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.