[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20220309085215.7881-1-hatimmohammed369@gmail.com>
Date: Wed, 9 Mar 2022 10:52:15 +0200
From: hatimmohammed369@...il.com
To: linux-kernel@...r.kernel.org
Cc: greg@...ah.com, abbotti@....co.uk, hsweeten@...ionengravers.com,
Hatim Muhammed <hatimmohammed369@...il.com>
Subject: [PATCH 6/6] [Staging]: Removed an unnecessary #if
From: Hatim Muhammed <hatimmohammed369@...il.com>
This removed #if had 1 as its condition, hence it's body will always
execute and its #else block will never
Signed-off-by: Hatim Muhammed <hatimmohammed369@...il.com>
---
drivers/comedi/drivers/s526.c | 49 -----------------------------------
1 file changed, 49 deletions(-)
diff --git a/drivers/comedi/drivers/s526.c b/drivers/comedi/drivers/s526.c
index 9245c679a3c4..df9d240518ef 100644
--- a/drivers/comedi/drivers/s526.c
+++ b/drivers/comedi/drivers/s526.c
@@ -229,7 +229,6 @@ static int s526_gpct_insn_config(struct comedi_device *dev,
*/
devpriv->gpct_config[chan] = data[0];
-#if 1
/* Set Counter Mode Register */
val = data[1] & 0xffff;
outw(val, dev->iobase + S526_GPCT_MODE_REG(chan));
@@ -246,54 +245,6 @@ static int s526_gpct_insn_config(struct comedi_device *dev,
* dev->iobase + S526_GPCT_CTRL_REG(chan));
*/
}
-#else
- val = S526_GPCT_MODE_CTDIR_CTRL_QUAD;
-
- /* data[1] contains GPCT_X1, GPCT_X2 or GPCT_X4 */
- if (data[1] == GPCT_X2)
- val |= S526_GPCT_MODE_CLK_SRC_QUADX2;
- else if (data[1] == GPCT_X4)
- val |= S526_GPCT_MODE_CLK_SRC_QUADX4;
- else
- val |= S526_GPCT_MODE_CLK_SRC_QUADX1;
-
- /* When to take into account the indexpulse: */
- /*
- * if (data[2] == GPCT_IndexPhaseLowLow) {
- * } else if (data[2] == GPCT_IndexPhaseLowHigh) {
- * } else if (data[2] == GPCT_IndexPhaseHighLow) {
- * } else if (data[2] == GPCT_IndexPhaseHighHigh) {
- * }
- */
- /* Take into account the index pulse? */
- if (data[3] == GPCT_RESET_COUNTER_ON_INDEX) {
- /* Auto load with INDEX^ */
- val |= S526_GPCT_MODE_AUTOLOAD_IXRISE;
- }
-
- /* Set Counter Mode Register */
- val = data[1] & 0xffff;
- outw(val, dev->iobase + S526_GPCT_MODE_REG(chan));
-
- /* Load the pre-load register */
- s526_gpct_write(dev, chan, data[2]);
-
- /* Write the Counter Control Register */
- if (data[3])
- outw(data[3] & 0xffff,
- dev->iobase + S526_GPCT_CTRL_REG(chan));
-
- /* Reset the counter if it is software preload */
- if ((val & S526_GPCT_MODE_AUTOLOAD_MASK) ==
- S526_GPCT_MODE_AUTOLOAD_NONE) {
- /* Reset the counter */
- outw(S526_GPCT_CTRL_CT_RESET,
- dev->iobase + S526_GPCT_CTRL_REG(chan));
- /* Load the counter from PR0 */
- outw(S526_GPCT_CTRL_CT_LOAD,
- dev->iobase + S526_GPCT_CTRL_REG(chan));
- }
-#endif
break;
case INSN_CONFIG_GPCT_SINGLE_PULSE_GENERATOR:
--
2.35.1
Powered by blists - more mailing lists