diff mbox series

lightnvm: fix unnecessary NULL check warnings

Message ID 1612230105-31365-1-git-send-email-tiantao6@hisilicon.com (mailing list archive)
State New, archived
Headers show
Series lightnvm: fix unnecessary NULL check warnings | expand

Commit Message

Tian Tao Feb. 2, 2021, 1:41 a.m. UTC
Remove NULL checks before vfree() to fix these warnings:
./drivers/lightnvm/pblk-gc.c:27:2-7: WARNING: NULL check before some
freeing functions is not needed.

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
---
 drivers/lightnvm/pblk-gc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Chaitanya Kulkarni Feb. 2, 2021, 1:47 a.m. UTC | #1
On 2/1/21 17:44, Tian Tao wrote:
> Remove NULL checks before vfree() to fix these warnings:
> ./drivers/lightnvm/pblk-gc.c:27:2-7: WARNING: NULL check before some
> freeing functions is not needed.
>
> Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Looks good.

Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Matias Bjorling Feb. 2, 2021, 4 p.m. UTC | #2
On 02/02/2021 02.47, Chaitanya Kulkarni wrote:
> On 2/1/21 17:44, Tian Tao wrote:
>> Remove NULL checks before vfree() to fix these warnings:
>> ./drivers/lightnvm/pblk-gc.c:27:2-7: WARNING: NULL check before some
>> freeing functions is not needed.
>>
>> Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
> Looks good.
>
> Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
>
Thanks, Tian and Chaitanya. I'll queue it up.
Christoph Hellwig Feb. 2, 2021, 5:24 p.m. UTC | #3
On Tue, Feb 02, 2021 at 05:00:34PM +0100, Matias Bj??rling wrote:
> Thanks, Tian and Chaitanya. I'll queue it up.

Didn't we plan to kill off lightnvm?
Matias Bjorling Feb. 2, 2021, 6:38 p.m. UTC | #4
On 02/02/2021 18.24, Christoph Hellwig wrote:
> On Tue, Feb 02, 2021 at 05:00:34PM +0100, Matias Bj??rling wrote:
>> Thanks, Tian and Chaitanya. I'll queue it up.
> Didn't we plan to kill off lightnvm?

I haven't got a clear signal from Jens for me to go ahead and submit a 
patch to remove it, or if we wanted to first deprecate it, and then 
remove after it has been deprecated for a while.
diff mbox series

Patch

diff --git a/drivers/lightnvm/pblk-gc.c b/drivers/lightnvm/pblk-gc.c
index 2581eeb..b31658b 100644
--- a/drivers/lightnvm/pblk-gc.c
+++ b/drivers/lightnvm/pblk-gc.c
@@ -23,8 +23,7 @@ 
 
 static void pblk_gc_free_gc_rq(struct pblk_gc_rq *gc_rq)
 {
-	if (gc_rq->data)
-		vfree(gc_rq->data);
+	vfree(gc_rq->data);
 	kfree(gc_rq);
 }