diff mbox

mmc: silence a shift wrapping warning

Message ID 20141023113700.GB13250@mwanda (mailing list archive)
State New, archived
Headers show

Commit Message

Dan Carpenter Oct. 23, 2014, 11:37 a.m. UTC
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>

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Ulf Hansson Oct. 27, 2014, 3:40 p.m. UTC | #1
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);
>  }
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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);
 }