2017-12-28 23:07:10

by Philippe Loctaux

[permalink] [raw]
Subject: [PATCH 0/2] 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(-)

--
2.15.1


2017-12-28 23:07:17

by Philippe Loctaux

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

Fixed a coding style issue.

Signed-off-by: Philippe Loctaux <[email protected]>
---
drivers/staging/most/aim-sound/sound.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/most/aim-sound/sound.c b/drivers/staging/most/aim-sound/sound.c
index ea1366a44..ab2b0d833 100644
--- a/drivers/staging/most/aim-sound/sound.c
+++ b/drivers/staging/most/aim-sound/sound.c
@@ -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;

--
2.15.1

2017-12-28 23:07:21

by Philippe Loctaux

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

Removed unnecessary parentheses in a if statement.

Signed-off-by: Philippe Loctaux <[email protected]>
---
drivers/staging/most/aim-sound/sound.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/most/aim-sound/sound.c b/drivers/staging/most/aim-sound/sound.c
index ab2b0d833..0e79a4898 100644
--- a/drivers/staging/most/aim-sound/sound.c
+++ b/drivers/staging/most/aim-sound/sound.c
@@ -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;
}

--
2.15.1

2017-12-28 23:14:10

by Ozgur

[permalink] [raw]
Subject: Re: [PATCH 0/2] Staging: most: aim-sound: sound.c: coding style

29.12.2017, 02:07, "Philippe Loctaux" <[email protected]>:
> Fixes checkpatch coding style issues.

Hello,

how can i see is changed/patched code lines?

Ozgur

> 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

2017-12-28 23:20:01

by Ozgur

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



29.12.2017, 02:07, "Philippe Loctaux" <[email protected]>:
> Removed unnecessary parentheses in a if statement.
>
> Signed-off-by: Philippe Loctaux <[email protected]>
> ---
>  drivers/staging/most/aim-sound/sound.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/most/aim-sound/sound.c b/drivers/staging/most/aim-sound/sound.c
> index ab2b0d833..0e79a4898 100644
> --- a/drivers/staging/most/aim-sound/sound.c
> +++ b/drivers/staging/most/aim-sound/sound.c
> @@ -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

> --
> 2.15.1

2017-12-29 14:50:11

by Philippe Loctaux

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

On Fri, Dec 29, 2017 at 02:19:56AM +0300, Ozgur wrote:
> 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

2018-01-08 15:35:13

by Greg Kroah-Hartman

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

On Fri, Dec 29, 2017 at 12:06:49AM +0100, Philippe Loctaux wrote:
> Fixed a coding style issue.
>
> Signed-off-by: Philippe Loctaux <[email protected]>
> ---
> 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

2018-01-08 15:35:42

by Greg Kroah-Hartman

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

On Fri, Dec 29, 2017 at 12:06:50AM +0100, Philippe Loctaux wrote:
> Removed unnecessary parentheses in a if statement.
>
> Signed-off-by: Philippe Loctaux <[email protected]>
> ---
> drivers/staging/most/aim-sound/sound.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

Also not in my tree anymore :(