All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Aishwarya Pant <aishpant@gmail.com>
Cc: Stephen Warren <swarren@wwwdotorg.org>,
	Lee Jones <lee@kernel.org>, Eric Anholt <eric@anholt.net>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Ray Jui <rjui@broadcom.com>,
	Scott Branden <sbranden@broadcom.com>,
	bcm-kernel-feedback-list@broadcom.com,
	outreachy-kernel@googlegroups.com
Subject: Re: [Outreachy kernel] [PATCH v2 1/2] staging: bcm2835-audio: merge two if conditions into one
Date: Tue, 7 Mar 2017 20:08:34 +0100	[thread overview]
Message-ID: <20170307190834.GB6914@kroah.com> (raw)
In-Reply-To: <e6a2881d03ee9414c462177f5b437bc1a1733679.1488830058.git.aishpant@gmail.com>

On Tue, Mar 07, 2017 at 01:27:09AM +0530, Aishwarya Pant wrote:
> 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)))) {

But now it's a lot harder to read and understand, right?  Please keep
the original, it's not incorrect.

There are _so_ many real things to fix in this driver, don't make minor
tweaks for no reason.

thanks,

greg k-h


  reply	other threads:[~2017-03-07 19:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-06 19:56 [PATCH v2 0/2] staging: bcm2835-audio: refactor code for compaction Aishwarya Pant
2017-03-06 19:57 ` [PATCH v2 1/2] staging: bcm2835-audio: merge two if conditions into one Aishwarya Pant
2017-03-07 19:08   ` Greg Kroah-Hartman [this message]
2017-03-06 19:57 ` [PATCH v2 2/2] staging: bcm2835-audio: remove unused semaphores Aishwarya Pant

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170307190834.GB6914@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=aishpant@gmail.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=eric@anholt.net \
    --cc=f.fainelli@gmail.com \
    --cc=lee@kernel.org \
    --cc=outreachy-kernel@googlegroups.com \
    --cc=rjui@broadcom.com \
    --cc=sbranden@broadcom.com \
    --cc=swarren@wwwdotorg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.