linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] mmc: davinci: Fix -Wpointer-to-int-cast on compile test
@ 2020-09-02 20:48 Krzysztof Kozlowski
  2020-09-02 20:48 ` [PATCH 2/3] mmc: s3cmci: Use proper printk format for iomem pointer Krzysztof Kozlowski
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2020-09-02 20:48 UTC (permalink / raw)
  To: Ulf Hansson, Ben Dooks, Krzysztof Kozlowski, linux-mmc,
	linux-kernel, linux-arm-kernel

Store in interrupt service routine always '1' in end_command, not the
value of host->cmd to fix compile test warnings on RISC-V:

  drivers/mmc/host/davinci_mmc.c:999:17: warning:
    cast from pointer to integer of different size [-Wpointer-to-int-cast]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---

Follow up to:
https://lore.kernel.org/linux-arm-kernel/20200902193658.20539-1-krzk@kernel.org/T/#t

 drivers/mmc/host/davinci_mmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/davinci_mmc.c b/drivers/mmc/host/davinci_mmc.c
index fad1010fb52b..66d740ee7d45 100644
--- a/drivers/mmc/host/davinci_mmc.c
+++ b/drivers/mmc/host/davinci_mmc.c
@@ -996,7 +996,7 @@ static irqreturn_t mmc_davinci_irq(int irq, void *dev_id)
 
 	if (qstatus & MMCST0_RSPDNE) {
 		/* End of command phase */
-		end_command = (int) host->cmd;
+		end_command = host->cmd ? 1 : 0;
 	}
 
 	if (end_command)
-- 
2.17.1


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

* [PATCH 2/3] mmc: s3cmci: Use proper printk format for iomem pointer
  2020-09-02 20:48 [PATCH 1/3] mmc: davinci: Fix -Wpointer-to-int-cast on compile test Krzysztof Kozlowski
@ 2020-09-02 20:48 ` Krzysztof Kozlowski
  2020-09-03  8:10   ` Ulf Hansson
  2020-09-02 20:48 ` [PATCH 3/3] mmc: s3cmci: Cast driver data through long Krzysztof Kozlowski
  2020-09-03  8:09 ` [PATCH 1/3] mmc: davinci: Fix -Wpointer-to-int-cast on compile test Ulf Hansson
  2 siblings, 1 reply; 6+ messages in thread
From: Krzysztof Kozlowski @ 2020-09-02 20:48 UTC (permalink / raw)
  To: Ulf Hansson, Ben Dooks, Krzysztof Kozlowski, linux-mmc,
	linux-kernel, linux-arm-kernel

iomem pointers should be printed with pointer format to hide the
actual value and fix warnings when compile testing for 64-bit
architecture:

  drivers/mmc/host/s3cmci.c:1355:46: warning:
    cast from pointer to integer of different size [-Wpointer-to-int-cast]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/mmc/host/s3cmci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/s3cmci.c b/drivers/mmc/host/s3cmci.c
index dcd458649338..3fb597095079 100644
--- a/drivers/mmc/host/s3cmci.c
+++ b/drivers/mmc/host/s3cmci.c
@@ -1352,7 +1352,7 @@ static int s3cmci_state_show(struct seq_file *seq, void *v)
 {
 	struct s3cmci_host *host = seq->private;
 
-	seq_printf(seq, "Register base = 0x%08x\n", (u32)host->base);
+	seq_printf(seq, "Register base = 0x%p\n", host->base);
 	seq_printf(seq, "Clock rate = %ld\n", host->clk_rate);
 	seq_printf(seq, "Prescale = %d\n", host->prescaler);
 	seq_printf(seq, "is2440 = %d\n", host->is2440);
-- 
2.17.1


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

* [PATCH 3/3] mmc: s3cmci: Cast driver data through long
  2020-09-02 20:48 [PATCH 1/3] mmc: davinci: Fix -Wpointer-to-int-cast on compile test Krzysztof Kozlowski
  2020-09-02 20:48 ` [PATCH 2/3] mmc: s3cmci: Use proper printk format for iomem pointer Krzysztof Kozlowski
