From: Yang Li <yang.lee@linux.alibaba.com>
To: rafael@kernel.org
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
Yang Li <yang.lee@linux.alibaba.com>
Subject: [PATCH -next] powercap: arm_scmi: Fix an ignored error return from num_domains_get()
Date: Tue, 5 Jul 2022 10:25:57 +0800 [thread overview]
Message-ID: <20220705022557.19747-1-yang.lee@linux.alibaba.com> (raw)
On line 428 pr->num_zones = powercap_ops->num_domains_get(), the return
of num_domains_get() is int, it can be a negative error code, however
this is being assigned to an unsigned int variable, so make the num_zones
to int to solve this problem without affecting other functions.
Eliminate the following coccicheck warning:
./drivers/powercap/arm_scmi_powercap.c:429:5-18: WARNING: Unsigned expression compared with zero: pr -> num_zones < 0
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---
drivers/powercap/arm_scmi_powercap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/powercap/arm_scmi_powercap.c b/drivers/powercap/arm_scmi_powercap.c
index 36f6dc211fbb..11018e63bb8b 100644
--- a/drivers/powercap/arm_scmi_powercap.c
+++ b/drivers/powercap/arm_scmi_powercap.c
@@ -29,7 +29,7 @@ struct scmi_powercap_zone {
};
struct scmi_powercap_root {
- unsigned int num_zones;
+ int num_zones;
struct scmi_powercap_zone *spzones;
struct list_head *registered_zones;
};
--
2.20.1.7.g153144c
reply other threads:[~2022-07-05 2:26 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20220705022557.19747-1-yang.lee@linux.alibaba.com \
--to=yang.lee@linux.alibaba.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rafael@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
all inboxes | Powered by JetHome®