kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] Bluetooth: ath3k: Silence uninitialized variable warning
@ 2016-04-22 10:02 Dan Carpenter
  2016-04-22 10:42 ` Marcel Holtmann
  2016-04-23  6:59 ` Afzal Mohammed
  0 siblings, 2 replies; 4+ messages in thread
From: Dan Carpenter @ 2016-04-22 10:02 UTC (permalink / raw)
  To: Marcel Holtmann
  Cc: Gustavo Padovan, Johan Hedberg, linux-bluetooth, linux-kernel,
	kernel-janitors

We could print an uninitialized value in the error message.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c
index 47ca4b3..641c2d1 100644
--- a/drivers/bluetooth/ath3k.c
+++ b/drivers/bluetooth/ath3k.c
@@ -206,7 +206,8 @@ static int ath3k_load_firmware(struct usb_device *udev,
 				const struct firmware *firmware)
 {
 	u8 *send_buf;
-	int err, pipe, len, size, sent = 0;
+	int len = 0;
+	int err, pipe, size, sent = 0;
 	int count = firmware->size;
 
 	BT_DBG("udev %p", udev);
@@ -302,7 +303,8 @@ static int ath3k_load_fwfile(struct usb_device *udev,
 		const struct firmware *firmware)
 {
 	u8 *send_buf;
-	int err, pipe, len, size, count, sent = 0;
+	int len = 0;
+	int err, pipe, size, count, sent = 0;
 	int ret;
 
 	count = firmware->size;

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [patch] Bluetooth: ath3k: Silence uninitialized variable warning
  2016-04-22 10:02 [patch] Bluetooth: ath3k: Silence uninitialized variable warning Dan Carpenter
@ 2016-04-22 10:42 ` Marcel Holtmann
  2016-04-23  6:59 ` Afzal Mohammed
  1 sibling, 0 replies; 4+ messages in thread
From: Marcel Holtmann @ 2016-04-22 10:42 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Gustavo F. Padovan, Johan Hedberg, Linux Bluetooth, linux-kernel,
	kernel-janitors

Hi Dan,

> We could print an uninitialized value in the error message.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

patch has been applied to bluetooth-next tree.

Regards

Marcel


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch] Bluetooth: ath3k: Silence uninitialized variable warning
  2016-04-22 10:02 [patch] Bluetooth: ath3k: Silence uninitialized variable warning Dan Carpenter
  2016-04-22 10:42 ` Marcel Holtmann
@ 2016-04-23  6:59 ` Afzal Mohammed
  2016-04-23  7:21   ` Dan Carpenter
  1 sibling, 1 reply; 4+ messages in thread
From: Afzal Mohammed @ 2016-04-23  6:59 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Marcel Holtmann, Gustavo Padovan, Johan Hedberg, linux-bluetooth,
	linux-kernel, kernel-janitors

Hi,

On Fri, Apr 22, 2016 at 01:02:55PM +0300, Dan Carpenter wrote:

> -	int err, pipe, len, size, count, sent = 0;
> +	int len = 0;
> +	int err, pipe, size, count, sent = 0;

Is there any particular reason to avoid more than 1 variable
initialization in definition on a single line ?, like,

	int err, pipe, size, count, sent = 0, len = 0;

have observed that none of your uninitialized variable warning fixes
does as mentioned above.

Regards
afzal

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch] Bluetooth: ath3k: Silence uninitialized variable warning
  2016-04-23  6:59 ` Afzal Mohammed
@ 2016-04-23  7:21   ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2016-04-23  7:21 UTC (permalink / raw)
  To: Afzal Mohammed
  Cc: Marcel Holtmann, Gustavo Padovan, Johan Hedberg, linux-bluetooth,
	linux-kernel, kernel-janitors

On Sat, Apr 23, 2016 at 12:17:45PM +0530, Afzal Mohammed wrote:
> Hi,
> 
> On Fri, Apr 22, 2016 at 01:02:55PM +0300, Dan Carpenter wrote:
> 
> > -	int err, pipe, len, size, count, sent = 0;
> > +	int len = 0;
> > +	int err, pipe, size, count, sent = 0;
> 
> Is there any particular reason to avoid more than 1 variable
> initialization in definition on a single line ?, like,
> 
> 	int err, pipe, size, count, sent = 0, len = 0;
> 
> have observed that none of your uninitialized variable warning fixes
> does as mentioned above.

That sort of initialization is slightly less readable...

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-04-23  7:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-22 10:02 [patch] Bluetooth: ath3k: Silence uninitialized variable warning Dan Carpenter
2016-04-22 10:42 ` Marcel Holtmann
2016-04-23  6:59 ` Afzal Mohammed
2016-04-23  7:21   ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).