mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hatim Muhammed <hatimmohammed369@gmail.com>
To: linux-kernel@vger.kernel.org, greg@kroah.com
Cc: abbotti@mev.co.uk, hsweeten@visionengravers.com,
	Hatim Muhammed <hatimmohammed369@gmail.com>
Subject: [PATCH 6/7] [Staging]: Removed an unnecessary #if
Date: Wed,  9 Mar 2022 11:06:24 +0200	[thread overview]
Message-ID: <20220309090624.12696-1-hatimmohammed369@gmail.com> (raw)

From: Hatim Muhammed <hatimmohammed369@gmail.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@gmail.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


                 reply	other threads:[~2022-03-09  9:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20220309090624.12696-1-hatimmohammed369@gmail.com \
    --to=hatimmohammed369@gmail.com \
    --cc=abbotti@mev.co.uk \
    --cc=greg@kroah.com \
    --cc=hsweeten@visionengravers.com \
    --cc=linux-kernel@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 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®