[2/2] lib/power:fix comparision to bool warning

Message ID tencent_771A412756220DADE84312E71953957F7408@qq.com (mailing list archive)
State Changes Requested, archived
Headers
Series None |

Checks

Context Check Description
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-abi-testing success Testing PASS

Commit Message

biggest dreamer June 13, 2022, 3:56 p.m. UTC
  From: newsky647 <835703180@qq.com>

expr "if ([expr] == true)" can be simplified to "if ([expr])".
Therefore, simplify it, no functional change.

Fixes: 450f0791312 ("lib/power:  power: add traffic pattern aware power control"
Signed-off-by: newsky647 <835703180@qq.com>
---
 lib/power/rte_power_empty_poll.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
  

Comments

Stephen Hemminger Sept. 12, 2023, 11:08 a.m. UTC | #1
On Mon, 13 Jun 2022 23:56:43 +0800
835703180@qq.com wrote:

> From: newsky647 <835703180@qq.com>
> 
> expr "if ([expr] == true)" can be simplified to "if ([expr])".
> Therefore, simplify it, no functional change.
> 
> Fixes: 450f0791312 ("lib/power:  power: add traffic pattern aware
> power control" Signed-off-by: newsky647 <835703180@qq.com>

This patch does not meet Developer Certificate of Origin legal
requirements. You need to use your legal name because Signed Off by
has legal meaning.


Developer's Certificate of Origin 1.1
By making a contribution to this project, I certify that:

The contribution was created in whole or in part by me and I have the
right to submit it under the open source license indicated in the file;
or

The contribution is based upon previous work that, to the best of my
knowledge, is covered under an appropriate open source license and I
have the right under that license to submit that work with
modifications, whether created in whole or in part by me, under the
same open source license (unless I am permitted to submit under a
different license), as indicated in the file; or

The contribution was provided directly to me by some other person who
certified (a), (b) or (c) and I have not modified it.

I understand and agree that this project and the contribution are
public and that a record of the contribution (including all personal
information I submit with it, including my sign-off) is maintained
indefinitely and may be redistributed consistent with this project or
the open source license(s) involved.

then you just add a line saying:

Signed-off-by: Random J Developer <random@developer.example.org>
using a known identity (sorry, no anonymous contributions.) This will
be done for you automatically if you use git commit -s. Reverts should
also include "Signed-off-by". git revert -s does that for you.

Some people also put extra tags at the end. They'll just be ignored for
now, but you can do this to mark internal company procedures or just
point out some special detail about the sign-off.

Any further SoBs (Signed-off-by:'s) following the author's SoB are from
people handling and transporting the patch, but were not involved in
its development. SoB chains should reflect the real route a patch took
as it was propagated to the maintainers and ultimately to Linus, with
the first SoB entry signalling primary authorship of a single author.
  

Patch

diff --git a/lib/power/rte_power_empty_poll.c b/lib/power/rte_power_empty_poll.c
index 4a4db51247..c58f4155d9 100644
--- a/lib/power/rte_power_empty_poll.c
+++ b/lib/power/rte_power_empty_poll.c
@@ -326,9 +326,9 @@  empty_poll_training(struct priority_worker *poll_stats,
 			max_train_iter);
 
 
-	if (poll_stats->thresh[LOW].trained == true
-			&& poll_stats->thresh[MED].trained == true
-			&& poll_stats->thresh[HGH].trained == true) {
+	if (poll_stats->thresh[LOW].trained
+			&& poll_stats->thresh[MED].trained
+			&& poll_stats->thresh[HGH].trained ) {
 
 		set_state(poll_stats, MED_NORMAL);