@ 2020-09-02 20:48 ` Krzysztof Kozlowski
  2020-09-03  8:10   ` Ulf Hansson
  2020-09-03  8:09 ` [PATCH 1/3] mmc: davinci: Fix -Wpointer-to-int-cast on compile test Ulf Hansson
  2 siblings, 1 reply; 6+ messages in thread
From: Krzysztof Kozlowski @ 2020-09-02 20:48 UTC (permalink / raw)
  To: Ulf Hansson, Ben Dooks, Krzysztof Kozlowski, linux-mmc,
	linux-kernel, linux-arm-kernel

Since driver data is a pointer, direct casting to integer causes
warning when compile testing for 64-bit architecture:

  drivers/mmc/host/s3cmci.c:1495:17: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]

The actual driver data can be only 0 or 1, so cast it via long and do
not care about any loss of value.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/mmc/host/s3cmci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/s3cmci.c b/drivers/mmc/host/s3cmci.c
index 3fb597095079..ac94f926624d 100644
--- a/drivers/mmc/host/s3cmci.c
+++ b/drivers/mmc/host/s3cmci.c
@@ -1492,7 +1492,7 @@ static int s3cmci_probe_dt(struct s3cmci_host *host)
 	struct mmc_host *mmc = host->mmc;
 	int ret;
 
-	host->is2440 = (int) of_device_get_match_data(&pdev->dev);
+	host->is2440 = (long) of_device_get_match_data(&pdev->dev);
 
 	ret = mmc_of_parse(mmc);
 	if (ret)
-- 
2.17.1


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

* Re: [PATCH 1/3] mmc: davinci: Fix -Wpointer-to-int-cast on compile test
  2020-09-02 20:48 [PATCH 1/3] mmc: davinci: Fix -Wpointer-to-int-cast on compile test Krzysztof Kozlowski
  2020-09-02 20:48 ` [PATCH 2/3] mmc: s3cmci: Use proper printk format for iomem pointer Krzysztof Kozlowski
  2020-09-02 20:48 ` [PATCH 3/3] mmc: s3cmci: Cast driver data through long Krzysztof Kozlowski
@ 2020-09-03  8:09 ` Ulf Hansson
  2 siblings, 0 replies; 6+ messages in thread
From: Ulf Hansson @ 2020-09-03  8:09 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Ben Dooks, linux-mmc, Linux Kernel Mailing List, Linux ARM

On Wed, 2 Sep 2020 at 22:48, Krzysztof Kozlowski <krzk@kernel.org> wrote:
>
> Store in interrupt service routine always '1' in end_command, not the
> value of host->cmd to fix compile test warnings on RISC-V:
>
>   drivers/mmc/host/davinci_mmc.c:999:17: warning:
>     cast from pointer to integer of different size [-Wpointer-to-int-cast]
>
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>

Applied for next, thanks!

Kind regards
Uffe


> ---
>
> Follow up to:
> https://lore.kernel.org/linux-arm-kernel/20200902193658.20539-1-krzk@kernel.org/T/#t
>
>  drivers/mmc/host/davinci_mmc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/davinci_mmc.c b/drivers/mmc/host/davinci_mmc.c
> index fad1010fb52b..66d740ee7d45 100644
> --- a/drivers/mmc/host/davinci_mmc.c
> +++ b/drivers/mmc/host/davinci_mmc.c
> @@ -996,7 +996,7 @@ static irqreturn_t mmc_davinci_irq(int irq, void *dev_id)
>
>         if (qstatus & MMCST0_RSPDNE) {
>                 /* End of command phase */
> -               end_command = (int) host->cmd;
> +               end_command = host->cmd ? 1 : 0;
>         }
>
>         if (end_command)
> --
> 2.17.1
>

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

* Re: [PATCH 2/3] mmc: s3cmci: Use proper printk format for iomem pointer
  2020-09-02 20:48 ` [PATCH 2/3] mmc: s3cmci: Use proper printk format for iomem pointer Krzysztof Kozlowski
@ 2020-09-03  8:10   ` Ulf Hansson
  0 siblings, 0 replies; 6+ messages in thread
