From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lukasz Majewski Date: Tue, 13 Feb 2018 22:27:38 +0100 Subject: [U-Boot] [PATCH 1/1] fs: fat: avoid useless conversion when calling getcluster In-Reply-To: <20180213181858.10063-1-xypron.glpk@gmx.de> References: <20180213181858.10063-1-xypron.glpk@gmx.de> Message-ID: <20180213222738.0ba5a09e@jawa> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Tue, 13 Feb 2018 19:18:58 +0100 Heinrich Schuchardt 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 > --- > 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"); > return -1; > } > @@ -393,14 +393,16 @@ static int get_contents(fsdata *mydata, > dir_entry *dentptr, loff_t pos, > /* get remaining bytes */ > actsize = filesize; > - if (get_cluster(mydata, curclust, buffer, > (int)actsize) != 0) { > + if (get_cluster(mydata, curclust, buffer, > + (unsigned long)actsize) != 0) { > printf("Error reading cluster\n"); > return -1; > } > *gotsize += actsize; > return 0; > getit: > - if (get_cluster(mydata, curclust, buffer, > (int)actsize) != 0) { > + if (get_cluster(mydata, curclust, buffer, > + (unsigned long)actsize) != 0) { > printf("Error reading cluster\n"); > return -1; > } Reviewed-by: Lukasz Majewski 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: