From: "Giedrius Statkevičius" <giedrius.statkevicius@gmail.com>
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,
"Giedrius Statkevičius" <giedrius.statkevicius@gmail.com>
Subject: [PATCH v5 3/3] staging: dgnc: remove redundant !ch checks
Date: Fri, 10 Apr 2015 02:42:31 +0300 [thread overview]
Message-ID: <1428622951-31061-3-git-send-email-giedrius.statkevicius@gmail.com> (raw)
In-Reply-To: <1428622951-31061-1-git-send-email-giedrius.statkevicius@gmail.com>
In-Reply-To: <1428423102-29138-1-git-send-email-giedrius.statkevicius@gmail.com>
Remove checks that are redundant since we don't have boards with partially
initialized ->channels[i].
Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com>
---
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
next prev parent reply other threads:[~2015-04-09 23:44 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-07 10:26 [PATCH] staging: dgnc: check if kzalloc fails in dgnc_tty_init() Giedrius Statkevičius
2015-04-07 10:41 ` Sudip Mukherjee
2015-04-07 11:53 ` Giedrius Statkevičius
2015-04-07 12:40 ` [PATCH v2] " Giedrius Statkevičius
2015-04-07 13:01 ` Dan Carpenter
2015-04-07 13:25 ` Giedrius Statkevičius
2015-04-07 14:11 ` [PATCH v3] " Giedrius Statkevičius
2015-04-07 14:24 ` Sudip Mukherjee
2015-04-07 14:37 ` Giedrius Statkevičius
2015-04-07 14:54 ` Dan Carpenter
2015-04-07 14:48 ` Dan Carpenter
2015-04-07 15:35 ` Giedrius Statkevičius
2015-04-07 15:46 ` Dan Carpenter
2015-04-07 16:11 ` [PATCH v4 1/3] staging: dgnc: clean up allocation of ->channels[i] Giedrius Statkevičius
2015-04-09 23:42 ` [PATCH v5 " Giedrius Statkevičius
2015-04-09 23:42 ` [PATCH v5 2/3] staging: dgnc: don't forget to check if ->channels[i] is NULL in dgnc_tty_uninit() Giedrius Statkevičius
2015-04-09 23:42 ` Giedrius Statkevičius [this message]
2015-04-07 16:11 ` [PATCH v4 " Giedrius Statkevičius
2015-04-07 16:11 ` [PATCH v4 3/3] staging: dgnc: remove redundant !ch checks Giedrius Statkevičius
2015-04-10 0:37 ` Dan Carpenter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1428622951-31061-3-git-send-email-giedrius.statkevicius@gmail.com \
--to=giedrius.statkevicius@gmail.com \
--cc=dan.carpenter@oracle.com \
--cc=devel@driverdev.osuosl.org \
--cc=driverdev-devel@linuxdriverproject.org \
--cc=gregkh@linuxfoundation.org \
--cc=lidza.louina@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=markh@compro.net \
--cc=sudipm.mukherjee@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®