Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1516267 > unrolled thread

[PATCH] media: fix uninitialized variable warning in dib0700_rc_urb_completion()

Started byShuah Khan <shuahkh@osg.samsung.com>
First post2016-11-07 16:50 +0100
Last post2016-11-08 12:30 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH] media: fix uninitialized variable warning in dib0700_rc_urb_completion() Shuah Khan <shuahkh@osg.samsung.com> - 2016-11-07 16:50 +0100
    Re: [PATCH] media: fix uninitialized variable warning in  dib0700_rc_urb_completion() Sean Young <sean@mess.org> - 2016-11-08 12:30 +0100

#1516267 — [PATCH] media: fix uninitialized variable warning in dib0700_rc_urb_completion()

FromShuah Khan <shuahkh@osg.samsung.com>
Date2016-11-07 16:50 +0100
Subject[PATCH] media: fix uninitialized variable warning in dib0700_rc_urb_completion()
Message-ID<sAUlk-4ZD-33@gated-at.bofh.it>
Fix the following uninitialized variable compiler warning:

drivers/media/usb/dvb-usb/dib0700_core.c: In function ‘dib0700_rc_urb_completion’:
 drivers/media/usb/dvb-usb/dib0700_core.c:763:2: warning: ‘protocol’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   rc_keydown(d->rc_dev, protocol, keycode, toggle);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
---
 drivers/media/usb/dvb-usb/dib0700_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/usb/dvb-usb/dib0700_core.c b/drivers/media/usb/dvb-usb/dib0700_core.c
index f319665..cfe28ec 100644
--- a/drivers/media/usb/dvb-usb/dib0700_core.c
+++ b/drivers/media/usb/dvb-usb/dib0700_core.c
@@ -676,7 +676,7 @@ static void dib0700_rc_urb_completion(struct urb *purb)
 {
 	struct dvb_usb_device *d = purb->context;
 	struct dib0700_rc_response *poll_reply;
-	enum rc_type protocol;
+	enum rc_type protocol = RC_TYPE_UNKNOWN;
 	u32 uninitialized_var(keycode);
 	u8 toggle;
 
-- 
2.9.3

[toc] | [next] | [standalone]


#1517092 — Re: [PATCH] media: fix uninitialized variable warning in dib0700_rc_urb_completion()

FromSean Young <sean@mess.org>
Date2016-11-08 12:30 +0100
SubjectRe: [PATCH] media: fix uninitialized variable warning in dib0700_rc_urb_completion()
Message-ID<sBcLf-eL-7@gated-at.bofh.it>
In reply to#1516267
On Mon, Nov 07, 2016 at 08:41:12AM -0700, Shuah Khan wrote:
> Fix the following uninitialized variable compiler warning:
> 
> drivers/media/usb/dvb-usb/dib0700_core.c: In function ‘dib0700_rc_urb_completion’:
>  drivers/media/usb/dvb-usb/dib0700_core.c:763:2: warning: ‘protocol’ may be used uninitialized in this function [-Wmaybe-uninitialized]
>    rc_keydown(d->rc_dev, protocol, keycode, toggle);
>    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
> ---
>  drivers/media/usb/dvb-usb/dib0700_core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/usb/dvb-usb/dib0700_core.c b/drivers/media/usb/dvb-usb/dib0700_core.c
> index f319665..cfe28ec 100644
> --- a/drivers/media/usb/dvb-usb/dib0700_core.c
> +++ b/drivers/media/usb/dvb-usb/dib0700_core.c
> @@ -676,7 +676,7 @@ static void dib0700_rc_urb_completion(struct urb *purb)
>  {
>  	struct dvb_usb_device *d = purb->context;
>  	struct dib0700_rc_response *poll_reply;
> -	enum rc_type protocol;
> +	enum rc_type protocol = RC_TYPE_UNKNOWN;
>  	u32 uninitialized_var(keycode);
>  	u8 toggle;
>  

There is another (better) fix for it here:

https://patchwork.linuxtv.org/patch/37516/


Thanks
Sean

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web