Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756174AbbDIXoO (ORCPT ); Thu, 9 Apr 2015 19:44:14 -0400 Received: from mail-wi0-f181.google.com ([209.85.212.181]:34100 "EHLO mail-wi0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754750AbbDIXoJ (ORCPT ); Thu, 9 Apr 2015 19:44:09 -0400 From: =?UTF-8?q?Giedrius=20Statkevi=C4=8Dius?= To: lidza.louina@gmail.com, markh@compro.net Cc: gregkh@linuxfoundation.org, driverdev-devel@linuxdriverproject.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, dan.carpenter@oracle.com, sudipm.mukherjee@gmail.com, =?UTF-8?q?Giedrius=20Statkevi=C4=8Dius?= Subject: [PATCH v5 3/3] staging: dgnc: remove redundant !ch checks Date: Fri, 10 Apr 2015 02:42:31 +0300 Message-Id: <1428622951-31061-3-git-send-email-giedrius.statkevicius@gmail.com> X-Mailer: git-send-email 2.3.5 In-Reply-To: <1428622951-31061-1-git-send-email-giedrius.statkevicius@gmail.com> References: <1428622951-31061-1-git-send-email-giedrius.statkevicius@gmail.com> In-Reply-To: <1428423102-29138-1-git-send-email-giedrius.statkevicius@gmail.com> References: <1428423102-29138-1-git-send-email-giedrius.statkevicius@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1888 Lines: 55 Remove checks that are redundant since we don't have boards with partially initialized ->channels[i]. Signed-off-by: Giedrius Statkevičius --- v5: there was a mistake in v4 in which a wrong check was deleted in cls_tasklet v4: splitted this from the one patch. drivers/staging/dgnc/dgnc_cls.c | 4 +--- drivers/staging/dgnc/dgnc_neo.c | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/dgnc/dgnc_cls.c b/drivers/staging/dgnc/dgnc_cls.c index e3564d2..a629a78 100644 --- a/drivers/staging/dgnc/dgnc_cls.c +++ b/drivers/staging/dgnc/dgnc_cls.c @@ -379,7 +379,7 @@ static inline void cls_parse_isr(struct dgnc_board *brd, uint port) return; ch = brd->channels[port]; - if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) + if (ch->magic != DGNC_CHANNEL_MAGIC) return; /* Here we try to figure out what caused the interrupt to happen */ @@ -714,8 +714,6 @@ static void cls_tasklet(unsigned long data) /* Loop on each port */ for (i = 0; i < ports; i++) { ch = bd->channels[i]; - if (!ch) - continue; /* * NOTE: Remember you CANNOT hold any channel diff --git a/drivers/staging/dgnc/dgnc_neo.c b/drivers/staging/dgnc/dgnc_neo.c index f5a4d36..1e583c2 100644 --- a/drivers/staging/dgnc/dgnc_neo.c +++ b/drivers/staging/dgnc/dgnc_neo.c @@ -395,7 +395,7 @@ static inline void neo_parse_isr(struct dgnc_board *brd, uint port) return; ch = brd->channels[port]; - if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) + if (ch->magic != DGNC_CHANNEL_MAGIC) return; /* Here we try to figure out what caused the interrupt to happen */ -- 2.3.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/