linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH trivial 0/2] Trivial fixes reducing amount of warnings
@ 2012-06-29 11:58 Andrei Emeltchenko
  2012-06-29 11:58 ` [PATCH trivial 1/2] Bluetooth: bluecard_cs: Shorten scope for iobase Andrei Emeltchenko
  2012-06-29 11:58 ` [PATCH trivial 2/2] Bluetooth: Fix warning: using int as NULL pointer Andrei Emeltchenko
  0 siblings, 2 replies; 4+ messages in thread
From: Andrei Emeltchenko @ 2012-06-29 11:58 UTC (permalink / raw)
  To: linux-bluetooth

From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

Those trivial patches reduce amount of warnings.

Andrei Emeltchenko (2):
  Bluetooth: bluecard_cs: Shorten scope for iobase
  Bluetooth: Fix warning: using int as NULL pointer

 drivers/bluetooth/bluecard_cs.c |    6 ++++--
 drivers/bluetooth/bt3c_cs.c     |    2 +-
 drivers/bluetooth/btuart_cs.c   |    2 +-
 3 files changed, 6 insertions(+), 4 deletions(-)

-- 
1.7.9.5


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

* [PATCH trivial 1/2] Bluetooth: bluecard_cs: Shorten scope for iobase
  2012-06-29 11:58 [PATCH trivial 0/2] Trivial fixes reducing amount of warnings Andrei Emeltchenko
@ 2012-06-29 11:58 ` Andrei Emeltchenko
  2012-06-30 15:33   ` Gustavo Padovan
  2012-06-29 11:58 ` [PATCH trivial 2/2] Bluetooth: Fix warning: using int as NULL pointer Andrei Emeltchenko
  1 sibling, 1 reply; 4+ messages in thread
From: Andrei Emeltchenko @ 2012-06-29 11:58 UTC (permalink / raw)
  To: linux-bluetooth

From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

Shortening scope shall silence some warnings reported by Geert
Uytterhoeven:

...
drivers/bluetooth/bluecard_cs.c: warning: unused variable 'iobase'
	[-Wunused-variable]
...

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
---
 drivers/bluetooth/bluecard_cs.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/bluetooth/bluecard_cs.c b/drivers/bluetooth/bluecard_cs.c
index 585c88e..66c3a67 100644
--- a/drivers/bluetooth/bluecard_cs.c
+++ b/drivers/bluetooth/bluecard_cs.c
@@ -621,7 +621,6 @@ static int bluecard_hci_flush(struct hci_dev *hdev)
 static int bluecard_hci_open(struct hci_dev *hdev)
 {
 	bluecard_info_t *info = hci_get_drvdata(hdev);
-	unsigned int iobase = info->p_dev->resource[0]->start;
 
 	if (test_bit(CARD_HAS_PCCARD_ID, &(info->hw_state)))
 		bluecard_hci_set_baud_rate(hdev, DEFAULT_BAUD_RATE);
@@ -630,6 +629,8 @@ static int bluecard_hci_open(struct hci_dev *hdev)
 		return 0;
 
 	if (test_bit(CARD_HAS_PCCARD_ID, &(info->hw_state))) {
+		unsigned int iobase = info->p_dev->resource[0]->start;
+
 		/* Enable LED */
 		outb(0x08 | 0x20, iobase + 0x30);
 	}
@@ -641,7 +642,6 @@ static int bluecard_hci_open(struct hci_dev *hdev)
 static int bluecard_hci_close(struct hci_dev *hdev)
 {
 	bluecard_info_t *info = hci_get_drvdata(hdev);
-	unsigned int iobase = info->p_dev->resource[0]->start;
 
 	if (!test_and_clear_bit(HCI_RUNNING, &(hdev->flags)))
 		return 0;
@@ -649,6 +649,8 @@ static int bluecard_hci_close(struct hci_dev *hdev)
 	bluecard_hci_flush(hdev);
 
 	if (test_bit(CARD_HAS_PCCARD_ID, &(info->hw_state))) {
+		unsigned int iobase = info->p_dev->resource[0]->start;
+
 		/* Disable LED */
 		outb(0x00, iobase + 0x30);
 	}
-- 
1.7.9.5


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

* [PATCH trivial 2/2] Bluetooth: Fix warning: using int as NULL pointer
  2012-06-29 11:58 [PATCH trivial 0/2] Trivial fixes reducing amount of warnings Andrei Emeltchenko
  2012-06-29 11:58 ` [PATCH trivial 1/2] Bluetooth: bluecard_cs: Shorten scope for iobase Andrei Emeltchenko
