lkml.org 
[lkml]   [2010]   [Sep]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[081/129] mmc: fix the use of kunmap_atomic() in tmio_mmc.h
    2.6.35-stable review patch.  If anyone has any objections, please let us know.

    ------------------

    From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>

    commit 5600efb1bc2745d93ae0bc08130117a84f2b9d69 upstream.

    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: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
    Acked-by: Eric Miao <eric.y.miao@gmail.com>
    Tested-by: Magnus Damm <damm@opensource.se>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

    ---
    drivers/mmc/host/tmio_mmc.c | 7 ++++---
    drivers/mmc/host/tmio_mmc.h | 8 +++-----
    2 files changed, 7 insertions(+), 8 deletions(-)

    --- a/drivers/mmc/host/tmio_mmc.c
    +++ b/drivers/mmc/host/tmio_mmc.c
    @@ -164,6 +164,7 @@ tmio_mmc_start_command(struct tmio_mmc_h
    static void tmio_mmc_pio_irq(struct tmio_mmc_host *host)
    {
    struct mmc_data *data = host->data;
    + void *sg_virt;
    unsigned short *buf;
    unsigned int count;
    unsigned long flags;
    @@ -173,8 +174,8 @@ static void tmio_mmc_pio_irq(struct tmio
    return;
    }

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

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

    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)
    tmio_mmc_next_sg(host);
    --- a/drivers/mmc/host/tmio_mmc.h
    +++ b/drivers/mmc/host/tmio_mmc.h
    @@ -174,19 +174,17 @@ static inline int tmio_mmc_next_sg(struc
    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)
    {
    - struct scatterlist *sg = host->sg_ptr;
    -
    local_irq_save(*flags);
    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)
    {
    - kunmap_atomic(sg_page(host->sg_ptr), KM_BIO_SRC_IRQ);
    + kunmap_atomic(virt, KM_BIO_SRC_IRQ);
    local_irq_restore(*flags);
    }




    \
     
     \ /
      Last update: 2010-09-18 21:19    [W:4.806 / U:1.012 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site