aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/sgi-xp/xpnet.c
diff options
context:
space:
mode:
authorDean Nelson <dcn@sgi.com>2008-04-22 15:50:17 -0400
committerTony Luck <tony.luck@intel.com>2008-04-22 18:08:55 -0400
commit2c2b94f93f4732c3b9703ce62627e6187e7d6128 (patch)
tree47fbdee38bc7cf0eec8c7c254a6c1c045ebbdb7e /drivers/misc/sgi-xp/xpnet.c
parent35190506b1a18eda7df24b285fdcd94dec7800ef (diff)
[IA64] run drivers/misc/sgi-xp through scripts/checkpatch.pl
Addressed issues raised by scripts/checkpatch.pl. Removed unnecessary curly braces. Eliminated uses of volatiles and use of kernel_thread() and daemonize(). Signed-off-by: Dean Nelson <dcn@sgi.com> Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'drivers/misc/sgi-xp/xpnet.c')
-rw-r--r--drivers/misc/sgi-xp/xpnet.c30
1 files changed, 13 insertions, 17 deletions
diff --git a/drivers/misc/sgi-xp/xpnet.c b/drivers/misc/sgi-xp/xpnet.c
index e41cb93b8c89..a9543c65814d 100644
--- a/drivers/misc/sgi-xp/xpnet.c
+++ b/drivers/misc/sgi-xp/xpnet.c
@@ -21,6 +21,7 @@
21 */ 21 */
22 22
23#include <linux/module.h> 23#include <linux/module.h>
24#include <linux/types.h>
24#include <linux/kernel.h> 25#include <linux/kernel.h>
25#include <linux/init.h> 26#include <linux/init.h>
26#include <linux/ioport.h> 27#include <linux/ioport.h>
@@ -34,7 +35,6 @@
34#include <asm/sn/bte.h> 35#include <asm/sn/bte.h>
35#include <asm/sn/io.h> 36#include <asm/sn/io.h>
36#include <asm/sn/sn_sal.h> 37#include <asm/sn/sn_sal.h>
37#include <asm/types.h>
38#include <asm/atomic.h> 38#include <asm/atomic.h>
39#include "xp.h" 39#include "xp.h"
40 40
@@ -87,8 +87,8 @@ struct xpnet_message {
87#define XPNET_VERSION_MAJOR(_v) ((_v) >> 4) 87#define XPNET_VERSION_MAJOR(_v) ((_v) >> 4)
88#define XPNET_VERSION_MINOR(_v) ((_v) & 0xf) 88#define XPNET_VERSION_MINOR(_v) ((_v) & 0xf)
89 89
90#define XPNET_VERSION _XPNET_VERSION(1,0) /* version 1.0 */ 90#define XPNET_VERSION _XPNET_VERSION(1, 0) /* version 1.0 */
91#define XPNET_VERSION_EMBED _XPNET_VERSION(1,1) /* version 1.1 */ 91#define XPNET_VERSION_EMBED _XPNET_VERSION(1, 1) /* version 1.1 */
92#define XPNET_MAGIC 0x88786984 /* "XNET" */ 92#define XPNET_MAGIC 0x88786984 /* "XNET" */
93 93
94#define XPNET_VALID_MSG(_m) \ 94#define XPNET_VALID_MSG(_m) \
@@ -236,9 +236,11 @@ xpnet_receive(partid_t partid, int channel, struct xpnet_message *msg)
236 msg->size, (BTE_NOTIFY | BTE_WACQUIRE), NULL); 236 msg->size, (BTE_NOTIFY | BTE_WACQUIRE), NULL);
237 237
238 if (bret != BTE_SUCCESS) { 238 if (bret != BTE_SUCCESS) {
239 // >>> Need better way of cleaning skb. Currently skb 239 /*
240 // >>> appears in_use and we can't just call 240 * >>> Need better way of cleaning skb. Currently skb
241 // >>> dev_kfree_skb. 241 * >>> appears in_use and we can't just call
242 * >>> dev_kfree_skb.
243 */
242 dev_err(xpnet, "bte_copy(0x%p, 0x%p, 0x%hx) returned " 244 dev_err(xpnet, "bte_copy(0x%p, 0x%p, 0x%hx) returned "
243 "error=0x%x\n", (void *)msg->buf_pa, 245 "error=0x%x\n", (void *)msg->buf_pa,
244 (void *)__pa((u64)skb->data & 246 (void *)__pa((u64)skb->data &
@@ -314,9 +316,8 @@ xpnet_connection_activity(enum xpc_retval reason, partid_t partid, int channel,
314 bp = xpnet_broadcast_partitions; 316 bp = xpnet_broadcast_partitions;
315 spin_unlock_bh(&xpnet_broadcast_lock); 317 spin_unlock_bh(&xpnet_broadcast_lock);
316 318
317 if (bp == 0) { 319 if (bp == 0)
318 netif_carrier_off(xpnet_device); 320 netif_carrier_off(xpnet_device);
319 }
320 321
321 dev_dbg(xpnet, "%s disconnected from partition %d; " 322 dev_dbg(xpnet, "%s disconnected from partition %d; "
322 "xpnet_broadcast_partitions=0x%lx\n", 323 "xpnet_broadcast_partitions=0x%lx\n",
@@ -527,9 +528,8 @@ xpnet_dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
527 528
528 ret = xpc_allocate(dest_partid, XPC_NET_CHANNEL, 529 ret = xpc_allocate(dest_partid, XPC_NET_CHANNEL,
529 XPC_NOWAIT, (void **)&msg); 530 XPC_NOWAIT, (void **)&msg);
530 if (unlikely(ret != xpcSuccess)) { 531 if (unlikely(ret != xpcSuccess))
531 continue; 532 continue;
532 }
533 533
534 msg->embedded_bytes = embedded_bytes; 534 msg->embedded_bytes = embedded_bytes;
535 if (unlikely(embedded_bytes != 0)) { 535 if (unlikely(embedded_bytes != 0)) {
@@ -561,7 +561,6 @@ xpnet_dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
561 atomic_dec(&queued_msg->use_count); 561 atomic_dec(&queued_msg->use_count);
562 continue; 562 continue;
563 } 563 }
564
565 } 564 }
566 565
567 if (atomic_dec_return(&queued_msg->use_count) == 0) { 566 if (atomic_dec_return(&queued_msg->use_count) == 0) {
@@ -599,9 +598,8 @@ xpnet_init(void)
599 u32 license_num; 598 u32 license_num;
600 int result = -ENOMEM; 599 int result = -ENOMEM;
601 600
602 if (!ia64_platform_is("sn2")) { 601 if (!ia64_platform_is("sn2"))
603 return -ENODEV; 602 return -ENODEV;
604 }
605 603
606 dev_info(xpnet, "registering network device %s\n", XPNET_DEVICE_NAME); 604 dev_info(xpnet, "registering network device %s\n", XPNET_DEVICE_NAME);
607 605
@@ -611,9 +609,8 @@ xpnet_init(void)
611 */ 609 */
612 xpnet_device = alloc_netdev(sizeof(struct xpnet_dev_private), 610 xpnet_device = alloc_netdev(sizeof(struct xpnet_dev_private),
613 XPNET_DEVICE_NAME, ether_setup); 611 XPNET_DEVICE_NAME, ether_setup);
614 if (xpnet_device == NULL) { 612 if (xpnet_device == NULL)
615 return -ENOMEM; 613 return -ENOMEM;
616 }
617 614
618 netif_carrier_off(xpnet_device); 615 netif_carrier_off(xpnet_device);
619 616
@@ -654,9 +651,8 @@ xpnet_init(void)
654 xpnet_device->features = NETIF_F_NO_CSUM; 651 xpnet_device->features = NETIF_F_NO_CSUM;
655 652
656 result = register_netdev(xpnet_device); 653 result = register_netdev(xpnet_device);
657 if (result != 0) { 654 if (result != 0)
658 free_netdev(xpnet_device); 655 free_netdev(xpnet_device);
659 }
660 656
661 return result; 657 return result;
662} 658}