From: Ulf Hansson @ 2020-09-03  8:10 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Ben Dooks, linux-mmc, Linux Kernel Mailing List, Linux ARM

On Wed, 2 Sep 2020 at 22:49, Krzysztof Kozlowski <krzk@kernel.org> wrote:
>
> iomem pointers should be printed with pointer format to hide the
> actual value and fix warnings when compile testing for 64-bit
> architecture:
>
>   drivers/mmc/host/s3cmci.c:1355:46: warning:
>     cast from pointer to integer of different size [-Wpointer-to-int-cast]
>
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>

Applied for next, thanks!

Kind regards
Uffe


> ---
>  drivers/mmc/host/s3cmci.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/s3cmci.c b/drivers/mmc/host/s3cmci.c
> index dcd458649338..3fb597095079 100644
> --- a/drivers/mmc/host/s3cmci.c
> +++ b/drivers/mmc/host/s3cmci.c
> @@ -1352,7 +1352,7 @@ static int s3cmci_state_show(struct seq_file *seq, void *v)
>  {
>         struct s3cmci_host *host = seq->private;
>
> -       seq_printf(seq, "Register base = 0x%08x\n", (u32)host->base);
> +       seq_printf(seq, "Register base = 0x%p\n", host->base);
>         seq_printf(seq, "Clock rate = %ld\n", host->clk_rate);
>         seq_printf(seq, "Prescale = %d\n", host->prescaler);
>         seq_printf(seq, "is2440 = %d\n", host->is2440);
> --
> 2.17.1
>

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

* Re: [PATCH 3/3] mmc: s3cmci: Cast driver data through long
  2020-09-02 20:48 ` [PATCH 3/3] mmc: s3cmci: Cast driver data through long Krzysztof Kozlowski
@ 2020-09-03  8:10   ` Ulf Hansson
  0 siblings, 0 replies; 6+ messages in thread
From: Ulf Hansson @ 2020-09-03  8:10 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Ben Dooks, linux-mmc, Linux Kernel Mailing List, Linux ARM

On Wed, 2 Sep 2020 at 22:49, Krzysztof Kozlowski <krzk@kernel.org> wrote:
>
> Since driver data is a pointer, direct casting to integer causes
> warning when compile testing for 64-bit architecture:
>
>   drivers/mmc/host/s3cmci.c:1495:17: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
>
> The actual driver data can be only 0 or 1, so cast it via long and do
> not care about any loss of value.
>
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>

Applied for next, thanks!

Kind regards
Uffe


> ---
>  drivers/mmc/host/s3cmci.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/s3cmci.c b/drivers/mmc/host/s3cmci.c
> index 3fb597095079..ac94f926624d 100644
> --- a/drivers/mmc/host/s3cmci.c
> +++ b/drivers/mmc/host/s3cmci.c
> @@ -1492,7 +1492,7 @@ static int s3cmci_probe_dt(struct s3cmci_host *host)
>         struct mmc_host *mmc = host->mmc;
>         int ret;
>
> -       host->is2440 = (int) of_device_get_match_data(&pdev->dev);
> +       host->is2440 = (long) of_device_get_match_data(&pdev->dev);
>
>         ret = mmc_of_parse(mmc);
>         if (ret)
> --
> 2.17.1
>

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

end of thread, other threads:[~2020-09-03  8:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-02 20:48 [PATCH 1/3] mmc: davinci: Fix -Wpointer-to-int-cast on compile test Krzysztof Kozlowski
2020-09-02 20:48 ` [PATCH 2/3] mmc: s3cmci: Use proper printk format for iomem pointer Krzysztof Kozlowski
2020-09-03  8:10   ` Ulf Hansson
2020-09-02 20:48 ` [PATCH 3/3] mmc: s3cmci: Cast driver data through long Krzysztof Kozlowski
2020-09-03  8:10   ` Ulf Hansson
2020-09-03  8:09 ` [PATCH 1/3] mmc: davinci: Fix -Wpointer-to-int-cast on compile test Ulf Hansson

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).