aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorZicheng Qu <quzicheng@huawei.com>2024-10-31 01:45:05 +0000
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2024-10-31 21:47:23 +0000
commite2fb2f89faf87b681038475d093214f4cbe12ebb (patch)
tree0929abc9fc3c885584080afa3e0cf365eb668df6
parentiio: adc: ad4000: fix reading unsigned data (diff)
downloadwireguard-linux-e2fb2f89faf87b681038475d093214f4cbe12ebb.tar.xz
wireguard-linux-e2fb2f89faf87b681038475d093214f4cbe12ebb.zip
iio: gts: Fix uninitialized symbol 'ret'
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: 38416c28e168 ("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>
-rw-r--r--drivers/iio/industrialio-gts-helper.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/industrialio-gts-helper.c b/drivers/iio/industrialio-gts-helper.c
index 5f131bc1a01e..4ad949672210 100644
--- a/drivers/iio/industrialio-gts-helper.c
+++ b/drivers/iio/industrialio-gts-helper.c
@@ -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;