Skip to contentSkip to conversation

iio: fix some warning messages

PATCH Applied Dan Carpenter 2 participants 2 messages Nov 21, 2015

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

PATCH 1/1 iio: fix some warning messages

WARN_ON() only takes a condition argument. I have changed these to WARN() instead.

drivers/iio/industrialio-core.c +1 -1
index 37697d5..fe80366 100644
@@ -654,7 +654,7 @@ int __iio_device_attr_init(struct device_attribute *dev_attr,
 			break;
 		case IIO_SEPARATE:
 			if (!chan->indexed) {
-				WARN_ON("Differential channels must be indexed\n");
+				WARN(1, "Differential channels must be indexed\n");
 				ret = -EINVAL;
 				goto error_free_full_postfix;
 			}
drivers/iio/industrialio-buffer.c +1 -1
index d7e908a..0f6f63b 100644
@@ -302,7 +302,7 @@ static int iio_scan_mask_set(struct iio_dev *indio_dev,
 	if (trialmask = NULL)
 		return -ENOMEM;
 	if (!indio_dev->masklength) {
-		WARN_ON("Trying to set scanmask prior to registering buffer\n");
+		WARN(1, "Trying to set scanmask prior to registering buffer\n");
 		goto err_invalid_mask;
 	}
 	bitmap_copy(trialmask, buffer->scan_mask, indio_dev->masklength);
maintainer Applied
#1 lore raw
Quoted 4 lines · Dan Carpenter

WARN_ON() only takes a condition argument. I have changed these to WARN() instead.

Oops and good spot.

Applied to the fixes-togreg branch of iio.git and marked for stable.

Thanks,

Jonathan

Quoted 28 lines
drivers/iio/industrialio-core.c +1 -1
index 37697d5..fe80366 100644
@@ -654,7 +654,7 @@ int __iio_device_attr_init(struct device_attribute *dev_attr,
 			break;
 		case IIO_SEPARATE:
 			if (!chan->indexed) {
-				WARN_ON("Differential channels must be indexed\n");
+				WARN(1, "Differential channels must be indexed\n");
 				ret = -EINVAL;
 				goto error_free_full_postfix;
 			}
drivers/iio/industrialio-buffer.c +1 -1
index d7e908a..0f6f63b 100644
@@ -302,7 +302,7 @@ static int iio_scan_mask_set(struct iio_dev *indio_dev,
 	if (trialmask = NULL)
 		return -ENOMEM;
 	if (!indio_dev->masklength) {
-		WARN_ON("Trying to set scanmask prior to registering buffer\n");
+		WARN(1, "Trying to set scanmask prior to registering buffer\n");
 		goto err_invalid_mask;
 	}
 	bitmap_copy(trialmask, buffer->scan_mask, indio_dev->masklength);