diff --git a/net/tipc/name_distr.c b/net/tipc/name_distr.c
index 7bf87cb..39fd161 100644
--- a/net/tipc/name_distr.c
+++ b/net/tipc/name_distr.c
@@ -1,6 +1,6 @@
 /*
  * net/tipc/name_distr.c: TIPC name distribution code
- * 
+ *
  * Copyright (c) 2000-2006, Ericsson AB
  * Copyright (c) 2005, Wind River Systems
  * All rights reserved.
@@ -53,15 +53,15 @@
  * @upper: name sequence upper bound
  * @ref: publishing port reference
  * @key: publication key
- * 
+ *
  * ===> All fields are stored in network byte order. <===
- * 
+ *
  * First 3 fields identify (name or) name sequence being published.
  * Reference field uniquely identifies port that published name sequence.
  * Key field uniquely identifies publication, in the event a port has
  * multiple publications of the same name sequence.
- * 
- * Note: There is no field that identifies the publishing node because it is 
+ *
+ * Note: There is no field that identifies the publishing node because it is
  * the same for all items contained within a publication message.
  */
 
@@ -74,12 +74,12 @@
 };
 
 /**
- * List of externally visible publications by this node -- 
+ * List of externally visible publications by this node --
  * that is, all publications having scope > TIPC_NODE_SCOPE.
  */
 
 static LIST_HEAD(publ_root);
