Skip to contentSkip to conversation

Silent compiler warning introduced by acea6852f32b8805e166d885ed7e9f0c7cd10d41 ([BLUETOOTH]: Move children of connection device to NULL before connection down.)

PATCH In review S.Çağlar Onur 4 participants 6 messages Feb 10, 2008 – Feb 11, 2008 Bluetooth

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Silent compiler warning introduced by acea6852f32b8805e166d885ed7e9f0c7cd10d41 ([BLUETOOTH]: Move children of connection device to NULL before connection down.)

Hi;

Following patch silents

net/bluetooth/hci_sysfs.c: In function `del_conn':
net/bluetooth/hci_sysfs.c:339: warning: suggest parentheses around assignment used as truth value

compiler warning introduced by commit acea6852f32b8805e166d885ed7e9f0c7cd10d41 ([BLUETOOTH]: Move children of connection device to NULL before connection down.)

 net/bluetooth/hci_sysfs.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/bluetooth/hci_sysfs.c +1 -1
index e13cf5e..d2d1e4f 100644
@@ -336,7 +336,7 @@ static void del_conn(struct work_struct *work)
 	struct device *dev;
 	struct hci_conn *conn = container_of(work, struct hci_conn, work);
 
-	while (dev = device_find_child(&conn->dev, NULL, __match_tty)) {
+	while ((dev = device_find_child(&conn->dev, NULL, __match_tty)) != NULL) {
 		device_move(dev, NULL);
 		put_device(dev);
 	}

Cheers

Signature · 4 lines
S.Çağlar Onur <[email protected]>
http://cekirdek.pardus.org.tr/~caglar/

Linux is like living in a teepee. No Windows, no Gates and an Apache in house!
#1 lore raw
Quoted 19 lines · S.Çağlar Onur

Hi;

Following patch silents

net/bluetooth/hci_sysfs.c: In function `del_conn':
net/bluetooth/hci_sysfs.c:339: warning: suggest parentheses around assignment used as truth value

compiler warning introduced by commit acea6852f32b8805e166d885ed7e9f0c7cd10d41 ([BLUETOOTH]: Move children of connection device to NULL before connection down.)

 net/bluetooth/hci_sysfs.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/bluetooth/hci_sysfs.c +0 -0
index e13cf5e..d2d1e4f 100644

net/bluetooth/hci_sysfs.c static void del_conn(struct work_struct *work) · line 340

Quoted 6 lines
net/bluetooth/hci_sysfs.c +1 -1
@@ -336,7 +336,7 @@ static void del_conn(struct work_struct *work)
 	struct device *dev;
 	struct hci_conn *conn = container_of(work, struct hci_conn, work);
 
-	while (dev = device_find_child(&conn->dev, NULL, __match_tty)) {
+	while ((dev = device_find_child(&conn->dev, NULL, __match_tty)) != NULL) {
 

Why do you need '!= NULL'?

#2 lore raw

Hi;

10 Şub 2008 Paz tarihinde, Richard Knutsson şunları yazmıştı:

Quoted 23 lines
Quoted 22 lines · S.Çağlar Onur

Hi;

Following patch silents

net/bluetooth/hci_sysfs.c: In function `del_conn':
net/bluetooth/hci_sysfs.c:339: warning: suggest parentheses around assignment used as truth value

compiler warning introduced by commit acea6852f32b8805e166d885ed7e9f0c7cd10d41 ([BLUETOOTH]: Move children of connection device to NULL before connection down.)

 net/bluetooth/hci_sysfs.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/bluetooth/hci_sysfs.c +0 -0
index e13cf5e..d2d1e4f 100644
@@ -336,7 +336,7 @@ static void del_conn(struct work_struct *work)
 	struct device *dev;
 	struct hci_conn *conn = container_of(work, struct hci_conn, work);
 
Quoted 4 lines

net/bluetooth/hci_sysfs.c static void del_conn(struct work_struct *work)

Quoted 3 lines
net/bluetooth/hci_sysfs.c +1 -1
-	while (dev = device_find_child(&conn->dev, NULL, __match_tty)) {
+	while ((dev = device_find_child(&conn->dev, NULL, __match_tty)) != NULL) {
 

Why do you need '!= NULL'?

I thought its more readable than

while ((dev = device_find_child(&conn->dev, NULL, __match_tty))) {

Cheers

Signature · 4 lines
S.Çağlar Onur <[email protected]>
http://cekirdek.pardus.org.tr/~caglar/

Linux is like living in a teepee. No Windows, no Gates and an Apache in house!
#3 lore raw
Quoted 9 lines · S.Çağlar Onur
Quoted 5 lines

net/bluetooth/hci_sysfs.c static void del_conn(struct work_struct *work) · line 339

Quoted 4 lines
net/bluetooth/hci_sysfs.c +1 -1
-	while (dev = device_find_child(&conn->dev, NULL, __match_tty)) {
+	while ((dev = device_find_child(&conn->dev, NULL, __match_tty)) != NULL) {

Why do you need '!= NULL'?

I thought its more readable than

while ((dev = device_find_child(&conn->dev, NULL, __match_tty))) {

Yes indeed. I hate the idiotic "double parenthesis without any meaning". I'd much rather see "((..) != NULL)" than "((..))", because the latter is totally meaningless semantically (although gcc gives it semantics).

Linus

#4 lore raw

Hi;

10 Şub 2008 Paz tarihinde, Linus Torvalds şunları yazmıştı:

Quoted 8 lines · S.Çağlar Onur
Quoted 6 lines
Quoted 5 lines

net/bluetooth/hci_sysfs.c static void del_conn(struct work_struct *work) · line 339

Quoted 4 lines
net/bluetooth/hci_sysfs.c +1 -1
-	while (dev = device_find_child(&conn->dev, NULL, __match_tty)) {
+	while ((dev = device_find_child(&conn->dev, NULL, __match_tty)) != NULL) {

Why do you need '!= NULL'?

Quoted 7 lines
Quoted 3 lines

I thought its more readable than

while ((dev = device_find_child(&conn->dev, NULL, __match_tty))) {

Yes indeed. I hate the idiotic "double parenthesis without any meaning". I'd much rather see "((..) != NULL)" than "((..))", because the latter is totally meaningless semantically (although gcc gives it semantics).

But you still not merged this one :), is there any problem exists or would you prefer this comes from with a subsystem tree (which means i'm doing wrong thing with sending these trivial patches to you)?

Cheers

Signature · 4 lines
S.Çağlar Onur <[email protected]>
http://cekirdek.pardus.org.tr/~caglar/

Linux is like living in a teepee. No Windows, no Gates and an Apache in house!
#5 lore raw
Quoted 2 lines · S.Çağlar Onur

But you still not merged this one :), is there any problem exists or would you prefer this comes from with a subsystem tree

I don't know exactly what Linus prefers, but I think the guidelines in Documentation/SubmittingPatches, sections "Select e-mail destination" and "Select your CC (e-mail carbon copy) list" adequately answer your question.

Signature · 3 lines
Stefan Richter
-=====-==--- --=- -=-==
http://arcgraph.de/sr/