Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 857ced45 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman
Browse files

staging: comedi: s626: remove unnecessary 'cmd' pointer checks



The local variable 'cmd' is a pointer to the address of a member variable
of a struct. It will always be valid. Remove the unnecessary checks.

Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4c36fdde
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -1576,7 +1576,7 @@ static void s626_reset_adc(struct comedi_device *dev, uint8_t *ppl)
	       dev->mmio + S626_P_RPSADDR1);

	/* Construct RPS program in rps_buf DMA buffer */
	if (cmd != NULL && cmd->scan_begin_src != TRIG_FOLLOW) {
	if (cmd->scan_begin_src != TRIG_FOLLOW) {
		/* Wait for Start trigger. */
		*rps++ = S626_RPS_PAUSE | S626_RPS_SIGADC;
		*rps++ = S626_RPS_CLRSIGNAL | S626_RPS_SIGADC;
@@ -1665,7 +1665,7 @@ static void s626_reset_adc(struct comedi_device *dev, uint8_t *ppl)
			*rps++ = jmp_adrs;
		}

		if (cmd != NULL && cmd->convert_src != TRIG_NOW) {
		if (cmd->convert_src != TRIG_NOW) {
			/* Wait for Start trigger. */
			*rps++ = S626_RPS_PAUSE | S626_RPS_SIGADC;
			*rps++ = S626_RPS_CLRSIGNAL | S626_RPS_SIGADC;
@@ -2034,10 +2034,6 @@ static int s626_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
	/* reset ai_cmd_running flag */
	devpriv->ai_cmd_running = 0;

	/* test if cmd is valid */
	if (cmd == NULL)
		return -EINVAL;

	s626_ai_load_polllist(ppl, cmd);
	devpriv->ai_cmd_running = 1;
	devpriv->ai_convert_count = 0;