Skip to content

Commit e2fb2f8

Browse files
Zicheng Qujic23
authored andcommitted
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: [email protected] # v6.6+ Fixes: 38416c2 ("iio: light: Add gain-time-scale helpers") Signed-off-by: Zicheng Qu <[email protected]> Reviewed-by: Matti Vaittinen <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
1 parent 62dd96a commit e2fb2f8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/iio/industrialio-gts-helper.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ static int iio_gts_gain_cmp(const void *a, const void *b)
167167

168168
static int gain_to_scaletables(struct iio_gts *gts, int **gains, int **scales)
169169
{
170-
int ret, i, j, new_idx, time_idx;
170+
int i, j, new_idx, time_idx, ret = 0;
171171
int *all_gains;
172172
size_t gain_bytes;
173173

0 commit comments

Comments
 (0)