public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] mmc: silence a shift wrapping warning
@ 2014-10-23 11:37 Dan Carpenter
  2014-10-27 15:40 ` Ulf Hansson
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2014-10-23 11:37 UTC (permalink / raw)
  To: Chris Ball
  Cc: Ulf Hansson, Rafael J. Wysocki, Aaron Lu, Geert Uytterhoeven,
	Greg Kroah-Hartman, linux-mmc, kernel-janitors

Presumably ->slotno is normally fairly small and the shift doesn't wrap
but static checkers will complain about it.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/mmc/core/sdio_bus.c b/drivers/mmc/core/sdio_bus.c
index 6da97b1..9a98cc7 100644
--- a/drivers/mmc/core/sdio_bus.c
+++ b/drivers/mmc/core/sdio_bus.c
@@ -295,7 +295,7 @@ struct sdio_func *sdio_alloc_func(struct mmc_card *card)
 static void sdio_acpi_set_handle(struct sdio_func *func)
 {
 	struct mmc_host *host = func->card->host;
-	u64 addr = (host->slotno << 16) | func->num;
+	u64 addr = ((u64)host->slotno << 16) | func->num;
 
 	acpi_preset_companion(&func->dev, ACPI_COMPANION(host->parent), addr);
 }

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

* Re: [patch] mmc: silence a shift wrapping warning
  2014-10-23 11:37 [patch] mmc: silence a shift wrapping warning Dan Carpenter
@ 2014-10-27 15:40 ` Ulf Hansson
  0 siblings, 0 replies; 2+ messages in thread
From: Ulf Hansson @ 2014-10-27 15:40 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Chris Ball, Rafael J. Wysocki, Aaron Lu, Geert Uytterhoeven,
	Greg Kroah-Hartman, linux-mmc, kernel-janitors

On 23 October 2014 13:37, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> Presumably ->slotno is normally fairly small and the shift doesn't wrap
> but static checkers will complain about it.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Thanks! Applied for next.

Kind regards
Uffe

>
> diff --git a/drivers/mmc/core/sdio_bus.c b/drivers/mmc/core/sdio_bus.c
> index 6da97b1..9a98cc7 100644
> --- a/drivers/mmc/core/sdio_bus.c
> +++ b/drivers/mmc/core/sdio_bus.c
> @@ -295,7 +295,7 @@ struct sdio_func *sdio_alloc_func(struct mmc_card *card)
>  static void sdio_acpi_set_handle(struct sdio_func *func)
>  {
>         struct mmc_host *host = func->card->host;
> -       u64 addr = (host->slotno << 16) | func->num;
> +       u64 addr = ((u64)host->slotno << 16) | func->num;
>
>         acpi_preset_companion(&func->dev, ACPI_COMPANION(host->parent), addr);
>  }

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

end of thread, other threads:[~2014-10-27 15:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-23 11:37 [patch] mmc: silence a shift wrapping warning Dan Carpenter
2014-10-27 15:40 ` Ulf Hansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox