From: Tom Rini <trini@konsulko.com>
To: Frieder Schrempf <frieder@fris.de>
Cc: Lukasz Majewski <lukma@denx.de>,
u-boot@lists.denx.de, Heiko Thiery <heiko.thiery@gmail.com>,
Michael Walle <michael@walle.cc>,
Frieder Schrempf <frieder.schrempf@kontron.de>,
AKASHI Takahiro <takahiro.akashi@linaro.org>,
Aswath Govindraju <a-govindraju@ti.com>,
Jaehoon Chung <jh80.chung@samsung.com>,
Marek Szyprowski <m.szyprowski@samsung.com>,
Oleksandr Suvorov <oleksandr.suvorov@toradex.com>,
Patrice Chotard <patrice.chotard@foss.st.com>,
Patrick Delaunay <patrick.delaunay@foss.st.com>
Subject: Re: [PATCH 1/3] dfu: use pointer to pass length to dfu_write()
Date: Fri, 28 Jan 2022 10:21:36 -0500 [thread overview]
Message-ID: <20220128152136.GA3547581@bill-the-cat> (raw)
In-Reply-To: <20210930162208.2749155-1-frieder@fris.de>
[-- Attachment #1: Type: text/plain, Size: 3210 bytes --]
On Thu, Sep 30, 2021 at 06:22:06PM +0200, Frieder Schrempf wrote:
> From: Frieder Schrempf <frieder.schrempf@kontron.de>
>
> This doesn't include any functional changes, but allows us to use the
> size parameter to report the actual written bytes back to the caller.
>
> This is useful in cases of unaligned writes to serial flash where the
> first write covers only a part of the buffer (until the next sector
> boundary) and the remaining bytes need to be written in a further call
> to dfu_write().
>
> While at it, we also adjust the data type of the 'write' and 'left'
> variable in dfu_write_from_mem_addr() to match the values passed.
>
> Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
This causes:
aarch64: + qemu_arm64
+(qemu_arm64) In file included from include/linux/bitops.h:22,
+(qemu_arm64) from include/log.h:15,
+(qemu_arm64) from include/linux/printk.h:4,
+(qemu_arm64) from include/common.h:20,
+(qemu_arm64) from drivers/dfu/dfu.c:9:
+(qemu_arm64) drivers/dfu/dfu.c: In function 'dfu_write_from_mem_addr':
+(qemu_arm64) include/linux/kernel.h:184:24: error: comparison of distinct pointer types lacks a cast [-Werror]
+(qemu_arm64) 184 | (void) (&_min1 == &_min2); \
+(qemu_arm64) | ^~
+(qemu_arm64) drivers/dfu/dfu.c:748:25: note: in expansion of macro 'min'
+(qemu_arm64) 748 | write = min(dfu_buf_size, left);
+(qemu_arm64) | ^~~
+(qemu_arm64) In file included from include/linux/printk.h:4,
+(qemu_arm64) drivers/dfu/dfu.c:750:23: error: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'unsigned int' [-Werror=format=]
+(qemu_arm64) 750 | debug("%s: dp: 0x%p left: %lu write: %u\n", __func__,
+(qemu_arm64) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+(qemu_arm64) include/log.h:163:21: note: in definition of macro 'pr_fmt'
+(qemu_arm64) 163 | #define pr_fmt(fmt) fmt
+(qemu_arm64) | ^~~
+(qemu_arm64) include/log.h:283:9: note: in expansion of macro 'debug_cond'
+(qemu_arm64) 283 | debug_cond(_DEBUG, fmt, ##args)
+(qemu_arm64) | ^~~~~~~~~~
+(qemu_arm64) drivers/dfu/dfu.c:750:17: note: in expansion of macro 'debug'
+(qemu_arm64) | ^~~~~
+(qemu_arm64) drivers/dfu/dfu.c:750:45: note: format string is defined here
+(qemu_arm64) | ~~^
+(qemu_arm64) | |
+(qemu_arm64) | long unsigned int
+(qemu_arm64) | %u
+(qemu_arm64) cc1: all warnings being treated as errors
+(qemu_arm64) make[3]: *** [scripts/Makefile.build:253: drivers/dfu/dfu.o] Error 1
+(qemu_arm64) make[2]: *** [scripts/Makefile.build:394: drivers/dfu] Error 2
+(qemu_arm64) make[1]: *** [Makefile:1889: drivers] Error 2
+(qemu_arm64) make: *** [Makefile:177: sub-make] Error 2
Please rework and repost, thanks!
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
prev parent reply other threads:[~2022-01-28 15:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-30 16:22 [PATCH 1/3] dfu: use pointer to pass length to dfu_write() Frieder Schrempf
2021-09-30 16:22 ` [PATCH 2/3] dfu: dfu_fs: Simplify find_sector() Frieder Schrempf
2021-09-30 16:22 ` [PATCH 3/3] dfu: dfu_sf: Support unaligned offsets for writing to serial flash Frieder Schrempf
2022-01-28 15:21 ` Tom Rini [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=20220128152136.GA3547581@bill-the-cat \
--to=trini@konsulko.com \
--cc=a-govindraju@ti.com \
--cc=frieder.schrempf@kontron.de \
--cc=frieder@fris.de \
--cc=heiko.thiery@gmail.com \
--cc=jh80.chung@samsung.com \
--cc=lukma@denx.de \
--cc=m.szyprowski@samsung.com \
--cc=michael@walle.cc \
--cc=oleksandr.suvorov@toradex.com \
--cc=patrice.chotard@foss.st.com \
--cc=patrick.delaunay@foss.st.com \
--cc=takahiro.akashi@linaro.org \
--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;
as well as URLs for NNTP newsgroup(s).