Re: [PATCH v3] Staging: zram: Fix variable dereferenced before check

2013-10-22 Thread Jerome Marchand
On 10/22/2013 02:30 PM, Rashika Kheria wrote: > > > > On Mon, Oct 21, 2013 at 8:01 PM, Minchan Kim > wrote: > > Hello, > > On Mon, Oct 21, 2013 at 02:52:41PM +0530, Rashika Kheria wrote: > > This patch fixes the following Smatch warning in zram_drv.c- >

Re: [PATCH 2/2] staging: zram: remove init_done from zram struct (v2)

2013-09-10 Thread Jerome Marchand
On 09/09/2013 02:34 PM, Dan Carpenter wrote: > On Fri, Sep 06, 2013 at 06:21:20PM +0300, Sergey Senozhatsky wrote: >> @@ -558,14 +563,12 @@ static void zram_reset_device(struct zram *zram, bool >> reset_capacity) >> flush_work(&zram->free_work); >> >> down_write(&zram->init_lock); >> -

Re: [PATCH 1/2] staging: zram: minimize `slot_free_lock' usage (v2)

2013-09-10 Thread Jerome Marchand
On 09/09/2013 03:46 PM, Jerome Marchand wrote: > On 09/09/2013 03:21 PM, Dan Carpenter wrote: >> On Mon, Sep 09, 2013 at 03:49:42PM +0300, Sergey Senozhatsky wrote: >>>>> Calling handle_pending_slot_free() for every RW operation may >>>>> cause unneccessa

Re: [PATCH 1/2] staging: zram: minimize `slot_free_lock' usage (v2)

2013-09-10 Thread Jerome Marchand
On 09/09/2013 03:21 PM, Dan Carpenter wrote: > On Mon, Sep 09, 2013 at 03:49:42PM +0300, Sergey Senozhatsky wrote: Calling handle_pending_slot_free() for every RW operation may cause unneccessary slot_free_lock locking, because most likely process will see NULL slot_free_rq. handle_p

Re: [PATCH 2/2] staging: zram: remove init_done from zram struct

2013-09-06 Thread Jerome Marchand
On 09/06/2013 03:52 PM, Sergey Senozhatsky wrote: > `zram->init_done != 0' equals to `zram->meta != NULL', so init_done > can be removed. The name init_done is self explanatory, meta isn't. You could for instance write a function with an explicit name to test for initialization. Jerome > > Sign

Re: [PATCH 1/2] staging: zram: minimize `slot_free_lock' usage

2013-09-06 Thread Jerome Marchand
On 09/06/2013 03:47 PM, Sergey Senozhatsky wrote: > Calling handle_pending_slot_free() for every RW operation may > cause unneccessary slot_free_lock locking, because most likely > process will see NULL slot_free_rq. handle_pending_slot_free() > only when current detects that slot_free_rq is not NU