* [PATCH] mtd: mtdpart: Change size type from fdt_addr_t to fdt_size_t
@ 2022-05-13 20:24 Pali Rohár
2022-05-15 10:21 ` Marek Behún
2022-06-07 16:46 ` Tom Rini
0 siblings, 2 replies; 3+ messages in thread
From: Pali Rohár @ 2022-05-13 20:24 UTC (permalink / raw)
To: Marek Behún, Heinrich Schuchardt, Jagan Teki, Simon Glass; +Cc: u-boot
Set correct type for 3rd argument of ofnode_get_addr_size_index_notrans()
function. It expects fdt_size_t * and not fdt_addr_t *.
When these two types do not have same size then U-Boot throw compile
warning:
drivers/mtd/mtdpart.c: In function ‘add_mtd_partitions_of’:
drivers/mtd/mtdpart.c:906:57: warning: passing argument 3 of ‘ofnode_get_addr_size_index_notrans’ from incompatible pointer type [-Wincompatible-pointer-types]
offset = ofnode_get_addr_size_index_notrans(child, 0, &size);
^~~~~
In file included from include/dm/device.h:13,
from include/linux/mtd/mtd.h:26,
from include/ubi_uboot.h:28,
from drivers/mtd/mtdpart.c:27:
include/dm/ofnode.h:530:25: note: expected ‘fdt_size_t *’ {aka ‘long long unsigned int *’} but argument is of type ‘fdt_addr_t *’ {aka ‘long unsigned int *’}
fdt_size_t *size);
~~~~~~~~~~~~^~~~
Signed-off-by: Pali Rohár <pali@kernel.org>
---
drivers/mtd/mtdpart.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c
index 4119ea4ff6b0..adc0515730d5 100644
--- a/drivers/mtd/mtdpart.c
+++ b/drivers/mtd/mtdpart.c
@@ -898,7 +898,8 @@ int add_mtd_partitions_of(struct mtd_info *master)
ofnode_for_each_subnode(child, parts) {
struct mtd_partition part = { 0 };
struct mtd_info *slave;
- fdt_addr_t offset, size;
+ fdt_addr_t offset;
+ fdt_size_t size;
if (!ofnode_is_available(child))
continue;
--
2.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] mtd: mtdpart: Change size type from fdt_addr_t to fdt_size_t
2022-05-13 20:24 [PATCH] mtd: mtdpart: Change size type from fdt_addr_t to fdt_size_t Pali Rohár
@ 2022-05-15 10:21 ` Marek Behún
2022-06-07 16:46 ` Tom Rini
1 sibling, 0 replies; 3+ messages in thread
From: Marek Behún @ 2022-05-15 10:21 UTC (permalink / raw)
To: Pali Rohár; +Cc: Heinrich Schuchardt, Jagan Teki, Simon Glass, u-boot
On Fri, 13 May 2022 22:24:51 +0200
Pali Rohár <pali@kernel.org> wrote:
> Set correct type for 3rd argument of ofnode_get_addr_size_index_notrans()
> function. It expects fdt_size_t * and not fdt_addr_t *.
>
> When these two types do not have same size then U-Boot throw compile
> warning:
>
> drivers/mtd/mtdpart.c: In function ‘add_mtd_partitions_of’:
> drivers/mtd/mtdpart.c:906:57: warning: passing argument 3 of ‘ofnode_get_addr_size_index_notrans’ from incompatible pointer type [-Wincompatible-pointer-types]
> offset = ofnode_get_addr_size_index_notrans(child, 0, &size);
> ^~~~~
> In file included from include/dm/device.h:13,
> from include/linux/mtd/mtd.h:26,
> from include/ubi_uboot.h:28,
> from drivers/mtd/mtdpart.c:27:
> include/dm/ofnode.h:530:25: note: expected ‘fdt_size_t *’ {aka ‘long long unsigned int *’} but argument is of type ‘fdt_addr_t *’ {aka ‘long unsigned int *’}
> fdt_size_t *size);
> ~~~~~~~~~~~~^~~~
>
> Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] mtd: mtdpart: Change size type from fdt_addr_t to fdt_size_t
2022-05-13 20:24 [PATCH] mtd: mtdpart: Change size type from fdt_addr_t to fdt_size_t Pali Rohár
2022-05-15 10:21 ` Marek Behún
@ 2022-06-07 16:46 ` Tom Rini
1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2022-06-07 16:46 UTC (permalink / raw)
To: Pali Rohár
Cc: Marek Behún, Heinrich Schuchardt, Jagan Teki, Simon Glass,
u-boot
[-- Attachment #1: Type: text/plain, Size: 1300 bytes --]
On Fri, May 13, 2022 at 10:24:51PM +0200, Pali Rohár wrote:
> Set correct type for 3rd argument of ofnode_get_addr_size_index_notrans()
> function. It expects fdt_size_t * and not fdt_addr_t *.
>
> When these two types do not have same size then U-Boot throw compile
> warning:
>
> drivers/mtd/mtdpart.c: In function ‘add_mtd_partitions_of’:
> drivers/mtd/mtdpart.c:906:57: warning: passing argument 3 of ‘ofnode_get_addr_size_index_notrans’ from incompatible pointer type [-Wincompatible-pointer-types]
> offset = ofnode_get_addr_size_index_notrans(child, 0, &size);
> ^~~~~
> In file included from include/dm/device.h:13,
> from include/linux/mtd/mtd.h:26,
> from include/ubi_uboot.h:28,
> from drivers/mtd/mtdpart.c:27:
> include/dm/ofnode.h:530:25: note: expected ‘fdt_size_t *’ {aka ‘long long unsigned int *’} but argument is of type ‘fdt_addr_t *’ {aka ‘long unsigned int *’}
> fdt_size_t *size);
> ~~~~~~~~~~~~^~~~
>
> Signed-off-by: Pali Rohár <pali@kernel.org>
> Reviewed-by: Marek Behún <marek.behun@nic.cz>
Applied to u-boot/next, thanks!
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-06-07 16:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-13 20:24 [PATCH] mtd: mtdpart: Change size type from fdt_addr_t to fdt_size_t Pali Rohár
2022-05-15 10:21 ` Marek Behún
2022-06-07 16:46 ` Tom Rini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox