lkml.org 
[lkml]   [2011]   [Jun]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 1/4] Staging: zram: Remove useless offset calculation in handle_uncompressed_page()
    On 06/10/2011 06:28 AM, Jerome Marchand wrote:
    > The offset of uncompressed page is always zero: handle_uncompressed_page()
    > doesn't have to care about it.
    >
    > Signed-off-by: Jerome Marchand<jmarchan@redhat.com>
    > ---
    > drivers/staging/zram/zram_drv.c | 3 +--
    > 1 files changed, 1 insertions(+), 2 deletions(-)
    >
    > diff --git a/drivers/staging/zram/zram_drv.c b/drivers/staging/zram/zram_drv.c
    > index aab4ec4..3305e1a 100644
    > --- a/drivers/staging/zram/zram_drv.c
    > +++ b/drivers/staging/zram/zram_drv.c
    > @@ -194,8 +194,7 @@ static void handle_uncompressed_page(struct zram *zram,
    > unsigned char *user_mem, *cmem;
    >
    > user_mem = kmap_atomic(page, KM_USER0);
    > - cmem = kmap_atomic(zram->table[index].page, KM_USER1) +
    > - zram->table[index].offset;
    > + cmem = kmap_atomic(zram->table[index].page, KM_USER1);
    >
    > memcpy(user_mem, cmem, PAGE_SIZE);
    > kunmap_atomic(user_mem, KM_USER0);


    kmap/kunmap requests needs to be strictly nested, so here kunmap(...,
    KM_USER1) must be done before kunmap(..., KM_USER0). This needs to be
    fixed in zram_bvec_read() also. Though these bugs are not introduced
    by your patches, it would be nice to have them include them in your
    patch series only.

    Thanks for the fixes.
    Nitin



    \
     
     \ /
      Last update: 2011-06-10 18:41    [W:2.442 / U:0.280 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site