From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758886AbbIDKwt (ORCPT ); Fri, 4 Sep 2015 06:52:49 -0400 Received: from mail-pa0-f54.google.com ([209.85.220.54]:32933 "EHLO mail-pa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757099AbbIDKwW (ORCPT ); Fri, 4 Sep 2015 06:52:22 -0400 From: Sudip Mukherjee To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org, Sudip Mukherjee Subject: [PATCH 4/5] staging: most: remove unneeded NULL check Date: Fri, 4 Sep 2015 16:22:05 +0530 Message-Id: <1441363926-5025-4-git-send-email-sudipm.mukherjee@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1441363926-5025-1-git-send-email-sudipm.mukherjee@gmail.com> References: <1441363926-5025-1-git-send-email-sudipm.mukherjee@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The loop cursor of list_for_each_entry_safe() can never be NULL. Signed-off-by: Sudip Mukherjee --- drivers/staging/most/mostcore/core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/most/mostcore/core.c b/drivers/staging/most/mostcore/core.c index 7bb16db..87f950f 100644 --- a/drivers/staging/most/mostcore/core.c +++ b/drivers/staging/most/mostcore/core.c @@ -190,8 +190,7 @@ static void flush_channel_fifos(struct most_c_obj *c) list_for_each_entry_safe(mbo, tmp, &c->fifo, list) { list_del(&mbo->list); spin_unlock_irqrestore(&c->fifo_lock, flags); - if (likely(mbo)) - most_free_mbo_coherent(mbo); + most_free_mbo_coherent(mbo); spin_lock_irqsave(&c->fifo_lock, flags); } spin_unlock_irqrestore(&c->fifo_lock, flags); @@ -200,8 +199,7 @@ static void flush_channel_fifos(struct most_c_obj *c) list_for_each_entry_safe(mbo, tmp, &c->halt_fifo, list) { list_del(&mbo->list); spin_unlock_irqrestore(&c->fifo_lock, hf_flags); - if (likely(mbo)) - most_free_mbo_coherent(mbo); + most_free_mbo_coherent(mbo); spin_lock_irqsave(&c->fifo_lock, hf_flags); } spin_unlock_irqrestore(&c->fifo_lock, hf_flags); -- 1.9.1