linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: YueHaibing <yuehaibing@huawei.com>
To: <nchatrad@amd.com>, <jdelvare@suse.com>, <linux@roeck-us.net>,
	<yuehaibing@huawei.com>
Cc: <linux-hwmon@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: [PATCH -next] hwmon: (amd_energy) Fix build error
Date: Wed, 27 May 2020 21:02:41 +0800	[thread overview]
Message-ID: <20200527130241.58468-1-yuehaibing@huawei.com> (raw)

If CONFIG_NEED_MULTIPLE_NODES is n, building fails:

drivers/hwmon/amd_energy.c: In function ‘amd_energy_read’:
./include/asm-generic/topology.h:51:36: error: void value not ignored as it ought to be
     #define cpumask_of_node(node) ((void)node, cpu_online_mask)
./include/linux/cpumask.h:618:72: note: in definition of macro ‘cpumask_first_and’
 #define cpumask_first_and(src1p, src2p) cpumask_next_and(-1, (src1p), (src2p))
                                                                        ^~~~~
drivers/hwmon/amd_energy.c:194:6: note: in expansion of macro ‘cpumask_of_node’
      cpumask_of_node
      ^~~~~~~~~~~~~~~
./include/asm-generic/topology.h:51:46: warning: left-hand operand of comma expression has no effect [-Wunused-value]
     #define cpumask_of_node(node) ((void)node, cpu_online_mask)
                                              ^
./include/linux/cpumask.h:618:72: note: in definition of macro ‘cpumask_first_and’
 #define cpumask_first_and(src1p, src2p) cpumask_next_and(-1, (src1p), (src2p))
                                                                        ^~~~~
drivers/hwmon/amd_energy.c:194:6: note: in expansion of macro ‘cpumask_of_node’
      cpumask_of_node
      ^~~~~~~~~~~~~~~

Fixes: 8abee9566b7e ("hwmon: Add amd_energy driver to report energy counters")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/hwmon/amd_energy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwmon/amd_energy.c b/drivers/hwmon/amd_energy.c
index bc8b643a37d5..9d5cd3057866 100644
--- a/drivers/hwmon/amd_energy.c
+++ b/drivers/hwmon/amd_energy.c
@@ -192,7 +192,7 @@ static int amd_energy_read(struct device *dev,
 	if (channel >= data->nr_cpus) {
 		cpu = cpumask_first_and(cpu_online_mask,
 					cpumask_of_node
-					(channel - data->nr_cpus));
+					((channel - data->nr_cpus)));
 		amd_add_delta(data, channel, cpu, val, false);
 	} else {
 		cpu = channel;
-- 
2.17.1



             reply	other threads:[~2020-05-27 13:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-27 13:02 YueHaibing [this message]
2020-05-27 13:22 ` [PATCH -next] hwmon: (amd_energy) Fix build error Guenter Roeck
2020-05-28  1:10   ` Yuehaibing

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=20200527130241.58468-1-yuehaibing@huawei.com \
    --to=yuehaibing@huawei.com \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=nchatrad@amd.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).