All of lore.kernel.org
 help / color / mirror / Atom feed
From: "mika.westerberg@linux.intel.com" <mika.westerberg@linux.intel.com>
To: David Binderman <dcb314@hotmail.com>
Cc: "andreas.noever@gmail.com" <andreas.noever@gmail.com>,
	"michael.jamet@intel.com" <michael.jamet@intel.com>,
	"YehezkelShB@gmail.com" <YehezkelShB@gmail.com>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: Possible cut'n'paste error in linux-6.5/drivers/thunderbolt/tmu.c
Date: Thu, 31 Aug 2023 14:16:55 +0300	[thread overview]
Message-ID: <20230831111655.GP3465@black.fi.intel.com> (raw)
In-Reply-To: <DB6P189MB056829997A31D4B968AEA77C9CE5A@DB6P189MB0568.EURP189.PROD.OUTLOOK.COM>

Hi,

On Thu, Aug 31, 2023 at 11:02:58AM +0000, David Binderman wrote:
> Hello there,
> 
> I just tried out static analyser cppcheck on linux-6.5. It said:
> 
> linux-6.5/drivers/thunderbolt/tmu.c:385:50: style: Expression is always false because 'else if' condition matches previous condition at line 383. [multiCondition]
> 
> Source code is
> 
>             if (tmu_rates[TB_SWITCH_TMU_MODE_LOWRES] == rate)
>                 sw->tmu.mode = TB_SWITCH_TMU_MODE_LOWRES;
>             else if (tmu_rates[TB_SWITCH_TMU_MODE_LOWRES] == rate)
>                 sw->tmu.mode = TB_SWITCH_TMU_MODE_HIFI_UNI;
> 

Thanks for the report. Indeed, this should be

             else if (tmu_rates[TB_SWITCH_TMU_MODE_HIFI_UNI] == rate)
                 sw->tmu.mode = TB_SWITCH_TMU_MODE_HIFI_UNI;

I will fix it up and send out after v6.6-rc1 is released.

      reply	other threads:[~2023-08-31 11:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-31 11:02 Possible cut'n'paste error in linux-6.5/drivers/thunderbolt/tmu.c David Binderman
2023-08-31 11:16 ` mika.westerberg [this message]

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=20230831111655.GP3465@black.fi.intel.com \
    --to=mika.westerberg@linux.intel.com \
    --cc=YehezkelShB@gmail.com \
    --cc=andreas.noever@gmail.com \
    --cc=dcb314@hotmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=michael.jamet@intel.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 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.