From: Lukasz Majewski <lukma@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/1] fs: fat: avoid superfluous conversion calling set_cluster
Date: Tue, 13 Feb 2018 22:27:55 +0100 [thread overview]
Message-ID: <20180213222755.4755203c@jawa> (raw)
In-Reply-To: <20180213182329.11684-1-xypron.glpk@gmx.de>
On Tue, 13 Feb 2018 19:23:29 +0100
Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
> Parameter size of function set_cluster is of type unsigned long. It
> makes no sense to convert actsize to int before passing it to
> set_cluster as size.
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
> fs/fat/fat_write.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/fs/fat/fat_write.c b/fs/fat/fat_write.c
> index 2b753df2820..ccc03cecb6e 100644
> --- a/fs/fat/fat_write.c
> +++ b/fs/fat/fat_write.c
> @@ -679,7 +679,8 @@ set_contents(fsdata *mydata, dir_entry *dentptr,
> __u8 *buffer,
> /* set remaining bytes */
> actsize = filesize;
> - if (set_cluster(mydata, curclust, buffer,
> (int)actsize) != 0) {
> + if (set_cluster(mydata, curclust, buffer,
> + (unsigned long)actsize) != 0) {
> debug("error: writing cluster\n");
> return -1;
> }
> @@ -696,7 +697,8 @@ set_contents(fsdata *mydata, dir_entry *dentptr,
> __u8 *buffer,
> return 0;
> getit:
> - if (set_cluster(mydata, curclust, buffer,
> (int)actsize) != 0) {
> + if (set_cluster(mydata, curclust, buffer,
> + (unsigned long)actsize) != 0) {
> debug("error: writing cluster\n");
> return -1;
> }
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Best regards,
Lukasz Majewski
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180213/f0b0a619/attachment.sig>
prev parent reply other threads:[~2018-02-13 21:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-13 18:23 [U-Boot] [PATCH 1/1] fs: fat: avoid superfluous conversion calling set_cluster Heinrich Schuchardt
2018-02-13 21:27 ` Lukasz Majewski [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=20180213222755.4755203c@jawa \
--to=lukma@denx.de \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox