Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5600efb1 authored by Guennadi Liakhovetski's avatar Guennadi Liakhovetski Committed by Linus Torvalds
Browse files

mmc: fix the use of kunmap_atomic() in tmio_mmc.h



kunmap_atomic() takes the cookie, returned by the kmap_atomic() as its
argument and not the page address, used as an argument to kmap_atomic().
This patch fixes the compile error:

In file included from drivers/mmc/host/tmio_mmc.c:37:
drivers/mmc/host/tmio_mmc.h: In function 'tmio_mmc_kunmap_atomic':
drivers/mmc/host/tmio_mmc.h:192: error: negative width in bit-field '<anonymous>'

Signed-off-by: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: default avatarEric Miao <eric.y.miao@gmail.com>
Tested-by: default avatarMagnus Damm <damm@opensource.se>
Cc: <stable@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent b78d6c5f
Loading
Loading
Loading
Loading
+4 −3
Original line number Original line Diff line number Diff line
@@ -164,6 +164,7 @@ tmio_mmc_start_command(struct tmio_mmc_host *host, struct mmc_command *cmd)
static void tmio_mmc_pio_irq(struct tmio_mmc_host *host)
static void tmio_mmc_pio_irq(struct tmio_mmc_host *host)
{
{
	struct mmc_data *data = host->data;
	struct mmc_data *data = host->data;
	void *sg_virt;
	unsigned short *buf;
	unsigned short *buf;
	unsigned int count;
	unsigned int count;
	unsigned long flags;
	unsigned long flags;
@@ -173,8 +174,8 @@ static void tmio_mmc_pio_irq(struct tmio_mmc_host *host)
		return;
		return;
	}
	}


	buf = (unsigned short *)(tmio_mmc_kmap_atomic(host, &flags) +
	sg_virt = tmio_mmc_kmap_atomic(host->sg_ptr, &flags);
	      host->sg_off);
	buf = (unsigned short *)(sg_virt + host->sg_off);


	count = host->sg_ptr->length - host->sg_off;
	count = host->sg_ptr->length - host->sg_off;
	if (count > data->blksz)
	if (count > data->blksz)
@@ -191,7 +192,7 @@ static void tmio_mmc_pio_irq(struct tmio_mmc_host *host)


	host->sg_off += count;
	host->sg_off += count;


	tmio_mmc_kunmap_atomic(host, &flags);
	tmio_mmc_kunmap_atomic(sg_virt, &flags);


	if (host->sg_off == host->sg_ptr->length)
	if (host->sg_off == host->sg_ptr->length)
		tmio_mmc_next_sg(host);
		tmio_mmc_next_sg(host);
+3 −5
Original line number Original line Diff line number Diff line
@@ -174,19 +174,17 @@ static inline int tmio_mmc_next_sg(struct tmio_mmc_host *host)
	return --host->sg_len;
	return --host->sg_len;
}
}


static inline char *tmio_mmc_kmap_atomic(struct tmio_mmc_host *host,
static inline char *tmio_mmc_kmap_atomic(struct scatterlist *sg,
	unsigned long *flags)
	unsigned long *flags)
{
{
	struct scatterlist *sg = host->sg_ptr;

	local_irq_save(*flags);
	local_irq_save(*flags);
	return kmap_atomic(sg_page(sg), KM_BIO_SRC_IRQ) + sg->offset;
	return kmap_atomic(sg_page(sg), KM_BIO_SRC_IRQ) + sg->offset;
}
}


static inline void tmio_mmc_kunmap_atomic(struct tmio_mmc_host *host,
static inline void tmio_mmc_kunmap_atomic(void *virt,
	unsigned long *flags)
	unsigned long *flags)
{
{
	kunmap_atomic(sg_page(host->sg_ptr), KM_BIO_SRC_IRQ);
	kunmap_atomic(virt, KM_BIO_SRC_IRQ);
	local_irq_restore(*flags);
	local_irq_restore(*flags);
}
}