Commit a4aee5c8 authored by Joe Perches's avatar Joe Perches Committed by David S. Miller

drivers/net/bonding/: : use pr_fmt

Add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
Remove DRV_NAME from pr_<level>s
Consolidate long format strings
Remove some extra tab indents
Remove some unnecessary ()s from pr_<level>s arguments
Align pr_<level> arguments
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 231d52a7
This diff is collapsed.
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
* *
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/skbuff.h> #include <linux/skbuff.h>
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <linux/etherdevice.h> #include <linux/etherdevice.h>
...@@ -201,8 +203,7 @@ static int tlb_initialize(struct bonding *bond) ...@@ -201,8 +203,7 @@ static int tlb_initialize(struct bonding *bond)
new_hashtbl = kzalloc(size, GFP_KERNEL); new_hashtbl = kzalloc(size, GFP_KERNEL);
if (!new_hashtbl) { if (!new_hashtbl) {
pr_err(DRV_NAME pr_err("%s: Error: Failed to allocate TLB hash table\n",
": %s: Error: Failed to allocate TLB hash table\n",
bond->dev->name); bond->dev->name);
return -1; return -1;
} }
...@@ -514,8 +515,7 @@ static void rlb_update_client(struct rlb_client_info *client_info) ...@@ -514,8 +515,7 @@ static void rlb_update_client(struct rlb_client_info *client_info)
client_info->slave->dev->dev_addr, client_info->slave->dev->dev_addr,
client_info->mac_dst); client_info->mac_dst);
if (!skb) { if (!skb) {
pr_err(DRV_NAME pr_err("%s: Error: failed to create an ARP packet\n",
": %s: Error: failed to create an ARP packet\n",
client_info->slave->dev->master->name); client_info->slave->dev->master->name);
continue; continue;
} }
...@@ -525,8 +525,7 @@ static void rlb_update_client(struct rlb_client_info *client_info) ...@@ -525,8 +525,7 @@ static void rlb_update_client(struct rlb_client_info *client_info)
if (client_info->tag) { if (client_info->tag) {
skb = vlan_put_tag(skb, client_info->vlan_id); skb = vlan_put_tag(skb, client_info->vlan_id);
if (!skb) { if (!skb) {
pr_err(DRV_NAME pr_err("%s: Error: failed to insert VLAN tag\n",
": %s: Error: failed to insert VLAN tag\n",
client_info->slave->dev->master->name); client_info->slave->dev->master->name);
continue; continue;
} }
...@@ -609,9 +608,7 @@ static void rlb_req_update_subnet_clients(struct bonding *bond, __be32 src_ip) ...@@ -609,9 +608,7 @@ static void rlb_req_update_subnet_clients(struct bonding *bond, __be32 src_ip)
client_info = &(bond_info->rx_hashtbl[hash_index]); client_info = &(bond_info->rx_hashtbl[hash_index]);
if (!client_info->slave) { if (!client_info->slave) {
pr_err(DRV_NAME pr_err("%s: Error: found a client with no channel in the client's hash table\n",
": %s: Error: found a client with no channel in "
"the client's hash table\n",
bond->dev->name); bond->dev->name);
continue; continue;
} }
...@@ -806,8 +803,7 @@ static int rlb_initialize(struct bonding *bond) ...@@ -806,8 +803,7 @@ static int rlb_initialize(struct bonding *bond)
new_hashtbl = kmalloc(size, GFP_KERNEL); new_hashtbl = kmalloc(size, GFP_KERNEL);
if (!new_hashtbl) { if (!new_hashtbl) {
pr_err(DRV_NAME pr_err("%s: Error: Failed to allocate RLB hash table\n",
": %s: Error: Failed to allocate RLB hash table\n",
bond->dev->name); bond->dev->name);
return -1; return -1;
} }
...@@ -928,8 +924,7 @@ static void alb_send_learning_packets(struct slave *slave, u8 mac_addr[]) ...@@ -928,8 +924,7 @@ static void alb_send_learning_packets(struct slave *slave, u8 mac_addr[])
skb = vlan_put_tag(skb, vlan->vlan_id); skb = vlan_put_tag(skb, vlan->vlan_id);
if (!skb) { if (!skb) {
pr_err(DRV_NAME pr_err("%s: Error: failed to insert VLAN tag\n",
": %s: Error: failed to insert VLAN tag\n",
bond->dev->name); bond->dev->name);
continue; continue;
} }
...@@ -958,11 +953,8 @@ static int alb_set_slave_mac_addr(struct slave *slave, u8 addr[], int hw) ...@@ -958,11 +953,8 @@ static int alb_set_slave_mac_addr(struct slave *slave, u8 addr[], int hw)
memcpy(s_addr.sa_data, addr, dev->addr_len); memcpy(s_addr.sa_data, addr, dev->addr_len);
s_addr.sa_family = dev->type; s_addr.sa_family = dev->type;
if (dev_set_mac_address(dev, &s_addr)) { if (dev_set_mac_address(dev, &s_addr)) {
pr_err(DRV_NAME pr_err("%s: Error: dev_set_mac_address of dev %s failed!\n"
": %s: Error: dev_set_mac_address of dev %s failed! ALB " "ALB mode requires that the base driver support setting the hw address also when the network device's interface is open\n",
"mode requires that the base driver support setting "
"the hw address also when the network device's "
"interface is open\n",
dev->master->name, dev->name); dev->master->name, dev->name);
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
...@@ -1169,18 +1161,12 @@ static int alb_handle_addr_collision_on_attach(struct bonding *bond, struct slav ...@@ -1169,18 +1161,12 @@ static int alb_handle_addr_collision_on_attach(struct bonding *bond, struct slav
alb_set_slave_mac_addr(slave, free_mac_slave->perm_hwaddr, alb_set_slave_mac_addr(slave, free_mac_slave->perm_hwaddr,
bond->alb_info.rlb_enabled); bond->alb_info.rlb_enabled);
pr_warning(DRV_NAME pr_warning("%s: Warning: the hw address of slave %s is in use by the bond; giving it the hw address of %s\n",
": %s: Warning: the hw address of slave %s is "
"in use by the bond; giving it the hw address "
"of %s\n",
bond->dev->name, slave->dev->name, bond->dev->name, slave->dev->name,
free_mac_slave->dev->name); free_mac_slave->dev->name);
} else if (has_bond_addr) { } else if (has_bond_addr) {
pr_err(DRV_NAME pr_err("%s: Error: the hw address of slave %s is in use by the bond; couldn't find a slave with a free hw address to give it (this should not have happened)\n",
": %s: Error: the hw address of slave %s is in use by the "
"bond; couldn't find a slave with a free hw address to "
"give it (this should not have happened)\n",
bond->dev->name, slave->dev->name); bond->dev->name, slave->dev->name);
return -EFAULT; return -EFAULT;
} }
......
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
* *
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/types.h> #include <linux/types.h>
#include <linux/if_vlan.h> #include <linux/if_vlan.h>
#include <net/ipv6.h> #include <net/ipv6.h>
...@@ -74,20 +76,20 @@ static void bond_na_send(struct net_device *slave_dev, ...@@ -74,20 +76,20 @@ static void bond_na_send(struct net_device *slave_dev,
addrconf_addr_solict_mult(daddr, &mcaddr); addrconf_addr_solict_mult(daddr, &mcaddr);
pr_debug("ipv6 na on slave %s: dest %pI6, src %pI6\n", pr_debug("ipv6 na on slave %s: dest %pI6, src %pI6\n",
slave_dev->name, &mcaddr, daddr); slave_dev->name, &mcaddr, daddr);
skb = ndisc_build_skb(slave_dev, &mcaddr, daddr, &icmp6h, daddr, skb = ndisc_build_skb(slave_dev, &mcaddr, daddr, &icmp6h, daddr,
ND_OPT_TARGET_LL_ADDR); ND_OPT_TARGET_LL_ADDR);
if (!skb) { if (!skb) {
pr_err(DRV_NAME ": NA packet allocation failed\n"); pr_err("NA packet allocation failed\n");
return; return;
} }
if (vlan_id) { if (vlan_id) {
skb = vlan_put_tag(skb, vlan_id); skb = vlan_put_tag(skb, vlan_id);
if (!skb) { if (!skb) {
pr_err(DRV_NAME ": failed to insert VLAN tag\n"); pr_err("failed to insert VLAN tag\n");
return; return;
} }
} }
...@@ -109,8 +111,8 @@ void bond_send_unsolicited_na(struct bonding *bond) ...@@ -109,8 +111,8 @@ void bond_send_unsolicited_na(struct bonding *bond)
struct inet6_dev *idev; struct inet6_dev *idev;
int is_router; int is_router;
pr_debug("bond_send_unsol_na: bond %s slave %s\n", bond->dev->name, pr_debug("%s: bond %s slave %s\n", bond->dev->name,
slave ? slave->dev->name : "NULL"); __func__, slave ? slave->dev->name : "NULL");
if (!slave || !bond->send_unsol_na || if (!slave || !bond->send_unsol_na ||
test_bit(__LINK_STATE_LINKWATCH_PENDING, &slave->dev->state)) test_bit(__LINK_STATE_LINKWATCH_PENDING, &slave->dev->state))
......
This diff is collapsed.
This diff is collapsed.
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