public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@s-opensource.com>
To: Colin King <colin.king@canonical.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] [media] mb86a20s: remove redundant check if val is less than zero
Date: Fri, 15 Jul 2016 12:20:08 -0300	[thread overview]
Message-ID: <20160715122008.20c5f59d@recife.lan> (raw)
In-Reply-To: <1468315851-9179-1-git-send-email-colin.king@canonical.com>

Em Tue, 12 Jul 2016 10:30:51 +0100
Colin King <colin.king@canonical.com> escreveu:

> From: Colin Ian King <colin.king@canonical.com>
> 
> The result of mb86a20s_readreg(state, 0x0a) & 0xf is always in the range
> 0x00 to 0x0f and can never be negative, so remove the redundant check
> of the result being less than zero.
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  drivers/media/dvb-frontends/mb86a20s.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/media/dvb-frontends/mb86a20s.c b/drivers/media/dvb-frontends/mb86a20s.c
> index fb88ddd..0205846 100644
> --- a/drivers/media/dvb-frontends/mb86a20s.c
> +++ b/drivers/media/dvb-frontends/mb86a20s.c
> @@ -302,8 +302,6 @@ static int mb86a20s_read_status(struct dvb_frontend *fe, enum fe_status *status)
>  	*status = 0;
>  
>  	val = mb86a20s_readreg(state, 0x0a) & 0xf;
> -	if (val < 0)
> -		return val;

Actually, mb86a20s_readreg() can return a negative value.

Please change the above logic to first check for the value returned
from mb86a20s_readreg() and then apply the bitmask.

Thanks,
Mauro

>  
>  	if (val >= 2)
>  		*status |= FE_HAS_SIGNAL;



Thanks,
Mauro

  reply	other threads:[~2016-07-15 15:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-12  9:30 [PATCH] [media] mb86a20s: remove redundant check if val is less than zero Colin King
2016-07-15 15:20 ` Mauro Carvalho Chehab [this message]
2016-07-15 15:45   ` Colin Ian King

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=20160715122008.20c5f59d@recife.lan \
    --to=mchehab@s-opensource.com \
    --cc=colin.king@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox