Commit dc8af068 authored by Roel Kluin's avatar Roel Kluin Committed by Greg Kroah-Hartman
Browse files

Staging: comedi: addi-data: Cleanup redundant tests on unsigned



The variables are unsigned so the test `>= 0' is always true,
In these cases the other part of the test catch wrapped values.

Signed-off-by: default avatarRoel Kluin <roel.kluin@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent c5dba43b
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -1386,8 +1386,7 @@ int i_APCI1710_ReadChronoValue(struct comedi_device *dev,
				/* Test the timout parameter */
		 /*****************************/

				if ((ui_TimeOut >= 0)
					&& (ui_TimeOut <= 65535UL)) {
				if (ui_TimeOut <= 65535UL) {

					for (;;) {
			  /*******************/
+1 −1
Original line number Diff line number Diff line
@@ -150,7 +150,7 @@ int i_APCI1032_Read1DigitalInput(struct comedi_device *dev, struct comedi_subdev
	unsigned int ui_TmpValue = 0;
	unsigned int ui_Channel;
	ui_Channel = CR_CHAN(insn->chanspec);
	if (ui_Channel >= 0 && ui_Channel <= 31) {
	if (ui_Channel <= 31) {
		ui_TmpValue = (unsigned int) inl(devpriv->iobase + APCI1032_DIGITAL_IP);
/*
* since only 1 channel reqd to bring it to last bit it is rotated 8
+1 −1
Original line number Diff line number Diff line
@@ -968,7 +968,7 @@ int i_APCI1500_ReadMoreDigitalInput(struct comedi_device *dev, struct comedi_sub

	switch (data[0]) {
	case 0:
		if (ui_Channel >= 0 && ui_Channel <= 15) {
		if (ui_Channel <= 15) {
			ui_TmpValue =
				(unsigned int) inw(devpriv->i_IobaseAddon +
				APCI1500_DIGITAL_IP);
+1 −1
Original line number Diff line number Diff line
@@ -79,7 +79,7 @@ int i_APCI1516_Read1DigitalInput(struct comedi_device *dev, struct comedi_subdev
	unsigned int ui_TmpValue = 0;
	unsigned int ui_Channel;
	ui_Channel = CR_CHAN(insn->chanspec);
	if (ui_Channel >= 0 && ui_Channel <= 7) {
	if (ui_Channel <= 7) {
		ui_TmpValue = (unsigned int) inw(devpriv->iobase + APCI1516_DIGITAL_IP);
		/*   since only 1 channel reqd  to bring it to last bit it is rotated */
		/*   8 +(chan - 1) times then ANDed with 1 for last bit. */
+1 −1
Original line number Diff line number Diff line
@@ -154,7 +154,7 @@ int i_APCI1564_Read1DigitalInput(struct comedi_device *dev, struct comedi_subdev
	unsigned int ui_Channel;

	ui_Channel = CR_CHAN(insn->chanspec);
	if (ui_Channel >= 0 && ui_Channel <= 31) {
	if (ui_Channel <= 31) {
		ui_TmpValue =
			(unsigned int) inl(devpriv->i_IobaseAmcc + APCI1564_DIGITAL_IP);
/*
Loading