-static u32 publ_cnt = 0;		
+static u32 publ_cnt = 0;
 
 /**
  * publ_to_item - add publication info to a publication message
@@ -101,12 +101,12 @@
 
 static struct sk_buff *named_prepare_buf(u32 type, u32 size, u32 dest)
 {
-	struct sk_buff *buf = buf_acquire(LONG_H_SIZE + size);  
+	struct sk_buff *buf = buf_acquire(LONG_H_SIZE + size);
 	struct tipc_msg *msg;
 
 	if (buf != NULL) {
 		msg = buf_msg(buf);
-		msg_init(msg, NAME_DISTRIBUTOR, type, TIPC_OK, 
+		msg_init(msg, NAME_DISTRIBUTOR, type, TIPC_OK,
 			 LONG_H_SIZE, dest);
 		msg_set_size(msg, LONG_H_SIZE + size);
 	}
@@ -174,7 +174,7 @@
 	u32 rest;
 	u32 max_item_buf;
 
-	read_lock_bh(&tipc_nametbl_lock); 
+	read_lock_bh(&tipc_nametbl_lock);
 	max_item_buf = TIPC_MAX_USER_MSG_SIZE / ITEM_SIZE;
 	max_item_buf *= ITEM_SIZE;
 	rest = publ_cnt * ITEM_SIZE;
@@ -183,7 +183,7 @@
 		if (!buf) {
 			left = (rest <= max_item_buf) ? rest : max_item_buf;
 			rest -= left;
-			buf = named_prepare_buf(PUBLICATION, left, node);       
+			buf = named_prepare_buf(PUBLICATION, left, node);
 			if (!buf) {
 				warn("Bulk publication distribution failure\n");
 				goto exit;
@@ -196,20 +196,20 @@
 		if (!left) {
 			msg_set_link_selector(buf_msg(buf), node);
 			dbg("tipc_named_node_up: sending publish msg to "
-			    "<%u.%u.%u>\n", tipc_zone(node), 
+			    "<%u.%u.%u>\n", tipc_zone(node),
 			    tipc_cluster(node), tipc_node(node));
 			tipc_link_send(buf, node, node);
 			buf = NULL;
 		}
 	}
 exit:
-	read_unlock_bh(&tipc_nametbl_lock); 
+	read_unlock_bh(&tipc_nametbl_lock);
 }
 
 /**
  * node_is_down - remove publication associated with a failed node
- * 
- * Invoked for each publication issued by a newly failed node.  
+ *
+ * Invoked for each publication issued by a newly failed node.
  * Removes publication structure from name table & deletes it.
  * In rare cases the link may have come back up again when this
  * function is called, and we have two items representing the same
@@ -221,15 +221,15 @@
 {
 	struct publication *p;
 
-        write_lock_bh(&tipc_nametbl_lock);
-	dbg("node_is_down: withdrawing %u, %u, %u\n", 
+	write_lock_bh(&tipc_nametbl_lock);
+	dbg("node_is_down: withdrawing %u, %u, %u\n",
 	    publ->type, publ->lower, publ->upper);
-        publ->key += 1222345;
-	p = tipc_nametbl_remove_publ(publ->type, publ->lower, 
+	publ->key += 1222345;
+	p = tipc_nametbl_remove_publ(publ->type, publ->lower,
 				     publ->node, publ->ref, publ->key);
 	write_unlock_bh(&tipc_nametbl_lock);
 
-        if (p != publ) {
+	if (p != publ) {
 		err("Unable to remove publication from failed node\n"
 		    "(type=%u, lower=%u, node=0x%x, ref=%u, key=%u)\n",
 		    publ->type, publ->lower, publ->node, publ->ref, publ->key);
@@ -251,27 +251,27 @@
 	struct distr_item *item = (struct distr_item *)msg_data(msg);
 	u32 count = msg_data_sz(msg) / ITEM_SIZE;
 
-	write_lock_bh(&tipc_nametbl_lock); 
+	write_lock_bh(&tipc_nametbl_lock);
 	while (count--) {
 		if (msg_type(msg) == PUBLICATION) {
-			dbg("tipc_named_recv: got publication for %u, %u, %u\n", 
+			dbg("tipc_named_recv: got publication for %u, %u, %u\n",
 			    ntohl(item->type), ntohl(item->lower),
 			    ntohl(item->upper));
-			publ = tipc_nametbl_insert_publ(ntohl(item->type), 
+			publ = tipc_nametbl_insert_publ(ntohl(item->type),
 							ntohl(item->lower),
 							ntohl(item->upper),
 							TIPC_CLUSTER_SCOPE,
-							msg_orignode(msg), 
+							msg_orignode(msg),
 							ntohl(item->ref),
 							ntohl(item->key));
 			if (publ) {
-				tipc_nodesub_subscribe(&publ->subscr, 
-						       msg_orignode(msg), 
+				tipc_nodesub_subscribe(&publ->subscr,
+						       msg_orignode(msg),
 						       publ,
 						       (net_ev_handler)node_is_down);
 			}
 		} else if (msg_type(msg) == WITHDRAWAL) {
-			dbg("tipc_named_recv: got withdrawl for %u, %u, %u\n", 
+			dbg("tipc_named_recv: got withdrawl for %u, %u, %u\n",
 			    ntohl(item->type), ntohl(item->lower),
 			    ntohl(item->upper));
 			publ = tipc_nametbl_remove_publ(ntohl(item->type),
@@ -282,7 +282,7 @@
 
 			if (publ) {
 				tipc_nodesub_unsubscribe(&publ->subscr);
-        			kfree(publ);
+				kfree(publ);
 			} else {
 				err("Unable to remove publication by node 0x%x\n"
 				    "(type=%u, lower=%u, ref=%u, key=%u)\n",
@@ -295,13 +295,13 @@
 		}
 		item++;
 	}
-	write_unlock_bh(&tipc_nametbl_lock); 
+	write_unlock_bh(&tipc_nametbl_lock);
 	buf_discard(buf);
 }
 
 /**
  * tipc_named_reinit - re-initialize local publication list
- * 
+ *
  * This routine is called whenever TIPC networking is (re)enabled.
  * All existing publications by this node that have "cluster" or "zone" scope
  * are updated to reflect the node's current network address.
@@ -312,11 +312,11 @@
 {
 	struct publication *publ;
 
-	write_lock_bh(&tipc_nametbl_lock); 
+	write_lock_bh(&tipc_nametbl_lock);
 	list_for_each_entry(publ, &publ_root, local_list) {
 		if (publ->node == tipc_own_addr)
 			break;
 		publ->node = tipc_own_addr;
 	}
-	write_unlock_bh(&tipc_nametbl_lock); 
+	write_unlock_bh(&tipc_nametbl_lock);
 }
