mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Milkovich <amilkovich@gmail.com>
To: mchehab@osg.samsung.com
Cc: gregkh@linuxfoundation.org, linux-media@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Andrew Milkovich <amilkovich@gmail.com>
Subject: [PATCH] Staging: media: bcm2048: warnings for uninitialized variables fixed
Date: Fri, 14 Aug 2015 09:43:56 -0700	[thread overview]
Message-ID: <1439570636-32539-1-git-send-email-amilkovich@gmail.com> (raw)

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 <amilkovich@gmail.com>
---
 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 8bc68e2..2f81579 100644
--- a/drivers/staging/media/bcm2048/radio-bcm2048.c
+++ b/drivers/staging/media/bcm2048/radio-bcm2048.c
@@ -621,7 +621,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);
 
@@ -666,7 +666,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);
 
@@ -1048,7 +1048,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);
 
@@ -1084,7 +1084,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);
 
@@ -1119,7 +1119,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);
 
@@ -1154,7 +1154,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);
 
@@ -1189,7 +1189,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);
 
@@ -1207,7 +1207,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);
 
@@ -1235,7 +1235,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);
 
@@ -1909,7 +1909,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.5.0


                 reply	other threads:[~2015-08-14 16:44 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1439570636-32539-1-git-send-email-amilkovich@gmail.com \
    --to=amilkovich@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@osg.samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®