All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] staging: bcm2835-audio: refactor code for compaction
@ 2017-03-06 15:34 Aishwarya Pant
  2017-03-06 15:34 ` [PATCH 1/2] staging: bcm2835-audio: merge two if conditions into one Aishwarya Pant
  2017-03-06 15:35 ` [PATCH 2/2] staging: bcm2835-audio: remove unused semaphores Aishwarya Pant
  0 siblings, 2 replies; 4+ messages in thread
From: Aishwarya Pant @ 2017-03-06 15:34 UTC (permalink / raw)
  To: Stephen Warren, Lee Jones, Eric Anholt, Greg Kroah-Hartman,
	Florian Fainelli, Ray Jui, Scott Branden,
	bcm-kernel-feedback-list
  Cc: outreachy-kernel

This patch fixes two code style issues:
	- Merge two if condiitonals doing the same work
	- Removes initialisation of unused semaphores ( should they be
	  removed all-together? )


Aishwarya Pant (2):
  staging: bcm2835-audio: merge two if conditions into one
  staging: bcm2835-audio: remove unused semaphores

 drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

-- 
2.7.4



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

* [PATCH 1/2] staging: bcm2835-audio: merge two if conditions into one
  2017-03-06 15:34 [PATCH 0/2] staging: bcm2835-audio: refactor code for compaction Aishwarya Pant
@ 2017-03-06 15:34 ` Aishwarya Pant
  2017-03-06 15:35 ` [PATCH 2/2] staging: bcm2835-audio: remove unused semaphores Aishwarya Pant
  1 sibling, 0 replies; 4+ messages in thread
From: Aishwarya Pant @ 2017-03-06 15:34 UTC (permalink / raw)
  To: Stephen Warren, Lee Jones, Eric Anholt, Greg Kroah-Hartman,
	Florian Fainelli, Ray Jui, Scott Branden,
	bcm-kernel-feedback-list
  Cc: outreachy-kernel

Patch merges two if conditions doing the same work into one.

Signed-off-by: Aishwarya Pant <aishpant@gmail.com>
---
 drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c
index d60d702..f4ce4801dc 100644
--- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c
+++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c
@@ -122,10 +122,8 @@ static int snd_bcm2835_playback_open_generic(
 	audio_info("Alsa open (%d)\n", substream->number);
 	idx = substream->number;
 
-	if (spdif && chip->opened) {
-		err = -EBUSY;
-		goto out;
-	} else if (!spdif && (chip->opened & (1 << idx))) {
+	if ((spdif && chip->opened) ||
+	    (!spdif && (chip->opened & (1 << idx)))) {
 		err = -EBUSY;
 		goto out;
 	}
-- 
2.7.4



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

* [PATCH 2/2] staging: bcm2835-audio: remove unused semaphores
  2017-03-06 15:34 [PATCH 0/2] staging: bcm2835-audio: refactor code for compaction Aishwarya Pant
  2017-03-06 15:34 ` [PATCH 1/2] staging: bcm2835-audio: merge two if conditions into one Aishwarya Pant
@ 2017-03-06 15:35 ` Aishwarya Pant
  2017-03-06 16:41   ` [Outreachy kernel] " Julia Lawall
  1 sibling, 1 reply; 4+ messages in thread
From: Aishwarya Pant @ 2017-03-06 15:35 UTC (permalink / raw)
  To: Stephen Warren, Lee Jones, Eric Anholt, Greg Kroah-Hartman,
	Florian Fainelli, Ray Jui, Scott Branden,
	bcm-kernel-feedback-list
  Cc: outreachy-kernel

This patch removes initialisation of unused semaphores
alsa_stream->buffers_update_sem and alsa_stream->control_sem

Signed-off-by: Aishwarya Pant <aishpant@gmail.com>
---
 drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c
index f4ce4801dc..c0a511e 100644
--- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c
+++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c
@@ -154,8 +154,6 @@ static int snd_bcm2835_playback_open_generic(
 	alsa_stream->substream = substream;
 	alsa_stream->idx = idx;
 
-	sema_init(&alsa_stream->buffers_update_sem, 0);
-	sema_init(&alsa_stream->control_sem, 0);
 	spin_lock_init(&alsa_stream->lock);
 
 	err = bcm2835_audio_open(alsa_stream);
-- 
2.7.4



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

* Re: [Outreachy kernel] [PATCH 2/2] staging: bcm2835-audio: remove unused semaphores
  2017-03-06 15:35 ` [PATCH 2/2] staging: bcm2835-audio: remove unused semaphores Aishwarya Pant
@ 2017-03-06 16:41   ` Julia Lawall
  0 siblings, 0 replies; 4+ messages in thread
From: Julia Lawall @ 2017-03-06 16:41 UTC (permalink / raw)
  To: Aishwarya Pant
  Cc: Stephen Warren, Lee Jones, Eric Anholt, Greg Kroah-Hartman,
	Florian Fainelli, Ray Jui, Scott Branden,
	bcm-kernel-feedback-list, outreachy-kernel



On Mon, 6 Mar 2017, Aishwarya Pant wrote:

> This patch removes initialisation of unused semaphores
> alsa_stream->buffers_update_sem and alsa_stream->control_sem
>
> Signed-off-by: Aishwarya Pant <aishpant@gmail.com>
> ---
>  drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c
> index f4ce4801dc..c0a511e 100644
> --- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c
> +++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c
> @@ -154,8 +154,6 @@ static int snd_bcm2835_playback_open_generic(
>  	alsa_stream->substream = substream;
>  	alsa_stream->idx = idx;
>
> -	sema_init(&alsa_stream->buffers_update_sem, 0);
> -	sema_init(&alsa_stream->control_sem, 0);

If they are not used, maybe they should be dropped from the structure as
well?

julia

>  	spin_lock_init(&alsa_stream->lock);
>
>  	err = bcm2835_audio_open(alsa_stream);
> --
> 2.7.4
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/3751b0b72869975ee0e829f6aaedf3b6f044452d.1488814329.git.aishpant%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>


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

end of thread, other threads:[~2017-03-06 16:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-06 15:34 [PATCH 0/2] staging: bcm2835-audio: refactor code for compaction Aishwarya Pant
2017-03-06 15:34 ` [PATCH 1/2] staging: bcm2835-audio: merge two if conditions into one Aishwarya Pant
2017-03-06 15:35 ` [PATCH 2/2] staging: bcm2835-audio: remove unused semaphores Aishwarya Pant
2017-03-06 16:41   ` [Outreachy kernel] " Julia Lawall

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.