From: Huang Rui <ray.huang@amd.com>
To: kbuild test robot <lkp@intel.com>
Cc: kbuild-all@01.org, "Borislav Petkov" <bp@suse.de>,
"Guenter Roeck" <linux@roeck-us.net>,
"Peter Zijlstra" <peterz@infradead.org>,
"Jean Delvare" <jdelvare@suse.de>,
"Andy Lutomirski" <luto@amacapital.net>,
"Andreas Herrmann" <herrmann.der.user@gmail.com>,
"Thomas Gleixner" <tglx@linutronix.de>,
"Ingo Molnar" <mingo@kernel.org>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
"Len Brown" <lenb@kernel.org>,
"John Stultz" <john.stultz@linaro.org>,
"Fr�d�ric Weisbecker" <fweisbec@gmail.com>,
lm-sensors@lm-sensors.org, linux-kernel@vger.kernel.org,
x86@kernel.org,
"Andreas Herrmann" <herrmann.der.user@googlemail.com>,
"Aravind Gopalakrishnan" <Aravind.Gopalakrishnan@amd.com>,
"Borislav Petkov" <bp@alien8.de>,
"Fengguang Wu" <fengguang.wu@intel.com>,
"Aaron Lu" <aaron.lu@intel.com>,
SPG_Linux_Kernel <SPG_Linux_Kernel@amd.com>
Subject: Re: [PATCH v3 06/10] hwmon: (fam15h_power) Add compute unit accumulated power
Date: Mon, 2 Nov 2015 12:45:35 +0800 [thread overview]
Message-ID: <20151102044534.GA24402@hr-amur2> (raw)
In-Reply-To: <201510301835.gZzXFZav%fengguang.wu@intel.com>
On Fri, Oct 30, 2015 at 06:33:42PM +0800, kbuild test robot wrote:
> Hi Huang,
>
> [auto build test WARNING on hwmon/hwmon-next -- if it's inappropriate base, please suggest rules for selecting the more suitable base]
>
> url: https://github.com/0day-ci/linux/commits/Huang-Rui/hwmon-fam15h_power-Introduce-an-accumulated-power-reporting-algorithm/20151030-181426
> config: x86_64-randconfig-x012-10300134 (attached as .config)
> reproduce:
> # save the attached .config to linux build tree
> make ARCH=x86_64
>
> Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
> http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings
>
> All warnings (new ones prefixed by >>):
>
> In file included from arch/x86/include/asm/cpumask.h:4:0,
> from arch/x86/include/asm/msr.h:10,
> from arch/x86/include/asm/processor.h:20,
> from arch/x86/include/asm/atomic.h:6,
> from include/linux/atomic.h:4,
> from include/linux/debug_locks.h:5,
> from include/linux/lockdep.h:23,
> from include/linux/spinlock_types.h:18,
> from include/linux/mutex.h:15,
> from include/linux/kernfs.h:13,
> from include/linux/sysfs.h:15,
> from include/linux/kobject.h:21,
> from include/linux/device.h:17,
> from include/linux/hwmon-sysfs.h:23,
> from drivers/hwmon/fam15h_power.c:23:
> drivers/hwmon/fam15h_power.c: In function 'fam15h_power_probe':
> >> include/linux/cpumask.h:24:29: warning: 'res_mask' may be used uninitialized in this function [-Wmaybe-uninitialized]
> #define cpumask_bits(maskp) ((maskp)->bits)
> ^
> drivers/hwmon/fam15h_power.c:145:32: note: 'res_mask' was declared here
> cpumask_var_t mask, tmp_mask, res_mask;
> ^
Thank you to capture it! That's because my machine doesn't enable
CONFIG_CPUMASK_OFFSTACK. So I didn't find this issue before. :)
It needs to allocate res_mask like below:
---
diff --git a/drivers/hwmon/fam15h_power.c b/drivers/hwmon/fam15h_power.c
index 71c9e6c..499776b 100644
--- a/drivers/hwmon/fam15h_power.c
+++ b/drivers/hwmon/fam15h_power.c
@@ -172,6 +172,10 @@ static int read_registers(struct fam15h_power_data *data)
if (!ret)
return -ENOMEM;
+ ret = zalloc_cpumask_var(&res_mask, GFP_KERNEL);
+ if (!ret)
+ return -ENOMEM;
+
get_online_cpus();
this_cpu = get_cpu();
@@ -199,6 +203,7 @@ static int read_registers(struct fam15h_power_data *data)
put_cpu();
put_online_cpus();
+ free_cpumask_var(res_mask);
free_cpumask_var(tmp_mask);
free_cpumask_var(mask);
---
Thanks,
Rui
next prev parent reply other threads:[~2015-11-02 4:46 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-30 9:56 [PATCH v3 00/10] hwmon: (fam15h_power) Introduce an accumulated power reporting algorithm Huang Rui
2015-10-30 9:56 ` [PATCH v3 01/10] hwmon: (fam15h_power) Refactor attributes for dynamically added Huang Rui
2015-10-31 22:38 ` Guenter Roeck
2015-10-30 9:56 ` [PATCH v3 02/10] hwmon: (fam15h_power) Enable power1_input on AMD Carrizo Huang Rui
2015-10-31 22:42 ` Guenter Roeck
2015-11-02 4:58 ` Huang Rui
2015-10-30 9:56 ` [PATCH v3 03/10] hwmon: (fam15h_power) Add max compute unit accumulated power Huang Rui
2015-10-31 22:44 ` Guenter Roeck
2015-10-30 9:56 ` [PATCH v3 04/10] x86, amd: add accessor for number of cores per compute unit Huang Rui
2015-10-31 22:45 ` Guenter Roeck
2015-10-30 9:56 ` [PATCH v3 05/10] hwmon: (fam15h_power) Add CPU_SUP_AMD as the dependence Huang Rui
2015-10-30 9:57 ` [PATCH v3 06/10] hwmon: (fam15h_power) Add compute unit accumulated power Huang Rui
2015-10-30 10:33 ` kbuild test robot
2015-11-02 4:45 ` Huang Rui [this message]
2015-10-30 9:57 ` [PATCH v3 07/10] hwmon: (fam15h_power) Add ptsc counter value for " Huang Rui
2015-10-30 9:57 ` [PATCH v3 08/10] hwmon: (fam15h_power) Introduce a cpu accumulated power reporting algorithm Huang Rui
2015-10-30 9:57 ` [PATCH v3 09/10] hwmon: (fam15h_power) Add documentation for TDP and accumulated power algorithm Huang Rui
2015-10-30 9:57 ` [PATCH v3 10/10] MAINTAINERS: change the maintainer of fam15h_power driver Huang Rui
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=20151102044534.GA24402@hr-amur2 \
--to=ray.huang@amd.com \
--cc=Aravind.Gopalakrishnan@amd.com \
--cc=SPG_Linux_Kernel@amd.com \
--cc=aaron.lu@intel.com \
--cc=bp@alien8.de \
--cc=bp@suse.de \
--cc=fengguang.wu@intel.com \
--cc=fweisbec@gmail.com \
--cc=herrmann.der.user@gmail.com \
--cc=herrmann.der.user@googlemail.com \
--cc=jdelvare@suse.de \
--cc=john.stultz@linaro.org \
--cc=kbuild-all@01.org \
--cc=lenb@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=lkp@intel.com \
--cc=lm-sensors@lm-sensors.org \
--cc=luto@amacapital.net \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=rjw@rjwysocki.net \
--cc=tglx@linutronix.de \
--cc=x86@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®