From: Dan Carpenter <dan.carpenter@oracle.com>
To: kernel-janitors@vger.kernel.org
Subject: [patch] staging: comedi: ni_tio: remove some dead code
Date: Thu, 31 Jul 2014 09:29:18 +0000 [thread overview]
Message-ID: <20140731092918.GD30276@mwanda> (raw)
These conditions can never be true because "i" is always one more than
NI_660X_MAX_RTSI_CHAN after the loop.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/staging/comedi/drivers/ni_tio.c b/drivers/staging/comedi/drivers/ni_tio.c
index f9f6320..9d4b46c 100644
--- a/drivers/staging/comedi/drivers/ni_tio.c
+++ b/drivers/staging/comedi/drivers/ni_tio.c
@@ -1041,14 +1041,10 @@ static unsigned ni_660x_gate_to_generic_gate(unsigned gate)
if (gate = NI_660X_RTSI_GATE_SEL(i))
return NI_GPCT_RTSI_GATE_SELECT(i);
}
- if (i <= NI_660X_MAX_RTSI_CHAN)
- break;
for (i = 0; i <= NI_660X_MAX_GATE_PIN; ++i) {
if (gate = NI_660X_PIN_GATE_SEL(i))
return NI_GPCT_GATE_PIN_GATE_SELECT(i);
}
- if (i <= NI_660X_MAX_GATE_PIN)
- break;
BUG();
break;
}
@@ -1081,14 +1077,10 @@ static unsigned ni_m_gate_to_generic_gate(unsigned gate)
if (gate = NI_M_RTSI_GATE_SEL(i))
return NI_GPCT_RTSI_GATE_SELECT(i);
}
- if (i <= NI_M_MAX_RTSI_CHAN)
- break;
for (i = 0; i <= NI_M_MAX_PFI_CHAN; ++i) {
if (gate = NI_M_PFI_GATE_SEL(i))
return NI_GPCT_PFI_GATE_SELECT(i);
}
- if (i <= NI_M_MAX_PFI_CHAN)
- break;
BUG();
break;
}
@@ -1117,14 +1109,10 @@ static unsigned ni_660x_gate2_to_generic_gate(unsigned gate)
if (gate = NI_660X_RTSI_GATE2_SEL(i))
return NI_GPCT_RTSI_GATE_SELECT(i);
}
- if (i <= NI_660X_MAX_RTSI_CHAN)
- break;
for (i = 0; i <= NI_660X_MAX_UP_DOWN_PIN; ++i) {
if (gate = NI_660X_UD_PIN_GATE2_SEL(i))
return NI_GPCT_UP_DOWN_PIN_GATE_SELECT(i);
}
- if (i <= NI_660X_MAX_UP_DOWN_PIN)
- break;
BUG();
break;
}
next reply other threads:[~2014-07-31 9:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-31 9:29 Dan Carpenter [this message]
2014-07-31 9:47 ` [patch] staging: comedi: ni_tio: remove some dead code Ian Abbott
2014-07-31 17:35 ` Hartley Sweeten
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=20140731092918.GD30276@mwanda \
--to=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.