* [PATCH] tools/power/x86/intel-speed-select: Fix warning for perf_cap.cpu
@ 2022-05-11 17:12 Srinivas Pandruvada
2022-05-12 13:55 ` Hans de Goede
0 siblings, 1 reply; 2+ messages in thread
From: Srinivas Pandruvada @ 2022-05-11 17:12 UTC (permalink / raw)
To: hdegoede, markgross
Cc: platform-driver-x86, linux-kernel, Srinivas Pandruvada
Initialize perf_cap struct to avoid warning:
CC hfi-events.o
In function ‘process_hfi_event’,
inlined from ‘handle_event’ at hfi-events.c:220:5:
hfi-events.c:184:9: warning: ‘perf_cap.cpu’ may be used
uninitialized [-Wmaybe-uninitialized]
184 | process_level_change(perf_cap->cpu);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
hfi-events.c: In function ‘handle_event’:
hfi-events.c:193:25: note: ‘perf_cap.cpu’ was declared here
193 | struct perf_cap perf_cap;
| ^~~~~~~~
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
---
tools/power/x86/intel-speed-select/hfi-events.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/power/x86/intel-speed-select/hfi-events.c b/tools/power/x86/intel-speed-select/hfi-events.c
index e85676711372..761375062505 100644
--- a/tools/power/x86/intel-speed-select/hfi-events.c
+++ b/tools/power/x86/intel-speed-select/hfi-events.c
@@ -190,7 +190,7 @@ static int handle_event(struct nl_msg *n, void *arg)
struct genlmsghdr *genlhdr = genlmsg_hdr(nlh);
struct nlattr *attrs[THERMAL_GENL_ATTR_MAX + 1];
int ret;
- struct perf_cap perf_cap;
+ struct perf_cap perf_cap = {0};
ret = genlmsg_parse(nlh, 0, attrs, THERMAL_GENL_ATTR_MAX, NULL);
--
2.35.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] tools/power/x86/intel-speed-select: Fix warning for perf_cap.cpu
2022-05-11 17:12 [PATCH] tools/power/x86/intel-speed-select: Fix warning for perf_cap.cpu Srinivas Pandruvada
@ 2022-05-12 13:55 ` Hans de Goede
0 siblings, 0 replies; 2+ messages in thread
From: Hans de Goede @ 2022-05-12 13:55 UTC (permalink / raw)
To: Srinivas Pandruvada, markgross; +Cc: platform-driver-x86, linux-kernel
Hi,
On 5/11/22 19:12, Srinivas Pandruvada wrote:
> Initialize perf_cap struct to avoid warning:
>
> CC hfi-events.o
> In function ‘process_hfi_event’,
> inlined from ‘handle_event’ at hfi-events.c:220:5:
> hfi-events.c:184:9: warning: ‘perf_cap.cpu’ may be used
> uninitialized [-Wmaybe-uninitialized]
> 184 | process_level_change(perf_cap->cpu);
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> hfi-events.c: In function ‘handle_event’:
> hfi-events.c:193:25: note: ‘perf_cap.cpu’ was declared here
> 193 | struct perf_cap perf_cap;
> | ^~~~~~~~
>
> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Thank you for your patch, I've applied this patch to my review-hans
branch:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans
Note it will show up in my review-hans branch once I've pushed my
local branch there, which might take a while.
Once I've run some tests on this branch the patches there will be
added to the platform-drivers-x86/for-next branch and eventually
will be included in the pdx86 pull-request to Linus for the next
merge-window.
Regards,
Hans
> ---
> tools/power/x86/intel-speed-select/hfi-events.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/power/x86/intel-speed-select/hfi-events.c b/tools/power/x86/intel-speed-select/hfi-events.c
> index e85676711372..761375062505 100644
> --- a/tools/power/x86/intel-speed-select/hfi-events.c
> +++ b/tools/power/x86/intel-speed-select/hfi-events.c
> @@ -190,7 +190,7 @@ static int handle_event(struct nl_msg *n, void *arg)
> struct genlmsghdr *genlhdr = genlmsg_hdr(nlh);
> struct nlattr *attrs[THERMAL_GENL_ATTR_MAX + 1];
> int ret;
> - struct perf_cap perf_cap;
> + struct perf_cap perf_cap = {0};
>
> ret = genlmsg_parse(nlh, 0, attrs, THERMAL_GENL_ATTR_MAX, NULL);
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-05-12 13:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-11 17:12 [PATCH] tools/power/x86/intel-speed-select: Fix warning for perf_cap.cpu Srinivas Pandruvada
2022-05-12 13:55 ` Hans de Goede
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.