linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* Fixing off_t handling in flashcp
@ 2015-09-26 10:55 Paul Barker
  2015-09-28 11:38 ` Fabien Proriol
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Barker @ 2015-09-26 10:55 UTC (permalink / raw)
  To: linux-mtd, Fabien Proriol

[-- Attachment #1: Type: text/plain, Size: 1037 bytes --]

Hi,

flashcp uses "%lu" to print values of type off_t. For example, from line 307 of
flashcp.c, with formatting butchered to fit in 80 cols:

    log_printf (LOG_NORMAL,"\rWriting data: %dk/%luk (%lu%%)",
                KB (written + i),
                KB (filestat.st_size),
                PERCENTAGE (written + i,filestat.st_size));

The KB() macro doesn't change the type of filestat.st_size, which is 64 bits
when large file support is enabled. On a 32-bit system this should be printed as
"%llu" not "%lu".

Looking through the archives there is already a patch to address this but it
doesn't seem to have been applied or replied to:
http://lists.infradead.org/pipermail/linux-mtd/2014-November/056410.html

I'd like to see this fixed as the current display output is ugly on our systems.
Could someone take another look at this patch from Fabien? I'll also test this
at work this week to ensure it works correctly.

Thanks,

-- 
Paul Barker

Email: paul@paulbarker.me.uk
http://www.paulbarker.me.uk

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE:Fixing off_t handling in flashcp
  2015-09-26 10:55 Fixing off_t handling in flashcp Paul Barker
@ 2015-09-28 11:38 ` Fabien Proriol
  0 siblings, 0 replies; 2+ messages in thread
From: Fabien Proriol @ 2015-09-28 11:38 UTC (permalink / raw)
  To: Paul Barker, linux-mtd@lists.infradead.org

Hi,

I used it since 2014 by appling this patch with my OpenEmbedded recipe, and it's work well for ARM architecture (xilinx zynq).

Fabien
________________________________________
De : Paul Barker [paul@paulbarker.me.uk]
Envoyé : samedi 26 septembre 2015 12:55
À : linux-mtd@lists.infradead.org; Fabien Proriol
Objet : Fixing off_t handling in flashcp

Hi,

flashcp uses "%lu" to print values of type off_t. For example, from line 307 of
flashcp.c, with formatting butchered to fit in 80 cols:

    log_printf (LOG_NORMAL,"\rWriting data: %dk/%luk (%lu%%)",
                KB (written + i),
                KB (filestat.st_size),
                PERCENTAGE (written + i,filestat.st_size));

The KB() macro doesn't change the type of filestat.st_size, which is 64 bits
when large file support is enabled. On a 32-bit system this should be printed as
"%llu" not "%lu".

Looking through the archives there is already a patch to address this but it
doesn't seem to have been applied or replied to:
http://lists.infradead.org/pipermail/linux-mtd/2014-November/056410.html

I'd like to see this fixed as the current display output is ugly on our systems.
Could someone take another look at this patch from Fabien? I'll also test this
at work this week to ensure it works correctly.

Thanks,

--
Paul Barker

Email: paul@paulbarker.me.uk
http://www.paulbarker.me.uk

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-09-28 11:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-26 10:55 Fixing off_t handling in flashcp Paul Barker
2015-09-28 11:38 ` Fabien Proriol

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).