diff options
author | Christoph Lameter <cl@linux.com> | 2014-08-17 13:30:33 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2014-08-26 13:45:46 -0400 |
commit | 70b2776a5cb16c39ff5451c4eee72691734eabfc (patch) | |
tree | 6efccb2941df62c174711fb2517b8fc606a07eee /drivers/net/ethernet/tile | |
parent | 27d051677977da11dc50caeb210204b587c94eb5 (diff) |
drivers/net/ethernet/tile: Replace __get_cpu_var uses for address calculation
Replace with this_cpu_ptr.
Acked-by: Chris Metcalf <cmetcalf@tilera.com>
Signed-off-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'drivers/net/ethernet/tile')
-rw-r--r-- | drivers/net/ethernet/tile/tilegx.c | 18 | ||||
-rw-r--r-- | drivers/net/ethernet/tile/tilepro.c | 8 |
2 files changed, 13 insertions, 13 deletions
diff --git a/drivers/net/ethernet/tile/tilegx.c b/drivers/net/ethernet/tile/tilegx.c index 69557a26f749..e354742c3f59 100644 --- a/drivers/net/ethernet/tile/tilegx.c +++ b/drivers/net/ethernet/tile/tilegx.c | |||
@@ -423,7 +423,7 @@ static void tile_net_pop_all_buffers(int instance, int stack) | |||
423 | /* Provide linux buffers to mPIPE. */ | 423 | /* Provide linux buffers to mPIPE. */ |
424 | static void tile_net_provide_needed_buffers(void) | 424 | static void tile_net_provide_needed_buffers(void) |
425 | { | 425 | { |
426 | struct tile_net_info *info = &__get_cpu_var(per_cpu_info); | 426 | struct tile_net_info *info = this_cpu_ptr(&per_cpu_info); |
427 | int instance, kind; | 427 | int instance, kind; |
428 | for (instance = 0; instance < NR_MPIPE_MAX && | 428 | for (instance = 0; instance < NR_MPIPE_MAX && |
429 | info->mpipe[instance].has_iqueue; instance++) { | 429 | info->mpipe[instance].has_iqueue; instance++) { |
@@ -585,7 +585,7 @@ static void tile_net_receive_skb(struct net_device *dev, struct sk_buff *skb, | |||
585 | /* Handle a packet. Return true if "processed", false if "filtered". */ | 585 | /* Handle a packet. Return true if "processed", false if "filtered". */ |
586 | static bool tile_net_handle_packet(int instance, gxio_mpipe_idesc_t *idesc) | 586 | static bool tile_net_handle_packet(int instance, gxio_mpipe_idesc_t *idesc) |
587 | { | 587 | { |
588 | struct tile_net_info *info = &__get_cpu_var(per_cpu_info); | 588 | struct tile_net_info *info = this_cpu_ptr(&per_cpu_info); |
589 | struct mpipe_data *md = &mpipe_data[instance]; | 589 | struct mpipe_data *md = &mpipe_data[instance]; |
590 | struct net_device *dev = md->tile_net_devs_for_channel[idesc->channel]; | 590 | struct net_device *dev = md->tile_net_devs_for_channel[idesc->channel]; |
591 | uint8_t l2_offset; | 591 | uint8_t l2_offset; |
@@ -651,7 +651,7 @@ drop: | |||
651 | */ | 651 | */ |
652 | static int tile_net_poll(struct napi_struct *napi, int budget) | 652 | static int tile_net_poll(struct napi_struct *napi, int budget) |
653 | { | 653 | { |
654 | struct tile_net_info *info = &__get_cpu_var(per_cpu_info); | 654 | struct tile_net_info *info = this_cpu_ptr(&per_cpu_info); |
655 | unsigned int work = 0; | 655 | unsigned int work = 0; |
656 | gxio_mpipe_idesc_t *idesc; | 656 | gxio_mpipe_idesc_t *idesc; |
657 | int instance, i, n; | 657 | int instance, i, n; |
@@ -700,7 +700,7 @@ done: | |||
700 | /* Handle an ingress interrupt from an instance on the current cpu. */ | 700 | /* Handle an ingress interrupt from an instance on the current cpu. */ |
701 | static irqreturn_t tile_net_handle_ingress_irq(int irq, void *id) | 701 | static irqreturn_t tile_net_handle_ingress_irq(int irq, void *id) |
702 | { | 702 | { |
703 | struct tile_net_info *info = &__get_cpu_var(per_cpu_info); | 703 | struct tile_net_info *info = this_cpu_ptr(&per_cpu_info); |
704 | napi_schedule(&info->mpipe[(uint64_t)id].napi); | 704 | napi_schedule(&info->mpipe[(uint64_t)id].napi); |
705 | return IRQ_HANDLED; | 705 | return IRQ_HANDLED; |
706 | } | 706 | } |
@@ -763,7 +763,7 @@ static enum hrtimer_restart tile_net_handle_tx_wake_timer(struct hrtimer *t) | |||
763 | /* Make sure the egress timer is scheduled. */ | 763 | /* Make sure the egress timer is scheduled. */ |
764 | static void tile_net_schedule_egress_timer(void) | 764 | static void tile_net_schedule_egress_timer(void) |
765 | { | 765 | { |
766 | struct tile_net_info *info = &__get_cpu_var(per_cpu_info); | 766 | struct tile_net_info *info = this_cpu_ptr(&per_cpu_info); |
767 | 767 | ||
768 | if (!info->egress_timer_scheduled) { | 768 | if (!info->egress_timer_scheduled) { |
769 | hrtimer_start(&info->egress_timer, | 769 | hrtimer_start(&info->egress_timer, |
@@ -780,7 +780,7 @@ static void tile_net_schedule_egress_timer(void) | |||
780 | */ | 780 | */ |
781 | static enum hrtimer_restart tile_net_handle_egress_timer(struct hrtimer *t) | 781 | static enum hrtimer_restart tile_net_handle_egress_timer(struct hrtimer *t) |
782 | { | 782 | { |
783 | struct tile_net_info *info = &__get_cpu_var(per_cpu_info); | 783 | struct tile_net_info *info = this_cpu_ptr(&per_cpu_info); |
784 | unsigned long irqflags; | 784 | unsigned long irqflags; |
785 | bool pending = false; | 785 | bool pending = false; |
786 | int i, instance; | 786 | int i, instance; |
@@ -1996,7 +1996,7 @@ static unsigned int tile_net_tx_frags(struct frag *frags, | |||
1996 | /* Help the kernel transmit a packet. */ | 1996 | /* Help the kernel transmit a packet. */ |
1997 | static int tile_net_tx(struct sk_buff *skb, struct net_device *dev) | 1997 | static int tile_net_tx(struct sk_buff *skb, struct net_device *dev) |
1998 | { | 1998 | { |
1999 | struct tile_net_info *info = &__get_cpu_var(per_cpu_info); | 1999 | struct tile_net_info *info = this_cpu_ptr(&per_cpu_info); |
2000 | struct tile_net_priv *priv = netdev_priv(dev); | 2000 | struct tile_net_priv *priv = netdev_priv(dev); |
2001 | int instance = priv->instance; | 2001 | int instance = priv->instance; |
2002 | struct mpipe_data *md = &mpipe_data[instance]; | 2002 | struct mpipe_data *md = &mpipe_data[instance]; |
@@ -2138,7 +2138,7 @@ static int tile_net_set_mac_address(struct net_device *dev, void *p) | |||
2138 | static void tile_net_netpoll(struct net_device *dev) | 2138 | static void tile_net_netpoll(struct net_device *dev) |
2139 | { | 2139 | { |
2140 | int instance = mpipe_instance(dev); | 2140 | int instance = mpipe_instance(dev); |
2141 | struct tile_net_info *info = &__get_cpu_var(per_cpu_info); | 2141 | struct tile_net_info *info = this_cpu_ptr(&per_cpu_info); |
2142 | struct mpipe_data *md = &mpipe_data[instance]; | 2142 | struct mpipe_data *md = &mpipe_data[instance]; |
2143 | 2143 | ||
2144 | disable_percpu_irq(md->ingress_irq); | 2144 | disable_percpu_irq(md->ingress_irq); |
@@ -2237,7 +2237,7 @@ static void tile_net_dev_init(const char *name, const uint8_t *mac) | |||
2237 | /* Per-cpu module initialization. */ | 2237 | /* Per-cpu module initialization. */ |
2238 | static void tile_net_init_module_percpu(void *unused) | 2238 | static void tile_net_init_module_percpu(void *unused) |
2239 | { | 2239 | { |
2240 | struct tile_net_info *info = &__get_cpu_var(per_cpu_info); | 2240 | struct tile_net_info *info = this_cpu_ptr(&per_cpu_info); |
2241 | int my_cpu = smp_processor_id(); | 2241 | int my_cpu = smp_processor_id(); |
2242 | int instance; | 2242 | int instance; |
2243 | 2243 | ||
diff --git a/drivers/net/ethernet/tile/tilepro.c b/drivers/net/ethernet/tile/tilepro.c index 88c712126692..3faf03fce827 100644 --- a/drivers/net/ethernet/tile/tilepro.c +++ b/drivers/net/ethernet/tile/tilepro.c | |||
@@ -996,13 +996,13 @@ static void tile_net_register(void *dev_ptr) | |||
996 | PDEBUG("tile_net_register(queue_id %d)\n", queue_id); | 996 | PDEBUG("tile_net_register(queue_id %d)\n", queue_id); |
997 | 997 | ||
998 | if (!strcmp(dev->name, "xgbe0")) | 998 | if (!strcmp(dev->name, "xgbe0")) |
999 | info = &__get_cpu_var(hv_xgbe0); | 999 | info = this_cpu_ptr(&hv_xgbe0); |
1000 | else if (!strcmp(dev->name, "xgbe1")) | 1000 | else if (!strcmp(dev->name, "xgbe1")) |
1001 | info = &__get_cpu_var(hv_xgbe1); | 1001 | info = this_cpu_ptr(&hv_xgbe1); |
1002 | else if (!strcmp(dev->name, "gbe0")) | 1002 | else if (!strcmp(dev->name, "gbe0")) |
1003 | info = &__get_cpu_var(hv_gbe0); | 1003 | info = this_cpu_ptr(&hv_gbe0); |
1004 | else if (!strcmp(dev->name, "gbe1")) | 1004 | else if (!strcmp(dev->name, "gbe1")) |
1005 | info = &__get_cpu_var(hv_gbe1); | 1005 | info = this_cpu_ptr(&hv_gbe1); |
1006 | else | 1006 | else |
1007 | BUG(); | 1007 | BUG(); |
1008 | 1008 | ||