Skip to contentSkip to conversation

staging: comedi: me4000: use bitwise AND instead of logical

PATCH In review Dan Carpenter 3 participants 3 messages Aug 14, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: comedi: me4000: use bitwise AND instead of logical

This was supposed to bitwise AND but there is a typo.

Fixes 1a02387063fb ('staging: comedi: me4000: remove 'board' from me4000_ai_insn_read()')
drivers/staging/comedi/drivers/me4000.c +2 -2
index 5aa1780..15a5320 100644
@@ -480,7 +480,7 @@ static int me4000_ai_insn_read(struct comedi_device *dev,
 
 	entry = chan | ME4000_AI_LIST_RANGE(range);
 	if (aref = AREF_DIFF) {
-		if (!(s->subdev_flags && SDF_DIFF)) {
+		if (!(s->subdev_flags & SDF_DIFF)) {
 			dev_err(dev->class_dev,
 				"Differential inputs are not available\n");
 			return -EINVAL;
@@ -559,7 +559,7 @@ static int me4000_ai_check_chanlist(struct comedi_device *dev,
 		}
 
 		if (aref = AREF_DIFF) {
-			if (!(s->subdev_flags && SDF_DIFF)) {
+			if (!(s->subdev_flags & SDF_DIFF)) {
 				dev_err(dev->class_dev,
 					"Differential inputs are not available\n");
 				return -EINVAL;
Reviewed-by on v1 1/1
#1 lore raw
Quoted 20 lines · Dan Carpenter

This was supposed to bitwise AND but there is a typo.

Fixes 1a02387063fb ('staging: comedi: me4000: remove 'board' from me4000_ai_insn_read()')
drivers/staging/comedi/drivers/me4000.c +1 -1
index 5aa1780..15a5320 100644
@@ -480,7 +480,7 @@ static int me4000_ai_insn_read(struct comedi_device *dev,
 
  	entry = chan | ME4000_AI_LIST_RANGE(range);
  	if (aref = AREF_DIFF) {
-		if (!(s->subdev_flags && SDF_DIFF)) {
+		if (!(s->subdev_flags & SDF_DIFF)) {
  			dev_err(dev->class_dev,
  				"Differential inputs are not available\n");
  			return -EINVAL;

drivers/staging/comedi/drivers/me4000.c static int me4000_ai_check_chanlist(struct comedi_device *dev, · line 565

Quoted 8 lines
drivers/staging/comedi/drivers/me4000.c +1 -1
@@ -559,7 +559,7 @@ static int me4000_ai_check_chanlist(struct comedi_device *dev,
  		}
 
  		if (aref = AREF_DIFF) {
-			if (!(s->subdev_flags && SDF_DIFF)) {
+			if (!(s->subdev_flags & SDF_DIFF)) {
  				dev_err(dev->class_dev,
  					"Differential inputs are not available\n");
  				return -EINVAL;

Thanks for catching that.

Signature · 2 lines
-=( Ian Abbott @ MEV Ltd.    E-mail: <[email protected]> )=-
-=(                          Web: http://www.mev.co.uk/  )=-
Reviewed-by H Hartley Sweeten on v1 1/1
#2 lore raw
In reply to Dan Carpenter
Quoted 32 lines · Ian Abbott
Quoted 20 lines · Dan Carpenter

This was supposed to bitwise AND but there is a typo.

Fixes 1a02387063fb ('staging: comedi: me4000: remove 'board' from me4000_ai_insn_read()')
drivers/staging/comedi/drivers/me4000.c +1 -1
index 5aa1780..15a5320 100644
@@ -480,7 +480,7 @@ static int me4000_ai_insn_read(struct comedi_device *dev,
 
  	entry = chan | ME4000_AI_LIST_RANGE(range);
  	if (aref = AREF_DIFF) {
-		if (!(s->subdev_flags && SDF_DIFF)) {
+		if (!(s->subdev_flags & SDF_DIFF)) {
  			dev_err(dev->class_dev,
  				"Differential inputs are not available\n");
  			return -EINVAL;

drivers/staging/comedi/drivers/me4000.c static int me4000_ai_check_chanlist(struct comedi_device *dev, · line 565

Quoted 8 lines
drivers/staging/comedi/drivers/me4000.c +1 -1
@@ -559,7 +559,7 @@ static int me4000_ai_check_chanlist(struct comedi_device *dev,
  		}
 
  		if (aref = AREF_DIFF) {
-			if (!(s->subdev_flags && SDF_DIFF)) {
+			if (!(s->subdev_flags & SDF_DIFF)) {
  				dev_err(dev->class_dev,
  					"Differential inputs are not available\n");
  				return -EINVAL;

Thanks for catching that.

Quoted 1 line

Gah... Sorry about that. Thanks for the catch Dan.