Skip to contentSkip to conversation

Staging: most: aim-sound: sound.c: coding style

PATCH In review Philippe Loctaux 3 participants 8 messages Dec 28, 2017 – Jan 8, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Staging: most: aim-sound: sound.c: coding style

Fixes checkpatch coding style issues.

Philippe Loctaux (2):
Staging: most: aim-sound: sound.c: fixed an alignment issue
Staging: most: aim-sound: sound.c: removed unnecessary parentheses

 drivers/staging/most/aim-sound/sound.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
Signature · 1 line
2.15.1
#1 lore raw

PATCH 1/2 Staging: most: aim-sound: sound.c: fixed an alignment issue

Fixed a coding style issue.

---
 drivers/staging/most/aim-sound/sound.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/staging/most/aim-sound/sound.c +6 -6
index ea1366a44..ab2b0d833 100644
@@ -235,12 +235,12 @@ static int playback_thread(void *data)
 		struct mbo *mbo = NULL;
 		bool period_elapsed = false;
 
-		wait_event_interruptible(
-			channel->playback_waitq,
-			kthread_should_stop() ||
-			(channel->is_stream_running &&
-			 (mbo = most_get_mbo(channel->iface, channel->id,
-					     &audio_aim))));
+		wait_event_interruptible(channel->playback_waitq,
+					 kthread_should_stop() ||
+					 (channel->is_stream_running &&
+					 (mbo = most_get_mbo(channel->iface,
+							     channel->id,
+							     &audio_aim))));
 		if (!mbo)
 			continue;
 
Signature · 1 line
2.15.1
maintainer
#2 lore raw

Re: [PATCH 1/2] Staging: most: aim-sound: sound.c: fixed an alignment issue

Quoted 6 lines · Philippe Loctaux

Fixed a coding style issue.

---
 drivers/staging/most/aim-sound/sound.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

This file is not in my tree anymore, please always work off of linux-next.

thanks,

greg k-h

#3 lore raw

PATCH 2/2 Staging: most: aim-sound: sound.c: removed unnecessary parentheses

In reply to Philippe Loctaux

Removed unnecessary parentheses in a if statement.

---
 drivers/staging/most/aim-sound/sound.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/most/aim-sound/sound.c +1 -1
index ab2b0d833..0e79a4898 100644
@@ -166,7 +166,7 @@ static struct channel *get_channel(struct most_interface *iface,
 	struct channel *channel, *tmp;
 
 	list_for_each_entry_safe(channel, tmp, &dev_list, list) {
-		if ((channel->iface == iface) && (channel->id == channel_id))
+		if (channel->iface == iface && channel->id == channel_id)
 			return channel;
 	}
 
Signature · 1 line
2.15.1
#4 lore raw

Re: [PATCH 2/2] Staging: most: aim-sound: sound.c: removed unnecessary parentheses

29.12.2017, 02:07, "Philippe Loctaux" <[email protected]>:

Quoted 12 lines

Removed unnecessary parentheses in a if statement.

---
 drivers/staging/most/aim-sound/sound.c | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/most/aim-sound/sound.c +0 -0
index ab2b0d833..0e79a4898 100644

drivers/staging/most/aim-sound/sound.c static struct channel *get_channel(struct most_interface *iface, · line 171

Quoted 7 lines
drivers/staging/most/aim-sound/sound.c +1 -1
@@ -166,7 +166,7 @@ static struct channel *get_channel(struct most_interface *iface,
          struct channel *channel, *tmp;
 
          list_for_each_entry_safe(channel, tmp, &dev_list, list) {
- if ((channel->iface == iface) && (channel->id == channel_id))
+ if (channel->iface == iface && channel->id == channel_id)
                          return channel;
          }

Hello,

I think this patch is not good, the code will not work. Please should understand in && operator and () why used with C.

Ozgur

Quoted 2 lines
drivers/staging/most/aim-sound/sound.c +0 -1
--

2.15.1

#5 lore raw

Re: [PATCH 2/2] Staging: most: aim-sound: sound.c: removed unnecessary parentheses

Quoted 1 line · Ozgur

I think this patch is not good, the code will not work. Please should understand in && operator and () why used with C.

hi,
this patch should work, since it compiles and passes checkpatch.

the reason why i removed the () is because of the && operator, it works without the need of having () around the statments, which makes the code simpler to read.

have a nice day.

-phil
[email protected]
https://philippeloctaux.com

maintainer
#6 lore raw

Re: [PATCH 2/2] Staging: most: aim-sound: sound.c: removed unnecessary parentheses

In reply to Philippe Loctaux
Quoted 6 lines · Philippe Loctaux

Removed unnecessary parentheses in a if statement.

---
 drivers/staging/most/aim-sound/sound.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Also not in my tree anymore :(

#7 lore raw
In reply to Philippe Loctaux

29.12.2017, 02:07, "Philippe Loctaux" <[email protected]>:

Quoted 1 line

Fixes checkpatch coding style issues.

Hello,

how can i see is changed/patched code lines?

Ozgur

Quoted 9 lines

Philippe Loctaux (2):
  Staging: most: aim-sound: sound.c: fixed an alignment issue
  Staging: most: aim-sound: sound.c: removed unnecessary parentheses

 drivers/staging/most/aim-sound/sound.c | 14 +++++++-------

 1 file changed, 7 insertions(+), 7 deletions(-)

--
2.15.1