* [PATCH 2/3] mtd: atmel nand: fix build warning on 64-bit
[not found] <20180709155730.2422841-1-arnd@arndb.de>
@ 2018-07-09 15:57 ` Arnd Bergmann
2018-07-13 9:56 ` Tudor Ambarus
2018-07-09 15:57 ` [PATCH 3/3] mtd: sunxi_nand: fix build warning Arnd Bergmann
1 sibling, 1 reply; 7+ messages in thread
From: Arnd Bergmann @ 2018-07-09 15:57 UTC (permalink / raw)
To: linux-arm-kernel
Build-testing this driver on a 64-bit architecture produces a
harmless warning:
drivers/mtd/nand/raw/atmel/nand-controller.c: In function 'atmel_smc_nand_controller_init':
drivers/mtd/nand/raw/atmel/nand-controller.c:2053:21: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
To cast the pointer correctly, the destination type should be
uintptr_t rather than a 32-bit int.
Fixes: c2f3d0b913a5 ("mtd: rawnand: atmel: Allow selection of this driver when COMPILE_TEST=y")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/mtd/nand/raw/atmel/nand-controller.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mtd/nand/raw/atmel/nand-controller.c b/drivers/mtd/nand/raw/atmel/nand-controller.c
index e686fe73159e..e8f7549d0354 100644
--- a/drivers/mtd/nand/raw/atmel/nand-controller.c
+++ b/drivers/mtd/nand/raw/atmel/nand-controller.c
@@ -2050,7 +2050,7 @@ atmel_smc_nand_controller_init(struct atmel_smc_nand_controller *nc)
return ret;
}
- nc->ebi_csa_offs = (unsigned int)match->data;
+ nc->ebi_csa_offs = (uintptr_t)match->data;
/*
* The at91sam9263 has 2 EBIs, if the NAND controller is under EBI1
--
2.9.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/3] mtd: sunxi_nand: fix build warning
[not found] <20180709155730.2422841-1-arnd@arndb.de>
2018-07-09 15:57 ` [PATCH 2/3] mtd: atmel nand: fix build warning on 64-bit Arnd Bergmann
@ 2018-07-09 15:57 ` Arnd Bergmann
1 sibling, 0 replies; 7+ messages in thread
From: Arnd Bergmann @ 2018-07-09 15:57 UTC (permalink / raw)
To: linux-arm-kernel
build-testing this driver on x86 shows a new warning:
Fixes: b3d926a3d6e0 ("mtd: rawnand: sunxi: Allow selection of this driver when COMPILE_TEST=y")
drivers/mtd/nand/raw/sunxi_nand.c: In function 'sunxi_nfc_hw_ecc_read_chunks_dma':
drivers/mtd/nand/raw/sunxi_nand.c:130:22: error: conversion from 'long unsigned int' to 'unsigned int' changes value from '18446744071631273984' to '2216689664' [-Werror=overflow]
#define NFC_PAGE_OP (2 << 30)
drivers/mtd/nand/raw/sunxi_nand.c:1040:9: note: in expansion of macro 'NFC_PAGE_OP'
writel(NFC_PAGE_OP | NFC_DATA_SWAP_METHOD | NFC_DATA_TRANS,
^~~~~~~~~~~
drivers/mtd/nand/raw/sunxi_nand.c: In function 'sunxi_nfc_hw_ecc_write_page_dma':
drivers/mtd/nand/raw/sunxi_nand.c:130:22: error: conversion from 'long unsigned int' to 'unsigned int' changes value from '18446744071632322560' to '2217738240' [-Werror=overflow]
#define NFC_PAGE_OP (2 << 30)
drivers/mtd/nand/raw/sunxi_nand.c:1406:9: note: in expansion of macro 'NFC_PAGE_OP'
writel(NFC_PAGE_OP | NFC_DATA_SWAP_METHOD |
This is easy to avoid by ensuring that the constants are 'unsigned'.
Fixes: b3d926a3d6e0 ("mtd: rawnand: sunxi: Allow selection of this driver when COMPILE_TEST=y")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/mtd/nand/raw/sunxi_nand.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/mtd/nand/raw/sunxi_nand.c b/drivers/mtd/nand/raw/sunxi_nand.c
index d831a141a196..fa5c48502fa8 100644
--- a/drivers/mtd/nand/raw/sunxi_nand.c
+++ b/drivers/mtd/nand/raw/sunxi_nand.c
@@ -125,9 +125,9 @@
#define NFC_SEND_CMD3 BIT(28)
#define NFC_SEND_CMD4 BIT(29)
#define NFC_CMD_TYPE_MSK GENMASK(31, 30)
-#define NFC_NORMAL_OP (0 << 30)
-#define NFC_ECC_OP (1 << 30)
-#define NFC_PAGE_OP (2 << 30)
+#define NFC_NORMAL_OP (0u << 30)
+#define NFC_ECC_OP (1u << 30)
+#define NFC_PAGE_OP (2u << 30)
/* define bit use in NFC_RCMD_SET */
#define NFC_READ_CMD_MSK GENMASK(7, 0)
--
2.9.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/3] mtd: atmel nand: fix build warning on 64-bit
2018-07-09 15:57 ` [PATCH 2/3] mtd: atmel nand: fix build warning on 64-bit Arnd Bergmann
@ 2018-07-13 9:56 ` Tudor Ambarus
2018-07-13 10:16 ` Arnd Bergmann
0 siblings, 1 reply; 7+ messages in thread
From: Tudor Ambarus @ 2018-07-13 9:56 UTC (permalink / raw)
To: linux-arm-kernel
Hi, Arnd,
On 07/09/2018 06:57 PM, Arnd Bergmann wrote:
> + nc->ebi_csa_offs = (uintptr_t)match->data;
I guess we should declare ebi_csa_offs as size_t, right?
Best,
ta
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/3] mtd: atmel nand: fix build warning on 64-bit
2018-07-13 9:56 ` Tudor Ambarus
@ 2018-07-13 10:16 ` Arnd Bergmann
2018-07-17 21:05 ` Miquel Raynal
0 siblings, 1 reply; 7+ messages in thread
From: Arnd Bergmann @ 2018-07-13 10:16 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Jul 13, 2018 at 11:56 AM, Tudor Ambarus
<tudor.ambarus@microchip.com> wrote:
> Hi, Arnd,
>
> On 07/09/2018 06:57 PM, Arnd Bergmann wrote:
>> + nc->ebi_csa_offs = (uintptr_t)match->data;
>
> I guess we should declare ebi_csa_offs as size_t, right?
Yes, that would make sense, though it doesn't change the behavior.
Arnd
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/3] mtd: atmel nand: fix build warning on 64-bit
2018-07-13 10:16 ` Arnd Bergmann
@ 2018-07-17 21:05 ` Miquel Raynal
2018-07-17 21:08 ` Boris Brezillon
0 siblings, 1 reply; 7+ messages in thread
From: Miquel Raynal @ 2018-07-17 21:05 UTC (permalink / raw)
To: linux-arm-kernel
Hi Arnd,
Arnd Bergmann <arnd@arndb.de> wrote on Fri, 13 Jul 2018 12:16:09 +0200:
> On Fri, Jul 13, 2018 at 11:56 AM, Tudor Ambarus
> <tudor.ambarus@microchip.com> wrote:
> > Hi, Arnd,
> >
> > On 07/09/2018 06:57 PM, Arnd Bergmann wrote:
> >> + nc->ebi_csa_offs = (uintptr_t)match->data;
> >
> > I guess we should declare ebi_csa_offs as size_t, right?
>
> Yes, that would make sense, though it doesn't change the behavior.
>
Do you plan to send a new version? I don't want to mess with
improvised casts :)
Thanks,
Miqu?l
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/3] mtd: atmel nand: fix build warning on 64-bit
2018-07-17 21:05 ` Miquel Raynal
@ 2018-07-17 21:08 ` Boris Brezillon
2018-07-18 6:56 ` Miquel Raynal
0 siblings, 1 reply; 7+ messages in thread
From: Boris Brezillon @ 2018-07-17 21:08 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, 17 Jul 2018 23:05:23 +0200
Miquel Raynal <miquel.raynal@bootlin.com> wrote:
> Hi Arnd,
>
> Arnd Bergmann <arnd@arndb.de> wrote on Fri, 13 Jul 2018 12:16:09 +0200:
>
> > On Fri, Jul 13, 2018 at 11:56 AM, Tudor Ambarus
> > <tudor.ambarus@microchip.com> wrote:
> > > Hi, Arnd,
> > >
> > > On 07/09/2018 06:57 PM, Arnd Bergmann wrote:
> > >> + nc->ebi_csa_offs = (uintptr_t)match->data;
> > >
> > > I guess we should declare ebi_csa_offs as size_t, right?
> >
> > Yes, that would make sense, though it doesn't change the behavior.
> >
>
> Do you plan to send a new version? I don't want to mess with
> improvised casts :)
This fix is already part of my COMPILE_TEST series (v2), and I don't
thing declaring ->ebi_csa_offs as a size_t is useful.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/3] mtd: atmel nand: fix build warning on 64-bit
2018-07-17 21:08 ` Boris Brezillon
@ 2018-07-18 6:56 ` Miquel Raynal
0 siblings, 0 replies; 7+ messages in thread
From: Miquel Raynal @ 2018-07-18 6:56 UTC (permalink / raw)
To: linux-arm-kernel
Hi Boris,
Boris Brezillon <boris.brezillon@bootlin.com> wrote on Tue, 17 Jul 2018
23:08:39 +0200:
> On Tue, 17 Jul 2018 23:05:23 +0200
> Miquel Raynal <miquel.raynal@bootlin.com> wrote:
>
> > Hi Arnd,
> >
> > Arnd Bergmann <arnd@arndb.de> wrote on Fri, 13 Jul 2018 12:16:09 +0200:
> >
> > > On Fri, Jul 13, 2018 at 11:56 AM, Tudor Ambarus
> > > <tudor.ambarus@microchip.com> wrote:
> > > > Hi, Arnd,
> > > >
> > > > On 07/09/2018 06:57 PM, Arnd Bergmann wrote:
> > > >> + nc->ebi_csa_offs = (uintptr_t)match->data;
> > > >
> > > > I guess we should declare ebi_csa_offs as size_t, right?
> > >
> > > Yes, that would make sense, though it doesn't change the behavior.
> > >
> >
> > Do you plan to send a new version? I don't want to mess with
> > improvised casts :)
>
> This fix is already part of my COMPILE_TEST series (v2), and I don't
> thing declaring ->ebi_csa_offs as a size_t is useful.
I missed that, ok.
Thanks,
Miqu?l
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2018-07-18 6:56 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20180709155730.2422841-1-arnd@arndb.de>
2018-07-09 15:57 ` [PATCH 2/3] mtd: atmel nand: fix build warning on 64-bit Arnd Bergmann
2018-07-13 9:56 ` Tudor Ambarus
2018-07-13 10:16 ` Arnd Bergmann
2018-07-17 21:05 ` Miquel Raynal
2018-07-17 21:08 ` Boris Brezillon
2018-07-18 6:56 ` Miquel Raynal
2018-07-09 15:57 ` [PATCH 3/3] mtd: sunxi_nand: fix build warning Arnd Bergmann
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).