mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Yang Yingliang <yangyingliang@huawei.com>,
	richardcochran@gmail.com, vincent.cheng.xh@renesas.com,
	davem@davemloft.net
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next] ptp: clockmatrix: remove unnecessary comparison
Date: Fri, 24 Apr 2020 13:12:05 +0300	[thread overview]
Message-ID: <2c85e220-3765-4424-ee22-c9acf27f9d22@cogentembedded.com> (raw)
In-Reply-To: <1587716058-1840-1-git-send-email-yangyingliang@huawei.com>

Hello!

On 24.04.2020 11:14, Yang Yingliang wrote:

> The type of loaddr is u8 which is always '<=' 0xff, so the
> loaddr <= 0xff is always true, we can remove this comparison.
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
>   drivers/ptp/ptp_clockmatrix.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/ptp/ptp_clockmatrix.c b/drivers/ptp/ptp_clockmatrix.c
> index 032e112..56aee4f 100644
> --- a/drivers/ptp/ptp_clockmatrix.c
> +++ b/drivers/ptp/ptp_clockmatrix.c
> @@ -780,7 +780,7 @@ static int idtcm_load_firmware(struct idtcm *idtcm,
>   
>   			/* Page size 128, last 4 bytes of page skipped */
>   			if (((loaddr > 0x7b) && (loaddr <= 0x7f))
> -			     || ((loaddr > 0xfb) && (loaddr <= 0xff)))
> +			     || loaddr <= 0xff)

    Haven't you just said that this is always true? :-)

[...]

MBR, Sergei

  reply	other threads:[~2020-04-24 10:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-24  8:14 Yang Yingliang
2020-04-24 10:12 ` Sergei Shtylyov [this message]
2020-04-24 12:24   ` Yang Yingliang

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=2c85e220-3765-4424-ee22-c9acf27f9d22@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=richardcochran@gmail.com \
    --cc=vincent.cheng.xh@renesas.com \
    --cc=yangyingliang@huawei.com \
    /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

all inboxes | Powered by JetHome®