@ 2012-06-29 11:58 ` Andrei Emeltchenko
  1 sibling, 0 replies; 4+ messages in thread
From: Andrei Emeltchenko @ 2012-06-29 11:58 UTC (permalink / raw)
  To: linux-bluetooth

From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

Fix for warnings below:

...
drivers/bluetooth/bt3c_cs.c:667:20: warning: Using plain integer
	as NULL pointer
drivers/bluetooth/btuart_cs.c:596:20: warning: Using plain integer
	as NULL pointer
...

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
---
 drivers/bluetooth/bt3c_cs.c   |    2 +-
 drivers/bluetooth/btuart_cs.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/bluetooth/bt3c_cs.c b/drivers/bluetooth/bt3c_cs.c
index b2b0fbb..8925b6d 100644
--- a/drivers/bluetooth/bt3c_cs.c
+++ b/drivers/bluetooth/bt3c_cs.c
@@ -664,7 +664,7 @@ static int bt3c_check_config(struct pcmcia_device *p_dev, void *priv_data)
 {
 	int *try = priv_data;
 
-	if (try == 0)
+	if (!try)
 		p_dev->io_lines = 16;
 
 	if ((p_dev->resource[0]->end != 8) || (p_dev->resource[0]->start == 0))
diff --git a/drivers/bluetooth/btuart_cs.c b/drivers/bluetooth/btuart_cs.c
index 65b8d99..21e803a 100644
--- a/drivers/bluetooth/btuart_cs.c
+++ b/drivers/bluetooth/btuart_cs.c
@@ -593,7 +593,7 @@ static int btuart_check_config(struct pcmcia_device *p_dev, void *priv_data)
 {
 	int *try = priv_data;
 
-	if (try == 0)
+	if (!try)
 		p_dev->io_lines = 16;
 
 	if ((p_dev->resource[0]->end != 8) || (p_dev->resource[0]->start == 0))
-- 
1.7.9.5


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

* Re: [PATCH trivial 1/2] Bluetooth: bluecard_cs: Shorten scope for iobase
  2012-06-29 11:58 ` [PATCH trivial 1/2] Bluetooth: bluecard_cs: Shorten scope for iobase Andrei Emeltchenko
@ 2012-06-30 15:33   ` Gustavo Padovan
  0 siblings, 0 replies; 4+ messages in thread
From: Gustavo Padovan @ 2012-06-30 15:33 UTC (permalink / raw)
  To: Andrei Emeltchenko; +Cc: linux-bluetooth

Hi Andrei,

* Andrei Emeltchenko <Andrei.Emeltchenko.news@gmail.com> [2012-06-29 14:58:07 +0300]:

> From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
> 
> Shortening scope shall silence some warnings reported by Geert
> Uytterhoeven:
> 
> ...
> drivers/bluetooth/bluecard_cs.c: warning: unused variable 'iobase'
> 	[-Wunused-variable]
> ...
> 
> Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
> ---
>  drivers/bluetooth/bluecard_cs.c |    6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)

Patch has been applied, thanks.

	Gustavo

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

end of thread, other threads:[~2012-06-30 15:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-29 11:58 [PATCH trivial 0/2] Trivial fixes reducing amount of warnings Andrei Emeltchenko
2012-06-29 11:58 ` [PATCH trivial 1/2] Bluetooth: bluecard_cs: Shorten scope for iobase Andrei Emeltchenko
2012-06-30 15:33   ` Gustavo Padovan
2012-06-29 11:58 ` [PATCH trivial 2/2] Bluetooth: Fix warning: using int as NULL pointer Andrei Emeltchenko

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).