Skip to content

Commit

Permalink
iio: sx9500: Add missing init in sx9500_buffer_pre{en,dis}able()
Browse files Browse the repository at this point in the history
drivers/iio/proximity/sx9500.c: In function ‘sx9500_buffer_preenable’:
drivers/iio/proximity/sx9500.c:682: warning: ‘ret’ may be used uninitialized in this function
drivers/iio/proximity/sx9500.c: In function ‘sx9500_buffer_predisable’:
drivers/iio/proximity/sx9500.c:706: warning: ‘ret’ may be used uninitialized in this function

If active_scan_mask is empty, it will loop once more over all channels,
doing nothing.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: Vlad Dogaru <vlad.dogaru@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
  • Loading branch information
Geert Uytterhoeven authored and Jonathan Cameron committed Jul 19, 2015
1 parent c42b9e1 commit 06b00f9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/iio/proximity/sx9500.c
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ static irqreturn_t sx9500_trigger_handler(int irq, void *private)
static int sx9500_buffer_preenable(struct iio_dev *indio_dev)
{
struct sx9500_data *data = iio_priv(indio_dev);
int ret, i;
int ret = 0, i;

mutex_lock(&data->mutex);

Expand All @@ -706,7 +706,7 @@ static int sx9500_buffer_preenable(struct iio_dev *indio_dev)
static int sx9500_buffer_predisable(struct iio_dev *indio_dev)
{
struct sx9500_data *data = iio_priv(indio_dev);
int ret, i;
int ret = 0, i;

iio_triggered_buffer_predisable(indio_dev);

Expand Down

0 comments on commit 06b00f9

Please sign in to comment.