[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20160418022620.772423963@linuxfoundation.org>
Date: Mon, 18 Apr 2016 11:29:30 +0900
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Irina Tirdea <irina.tirdea@...el.com>,
Jonathan Cameron <jic23@...nel.org>
Subject: [PATCH 4.5 098/124] iio: fix config watermark initial value
4.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Irina Tirdea <irina.tirdea@...el.com>
commit 1bef2c1d4e4fd92bdf8219b13ba97ba861618254 upstream.
config structure is set to 0 when updating the buffers, so by
default config->watermark will be 0. When computing the minimum
between config->watermark and the buffer->watermark or
insert_buffer-watermark, this will always be 0 regardless of the
value set by the user for the buffer.
Set as initial value for config->watermark the maximum allowed
value so that the minimum value will always be set from one of the
buffers.
Signed-off-by: Irina Tirdea <irina.tirdea@...el.com>
Fixes: f0566c0c405d ("iio: Set device watermark based on watermark of all
attached buffers")
Signed-off-by: Jonathan Cameron <jic23@...nel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
drivers/iio/industrialio-buffer.c | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/iio/industrialio-buffer.c
+++ b/drivers/iio/industrialio-buffer.c
@@ -645,6 +645,7 @@ static int iio_verify_update(struct iio_
unsigned int modes;
memset(config, 0, sizeof(*config));
+ config->watermark = ~0;
/*
* If there is just one buffer and we are removing it there is nothing
Powered by blists - more mailing lists