From a1f8c0cff03c1215e00586ff760fdeb4464091fc Mon Sep 17 00:00:00 2001 From: Andrew Milkovich Date: Fri, 14 Aug 2015 13:43:56 -0300 Subject: [PATCH] [media] Staging: media: bcm2048: warnings for uninitialized variables fixed This patch fixes the following sparse warnings: warning: ... may be used uninitialized in this function Some function variables have been initialized to 0. Signed-off-by: Andrew Milkovich Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- drivers/staging/media/bcm2048/radio-bcm2048.c | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/staging/media/bcm2048/radio-bcm2048.c b/drivers/staging/media/bcm2048/radio-bcm2048.c index fb55e5941445..b10d6016b993 100644 --- a/drivers/staging/media/bcm2048/radio-bcm2048.c +++ b/drivers/staging/media/bcm2048/radio-bcm2048.c @@ -613,7 +613,7 @@ static int bcm2048_set_fm_frequency(struct bcm2048_device *bdev, u32 frequency) static int bcm2048_get_fm_frequency(struct bcm2048_device *bdev) { int err; - u8 lsb, msb; + u8 lsb = 0, msb = 0; mutex_lock(&bdev->mutex); @@ -658,7 +658,7 @@ static int bcm2048_set_fm_af_frequency(struct bcm2048_device *bdev, static int bcm2048_get_fm_af_frequency(struct bcm2048_device *bdev) { int err; - u8 lsb, msb; + u8 lsb = 0, msb = 0; mutex_lock(&bdev->mutex); @@ -1052,7 +1052,7 @@ static int bcm2048_set_rds_b_block_mask(struct bcm2048_device *bdev, u16 mask) static int bcm2048_get_rds_b_block_mask(struct bcm2048_device *bdev) { int err; - u8 lsb, msb; + u8 lsb = 0, msb = 0; mutex_lock(&bdev->mutex); @@ -1088,7 +1088,7 @@ static int bcm2048_set_rds_b_block_match(struct bcm2048_device *bdev, static int bcm2048_get_rds_b_block_match(struct bcm2048_device *bdev) { int err; - u8 lsb, msb; + u8 lsb = 0, msb = 0; mutex_lock(&bdev->mutex); @@ -1123,7 +1123,7 @@ static int bcm2048_set_rds_pi_mask(struct bcm2048_device *bdev, u16 mask) static int bcm2048_get_rds_pi_mask(struct bcm2048_device *bdev) { int err; - u8 lsb, msb; + u8 lsb = 0, msb = 0; mutex_lock(&bdev->mutex); @@ -1158,7 +1158,7 @@ static int bcm2048_set_rds_pi_match(struct bcm2048_device *bdev, u16 match) static int bcm2048_get_rds_pi_match(struct bcm2048_device *bdev) { int err; - u8 lsb, msb; + u8 lsb = 0, msb = 0; mutex_lock(&bdev->mutex); @@ -1193,7 +1193,7 @@ static int bcm2048_set_fm_rds_mask(struct bcm2048_device *bdev, u16 mask) static int bcm2048_get_fm_rds_mask(struct bcm2048_device *bdev) { int err; - u8 value0, value1; + u8 value0 = 0, value1 = 0; mutex_lock(&bdev->mutex); @@ -1211,7 +1211,7 @@ static int bcm2048_get_fm_rds_mask(struct bcm2048_device *bdev) static int bcm2048_get_fm_rds_flags(struct bcm2048_device *bdev) { int err; - u8 value0, value1; + u8 value0 = 0, value1 = 0; mutex_lock(&bdev->mutex); @@ -1239,7 +1239,7 @@ static int bcm2048_get_region_top_frequency(struct bcm2048_device *bdev) static int bcm2048_set_fm_best_tune_mode(struct bcm2048_device *bdev, u8 mode) { int err; - u8 value; + u8 value = 0; mutex_lock(&bdev->mutex); @@ -1913,7 +1913,7 @@ unlock: static void bcm2048_work(struct work_struct *work) { struct bcm2048_device *bdev; - u8 flag_lsb, flag_msb, flags; + u8 flag_lsb = 0, flag_msb = 0, flags; bdev = container_of(work, struct bcm2048_device, work); bcm2048_recv_command(bdev, BCM2048_I2C_FM_RDS_FLAG0, &flag_lsb); -- 2.39.5