* Re: [PATCH] mtd: onenand: omap2: print resource using %pR format string
2018-01-16 7:43 [PATCH] mtd: onenand: omap2: print resource using %pR format string Arnd Bergmann
@ 2018-01-16 8:22 ` Sebastian Reichel
2018-01-16 8:23 ` Peter Ujfalusi
2018-01-16 9:44 ` Boris Brezillon
2 siblings, 0 replies; 4+ messages in thread
From: Sebastian Reichel @ 2018-01-16 8:22 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Kyungmin Park, David Woodhouse, Brian Norris, Boris Brezillon,
Marek Vasut, Richard Weinberger, Cyrille Pitchen, Ladislav Michl,
Roger Quadros, Peter Ujfalusi, linux-mtd, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1838 bytes --]
Hi,
On Tue, Jan 16, 2018 at 08:43:40AM +0100, Arnd Bergmann wrote:
> The omap2 onenand driver is now available for compile-testing, which
> uncovers a warning in configurations that have a 64-bit resource_size_t:
>
> drivers/mtd/onenand/omap2.c: In function 'omap2_onenand_probe':
> drivers/mtd/onenand/omap2.c:536:54: error: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'resource_size_t {aka long long unsigned int}' [-Werror=format=]
> dev_err(dev, "Cannot reserve memory region at 0x%08x, size: 0x%x\n",
> drivers/mtd/onenand/omap2.c:536:66: error: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'resource_size_t {aka long long unsigned int}' [-Werror=format=]
>
> Changing the format string to the special %pR simplifies the code
> and lets it do the right thing in that configuration, while avoiding
> the warning.
>
> Fixes: a758f50f10cf ("mtd: onenand: omap2: Configure driver from DT")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
-- Sebastian
> ---
> drivers/mtd/onenand/omap2.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/mtd/onenand/omap2.c b/drivers/mtd/onenand/omap2.c
> index 2ce73fb6da1c..a4a2159bcfb7 100644
> --- a/drivers/mtd/onenand/omap2.c
> +++ b/drivers/mtd/onenand/omap2.c
> @@ -533,8 +533,7 @@ static int omap2_onenand_probe(struct platform_device *pdev)
>
> c->onenand.base = devm_ioremap_resource(dev, res);
> if (IS_ERR(c->onenand.base)) {
> - dev_err(dev, "Cannot reserve memory region at 0x%08x, size: 0x%x\n",
> - res->start, resource_size(res));
> + dev_err(dev, "Cannot reserve memory region %pR\n", res);
> return PTR_ERR(c->onenand.base);
> }
>
> --
> 2.9.0
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] mtd: onenand: omap2: print resource using %pR format string
2018-01-16 7:43 [PATCH] mtd: onenand: omap2: print resource using %pR format string Arnd Bergmann
2018-01-16 8:22 ` Sebastian Reichel
@ 2018-01-16 8:23 ` Peter Ujfalusi
2018-01-16 9:44 ` Boris Brezillon
2 siblings, 0 replies; 4+ messages in thread
From: Peter Ujfalusi @ 2018-01-16 8:23 UTC (permalink / raw)
To: Arnd Bergmann, Kyungmin Park, David Woodhouse, Brian Norris,
Boris Brezillon, Marek Vasut, Richard Weinberger, Cyrille Pitchen
Cc: Ladislav Michl, Roger Quadros, Sebastian Reichel, linux-mtd,
linux-kernel
On 2018-01-16 09:43, Arnd Bergmann wrote:
> The omap2 onenand driver is now available for compile-testing, which
> uncovers a warning in configurations that have a 64-bit resource_size_t:
>
> drivers/mtd/onenand/omap2.c: In function 'omap2_onenand_probe':
> drivers/mtd/onenand/omap2.c:536:54: error: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'resource_size_t {aka long long unsigned int}' [-Werror=format=]
> dev_err(dev, "Cannot reserve memory region at 0x%08x, size: 0x%x\n",
> drivers/mtd/onenand/omap2.c:536:66: error: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'resource_size_t {aka long long unsigned int}' [-Werror=format=]
>
> Changing the format string to the special %pR simplifies the code
> and lets it do the right thing in that configuration, while avoiding
> the warning.
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
> Fixes: a758f50f10cf ("mtd: onenand: omap2: Configure driver from DT")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> drivers/mtd/onenand/omap2.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/mtd/onenand/omap2.c b/drivers/mtd/onenand/omap2.c
> index 2ce73fb6da1c..a4a2159bcfb7 100644
> --- a/drivers/mtd/onenand/omap2.c
> +++ b/drivers/mtd/onenand/omap2.c
> @@ -533,8 +533,7 @@ static int omap2_onenand_probe(struct platform_device *pdev)
>
> c->onenand.base = devm_ioremap_resource(dev, res);
> if (IS_ERR(c->onenand.base)) {
> - dev_err(dev, "Cannot reserve memory region at 0x%08x, size: 0x%x\n",
> - res->start, resource_size(res));
> + dev_err(dev, "Cannot reserve memory region %pR\n", res);
> return PTR_ERR(c->onenand.base);
> }
>
>
- Péter
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] mtd: onenand: omap2: print resource using %pR format string
2018-01-16 7:43 [PATCH] mtd: onenand: omap2: print resource using %pR format string Arnd Bergmann
2018-01-16 8:22 ` Sebastian Reichel
2018-01-16 8:23 ` Peter Ujfalusi
@ 2018-01-16 9:44 ` Boris Brezillon
2 siblings, 0 replies; 4+ messages in thread
From: Boris Brezillon @ 2018-01-16 9:44 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Kyungmin Park, David Woodhouse, Brian Norris, Marek Vasut,
Richard Weinberger, Cyrille Pitchen, Ladislav Michl,
Roger Quadros, Peter Ujfalusi, Sebastian Reichel, linux-mtd,
linux-kernel
On Tue, 16 Jan 2018 08:43:40 +0100
Arnd Bergmann <arnd@arndb.de> wrote:
> The omap2 onenand driver is now available for compile-testing, which
> uncovers a warning in configurations that have a 64-bit resource_size_t:
>
> drivers/mtd/onenand/omap2.c: In function 'omap2_onenand_probe':
> drivers/mtd/onenand/omap2.c:536:54: error: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'resource_size_t {aka long long unsigned int}' [-Werror=format=]
> dev_err(dev, "Cannot reserve memory region at 0x%08x, size: 0x%x\n",
> drivers/mtd/onenand/omap2.c:536:66: error: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'resource_size_t {aka long long unsigned int}' [-Werror=format=]
>
> Changing the format string to the special %pR simplifies the code
> and lets it do the right thing in that configuration, while avoiding
> the warning.
>
Applied. I'll adjust my PR to include this fix.
Thanks,
Boris
> Fixes: a758f50f10cf ("mtd: onenand: omap2: Configure driver from DT")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> drivers/mtd/onenand/omap2.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/mtd/onenand/omap2.c b/drivers/mtd/onenand/omap2.c
> index 2ce73fb6da1c..a4a2159bcfb7 100644
> --- a/drivers/mtd/onenand/omap2.c
> +++ b/drivers/mtd/onenand/omap2.c
> @@ -533,8 +533,7 @@ static int omap2_onenand_probe(struct platform_device *pdev)
>
> c->onenand.base = devm_ioremap_resource(dev, res);
> if (IS_ERR(c->onenand.base)) {
> - dev_err(dev, "Cannot reserve memory region at 0x%08x, size: 0x%x\n",
> - res->start, resource_size(res));
> + dev_err(dev, "Cannot reserve memory region %pR\n", res);
> return PTR_ERR(c->onenand.base);
> }
>
^ permalink raw reply [flat|nested] 4+ messages in thread