From: Changli Gao <xiaosuo@gmail.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <eric.dumazet@gmail.com>,
Tom Herbert <therbert@google.com>,
netdev@vger.kernel.org, Changli Gao <xiaosuo@gmail.com>
Subject: [PATCH] net: use NUMA_NO_NODE instead of the magic number -1
Date: Tue, 14 Dec 2010 21:09:15 +0800 [thread overview]
Message-ID: <1292332155-25151-1-git-send-email-xiaosuo@gmail.com> (raw)
Signed-off-by: Changli Gao <xiaosuo@gmail.com>
---
include/linux/netdevice.h | 2 +-
net/core/dev.c | 2 +-
net/core/net-sysfs.c | 3 ++-
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index d31bc3c..56c38bb 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -530,7 +530,7 @@ static inline int netdev_queue_numa_node_read(const struct netdev_queue *q)
#if defined(CONFIG_XPS) && defined(CONFIG_NUMA)
return q->numa_node;
#else
- return -1;
+ return NUMA_NO_NODE;
#endif
}
diff --git a/net/core/dev.c b/net/core/dev.c
index d28b3a0..004024c 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -5116,7 +5116,7 @@ static void netdev_init_one_queue(struct net_device *dev,
spin_lock_init(&queue->_xmit_lock);
netdev_set_xmit_lockdep_class(&queue->_xmit_lock, dev->type);
queue->xmit_lock_owner = -1;
- netdev_queue_numa_node_write(queue, -1);
+ netdev_queue_numa_node_write(queue, NUMA_NO_NODE);
queue->dev = dev;
}
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
index 85e8b53..e23c01b 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -1009,7 +1009,8 @@ static ssize_t store_xps_map(struct netdev_queue *queue,
if (dev_maps)
call_rcu(&dev_maps->rcu, xps_dev_maps_release);
- netdev_queue_numa_node_write(queue, (numa_node >= 0) ? numa_node : -1);
+ netdev_queue_numa_node_write(queue, (numa_node >= 0) ? numa_node :
+ NUMA_NO_NODE);
mutex_unlock(&xps_map_mutex);
next reply other threads:[~2010-12-14 13:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-14 13:09 Changli Gao [this message]
2010-12-16 20:36 ` [PATCH] net: use NUMA_NO_NODE instead of the magic number -1 David Miller
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=1292332155-25151-1-git-send-email-xiaosuo@gmail.com \
--to=xiaosuo@gmail.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=therbert@google.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).