iio: gts: Fix uninitialized symbol 'ret'
commite2fb2f89faupstream. Initialize the variable ret at the time of declaration to prevent it from being returned without a defined value. Fixes smatch warning: drivers/iio/industrialio-gts-helper.c:256 gain_to_scaletables() error: uninitialized symbol 'ret'. Cc: stable@vger.kernel.org # v6.6+ Fixes:38416c28e1("iio: light: Add gain-time-scale helpers") Signed-off-by: Zicheng Qu <quzicheng@huawei.com> Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com> Link: https://patch.msgid.link/20241031014505.2313035-1-quzicheng@huawei.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
09faf32c68
commit
1681131bfa
@@ -167,7 +167,7 @@ static int iio_gts_gain_cmp(const void *a, const void *b)
|
||||
|
||||
static int gain_to_scaletables(struct iio_gts *gts, int **gains, int **scales)
|
||||
{
|
||||
int ret, i, j, new_idx, time_idx;
|
||||
int i, j, new_idx, time_idx, ret = 0;
|
||||
int *all_gains;
|
||||
size_t gain_bytes;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user