Commit 70b2776a authored by Christoph Lameter's avatar Christoph Lameter Committed by Tejun Heo

drivers/net/ethernet/tile: Replace __get_cpu_var uses for address calculation

Replace with this_cpu_ptr.
Acked-by: default avatarChris Metcalf <cmetcalf@tilera.com>
Signed-off-by: default avatarChristoph Lameter <cl@linux.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent 27d05167
......@@ -423,7 +423,7 @@ static void tile_net_pop_all_buffers(int instance, int stack)
/* Provide linux buffers to mPIPE. */
static void tile_net_provide_needed_buffers(void)
{
struct tile_net_info *info = &__get_cpu_var(per_cpu_info);
struct tile_net_info *info = this_cpu_ptr(&per_cpu_info);
int instance, kind;
for (instance = 0; instance < NR_MPIPE_MAX &&
info->mpipe[instance].has_iqueue; instance++) {
......@@ -585,7 +585,7 @@ static void tile_net_receive_skb(struct net_device *dev, struct sk_buff *skb,
/* Handle a packet. Return true if "processed", false if "filtered". */
static bool tile_net_handle_packet(int instance, gxio_mpipe_idesc_t *idesc)
{
struct tile_net_info *info = &__get_cpu_var(per_cpu_info);
struct tile_net_info *info = this_cpu_ptr(&per_cpu_info);
struct mpipe_data *md = &mpipe_data[instance];
struct net_device *dev = md->tile_net_devs_for_channel[idesc->channel];
uint8_t l2_offset;
......@@ -651,7 +651,7 @@ static bool tile_net_handle_packet(int instance, gxio_mpipe_idesc_t *idesc)
*/
static int tile_net_poll(struct napi_struct *napi, int budget)
{
struct tile_net_info *info = &__get_cpu_var(per_cpu_info);
struct tile_net_info *info = this_cpu_ptr(&per_cpu_info);
unsigned int work = 0;
gxio_mpipe_idesc_t *idesc;
int instance, i, n;
......@@ -700,7 +700,7 @@ static int tile_net_poll(struct napi_struct *napi, int budget)
/* Handle an ingress interrupt from an instance on the current cpu. */
static irqreturn_t tile_net_handle_ingress_irq(int irq, void *id)
{
struct tile_net_info *info = &__get_cpu_var(per_cpu_info);
struct tile_net_info *info = this_cpu_ptr(&per_cpu_info);
napi_schedule(&info->mpipe[(uint64_t)id].napi);
return IRQ_HANDLED;
}
......@@ -763,7 +763,7 @@ static enum hrtimer_restart tile_net_handle_tx_wake_timer(struct hrtimer *t)
/* Make sure the egress timer is scheduled. */
static void tile_net_schedule_egress_timer(void)
{
struct tile_net_info *info = &__get_cpu_var(per_cpu_info);
struct tile_net_info *info = this_cpu_ptr(&per_cpu_info);
if (!info->egress_timer_scheduled) {
hrtimer_start(&info->egress_timer,
......@@ -780,7 +780,7 @@ static void tile_net_schedule_egress_timer(void)
*/
static enum hrtimer_restart tile_net_handle_egress_timer(struct hrtimer *t)
{
struct tile_net_info *info = &__get_cpu_var(per_cpu_info);
struct tile_net_info *info = this_cpu_ptr(&per_cpu_info);
unsigned long irqflags;
bool pending = false;
int i, instance;
......@@ -1996,7 +1996,7 @@ static unsigned int tile_net_tx_frags(struct frag *frags,
/* Help the kernel transmit a packet. */
static int tile_net_tx(struct sk_buff *skb, struct net_device *dev)
{
struct tile_net_info *info = &__get_cpu_var(per_cpu_info);
struct tile_net_info *info = this_cpu_ptr(&per_cpu_info);
struct tile_net_priv *priv = netdev_priv(dev);
int instance = priv->instance;
struct mpipe_data *md = &mpipe_data[instance];
......@@ -2138,7 +2138,7 @@ static int tile_net_set_mac_address(struct net_device *dev, void *p)
static void tile_net_netpoll(struct net_device *dev)
{
int instance = mpipe_instance(dev);
struct tile_net_info *info = &__get_cpu_var(per_cpu_info);
struct tile_net_info *info = this_cpu_ptr(&per_cpu_info);
struct mpipe_data *md = &mpipe_data[instance];
disable_percpu_irq(md->ingress_irq);
......@@ -2237,7 +2237,7 @@ static void tile_net_dev_init(const char *name, const uint8_t *mac)
/* Per-cpu module initialization. */
static void tile_net_init_module_percpu(void *unused)
{
struct tile_net_info *info = &__get_cpu_var(per_cpu_info);
struct tile_net_info *info = this_cpu_ptr(&per_cpu_info);
int my_cpu = smp_processor_id();
int instance;
......
......@@ -996,13 +996,13 @@ static void tile_net_register(void *dev_ptr)
PDEBUG("tile_net_register(queue_id %d)\n", queue_id);
if (!strcmp(dev->name, "xgbe0"))
info = &__get_cpu_var(hv_xgbe0);
info = this_cpu_ptr(&hv_xgbe0);
else if (!strcmp(dev->name, "xgbe1"))
info = &__get_cpu_var(hv_xgbe1);
info = this_cpu_ptr(&hv_xgbe1);
else if (!strcmp(dev->name, "gbe0"))
info = &__get_cpu_var(hv_gbe0);
info = this_cpu_ptr(&hv_gbe0);
else if (!strcmp(dev->name, "gbe1"))
info = &__get_cpu_var(hv_gbe1);
info = this_cpu_ptr(&hv_gbe1);
else
BUG();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment