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

bonding: Convert pr_warning to pr_warn, neatening

Use more current logging style.

Coalesce formats, realign arguments, drop unnecessary periods.
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 327cdeda
...@@ -1243,7 +1243,7 @@ static int alb_handle_addr_collision_on_attach(struct bonding *bond, struct slav ...@@ -1243,7 +1243,7 @@ static int alb_handle_addr_collision_on_attach(struct bonding *bond, struct slav
if (free_mac_slave) { if (free_mac_slave) {
alb_set_slave_mac_addr(slave, free_mac_slave->perm_hwaddr); alb_set_slave_mac_addr(slave, free_mac_slave->perm_hwaddr);
pr_warning("%s: Warning: the hw address of slave %s is in use by the bond; giving it the hw address of %s\n", pr_warn("%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);
......
...@@ -69,7 +69,7 @@ void bond_debug_register(struct bonding *bond) ...@@ -69,7 +69,7 @@ void bond_debug_register(struct bonding *bond)
debugfs_create_dir(bond->dev->name, bonding_debug_root); debugfs_create_dir(bond->dev->name, bonding_debug_root);
if (!bond->debug_dir) { if (!bond->debug_dir) {
pr_warning("%s: Warning: failed to register to debugfs\n", pr_warn("%s: Warning: failed to register to debugfs\n",
bond->dev->name); bond->dev->name);
return; return;
} }
...@@ -98,8 +98,7 @@ void bond_debug_reregister(struct bonding *bond) ...@@ -98,8 +98,7 @@ void bond_debug_reregister(struct bonding *bond)
if (d) { if (d) {
bond->debug_dir = d; bond->debug_dir = d;
} else { } else {
pr_warning("%s: Warning: failed to reregister, " pr_warn("%s: Warning: failed to reregister, so just unregister old one\n",
"so just unregister old one\n",
bond->dev->name); bond->dev->name);
bond_debug_unregister(bond); bond_debug_unregister(bond);
} }
...@@ -110,8 +109,7 @@ void bond_create_debugfs(void) ...@@ -110,8 +109,7 @@ void bond_create_debugfs(void)
bonding_debug_root = debugfs_create_dir("bonding", NULL); bonding_debug_root = debugfs_create_dir("bonding", NULL);
if (!bonding_debug_root) { if (!bonding_debug_root) {
pr_warning("Warning: Cannot create bonding directory" pr_warn("Warning: Cannot create bonding directory in debugfs\n");
" in debugfs\n");
} }
} }
......
...@@ -1183,7 +1183,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) ...@@ -1183,7 +1183,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
if (!bond->params.use_carrier && if (!bond->params.use_carrier &&
slave_dev->ethtool_ops->get_link == NULL && slave_dev->ethtool_ops->get_link == NULL &&
slave_ops->ndo_do_ioctl == NULL) { slave_ops->ndo_do_ioctl == NULL) {
pr_warning("%s: Warning: no link monitoring support for %s\n", pr_warn("%s: Warning: no link monitoring support for %s\n",
bond_dev->name, slave_dev->name); bond_dev->name, slave_dev->name);
} }
...@@ -1202,7 +1202,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) ...@@ -1202,7 +1202,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
bond_dev->name, slave_dev->name, bond_dev->name); bond_dev->name, slave_dev->name, bond_dev->name);
return -EPERM; return -EPERM;
} else { } else {
pr_warning("%s: Warning: enslaved VLAN challenged slave %s. Adding VLANs will be blocked as long as %s is part of bond %s\n", pr_warn("%s: Warning: enslaved VLAN challenged slave %s. Adding VLANs will be blocked as long as %s is part of bond %s\n",
bond_dev->name, slave_dev->name, bond_dev->name, slave_dev->name,
slave_dev->name, bond_dev->name); slave_dev->name, bond_dev->name);
} }
...@@ -1419,11 +1419,11 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) ...@@ -1419,11 +1419,11 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
* supported); thus, we don't need to change * supported); thus, we don't need to change
* the messages for netif_carrier. * the messages for netif_carrier.
*/ */
pr_warning("%s: Warning: MII and ETHTOOL support not available for interface %s, and arp_interval/arp_ip_target module parameters not specified, thus bonding will not detect link failures! see bonding.txt for details.\n", pr_warn("%s: Warning: MII and ETHTOOL support not available for interface %s, and arp_interval/arp_ip_target module parameters not specified, thus bonding will not detect link failures! see bonding.txt for details\n",
bond_dev->name, slave_dev->name); bond_dev->name, slave_dev->name);
} else if (link_reporting == -1) { } else if (link_reporting == -1) {
/* unable get link status using mii/ethtool */ /* unable get link status using mii/ethtool */
pr_warning("%s: Warning: can't get link status from interface %s; the network driver associated with this interface does not support MII or ETHTOOL link status reporting, thus miimon has no effect on this interface.\n", pr_warn("%s: Warning: can't get link status from interface %s; the network driver associated with this interface does not support MII or ETHTOOL link status reporting, thus miimon has no effect on this interface\n",
bond_dev->name, slave_dev->name); bond_dev->name, slave_dev->name);
} }
} }
...@@ -1725,9 +1725,9 @@ static int __bond_release_one(struct net_device *bond_dev, ...@@ -1725,9 +1725,9 @@ static int __bond_release_one(struct net_device *bond_dev,
eth_hw_addr_random(bond_dev); eth_hw_addr_random(bond_dev);
if (vlan_uses_dev(bond_dev)) { if (vlan_uses_dev(bond_dev)) {
pr_warning("%s: Warning: clearing HW address of %s while it still has VLANs.\n", pr_warn("%s: Warning: clearing HW address of %s while it still has VLANs\n",
bond_dev->name, bond_dev->name); bond_dev->name, bond_dev->name);
pr_warning("%s: When re-adding slaves, make sure the bond's HW address matches its VLANs'.\n", pr_warn("%s: When re-adding slaves, make sure the bond's HW address matches its VLANs\n",
bond_dev->name); bond_dev->name);
} }
} }
...@@ -4046,43 +4046,43 @@ static int bond_check_params(struct bond_params *params) ...@@ -4046,43 +4046,43 @@ static int bond_check_params(struct bond_params *params)
} }
params->ad_select = valptr->value; params->ad_select = valptr->value;
if (bond_mode != BOND_MODE_8023AD) if (bond_mode != BOND_MODE_8023AD)
pr_warning("ad_select param only affects 802.3ad mode\n"); pr_warn("ad_select param only affects 802.3ad mode\n");
} else { } else {
params->ad_select = BOND_AD_STABLE; params->ad_select = BOND_AD_STABLE;
} }
if (max_bonds < 0) { if (max_bonds < 0) {
pr_warning("Warning: max_bonds (%d) not in range %d-%d, so it was reset to BOND_DEFAULT_MAX_BONDS (%d)\n", pr_warn("Warning: max_bonds (%d) not in range %d-%d, so it was reset to BOND_DEFAULT_MAX_BONDS (%d)\n",
max_bonds, 0, INT_MAX, BOND_DEFAULT_MAX_BONDS); max_bonds, 0, INT_MAX, BOND_DEFAULT_MAX_BONDS);
max_bonds = BOND_DEFAULT_MAX_BONDS; max_bonds = BOND_DEFAULT_MAX_BONDS;
} }
if (miimon < 0) { if (miimon < 0) {
pr_warning("Warning: miimon module parameter (%d), not in range 0-%d, so it was reset to 0\n", pr_warn("Warning: miimon module parameter (%d), not in range 0-%d, so it was reset to 0\n",
miimon, INT_MAX); miimon, INT_MAX);
miimon = 0; miimon = 0;
} }
if (updelay < 0) { if (updelay < 0) {
pr_warning("Warning: updelay module parameter (%d), not in range 0-%d, so it was reset to 0\n", pr_warn("Warning: updelay module parameter (%d), not in range 0-%d, so it was reset to 0\n",
updelay, INT_MAX); updelay, INT_MAX);
updelay = 0; updelay = 0;
} }
if (downdelay < 0) { if (downdelay < 0) {
pr_warning("Warning: downdelay module parameter (%d), not in range 0-%d, so it was reset to 0\n", pr_warn("Warning: downdelay module parameter (%d), not in range 0-%d, so it was reset to 0\n",
downdelay, INT_MAX); downdelay, INT_MAX);
downdelay = 0; downdelay = 0;
} }
if ((use_carrier != 0) && (use_carrier != 1)) { if ((use_carrier != 0) && (use_carrier != 1)) {
pr_warning("Warning: use_carrier module parameter (%d), not of valid value (0/1), so it was set to 1\n", pr_warn("Warning: use_carrier module parameter (%d), not of valid value (0/1), so it was set to 1\n",
use_carrier); use_carrier);
use_carrier = 1; use_carrier = 1;
} }
if (num_peer_notif < 0 || num_peer_notif > 255) { if (num_peer_notif < 0 || num_peer_notif > 255) {
pr_warning("Warning: num_grat_arp/num_unsol_na (%d) not in range 0-255 so it was reset to 1\n", pr_warn("Warning: num_grat_arp/num_unsol_na (%d) not in range 0-255 so it was reset to 1\n",
num_peer_notif); num_peer_notif);
num_peer_notif = 1; num_peer_notif = 1;
} }
...@@ -4090,29 +4090,26 @@ static int bond_check_params(struct bond_params *params) ...@@ -4090,29 +4090,26 @@ static int bond_check_params(struct bond_params *params)
/* reset values for 802.3ad/TLB/ALB */ /* reset values for 802.3ad/TLB/ALB */
if (BOND_NO_USES_ARP(bond_mode)) { if (BOND_NO_USES_ARP(bond_mode)) {
if (!miimon) { if (!miimon) {
pr_warning("Warning: miimon must be specified, otherwise bonding will not detect link failure, speed and duplex which are essential for 802.3ad operation\n"); pr_warn("Warning: miimon must be specified, otherwise bonding will not detect link failure, speed and duplex which are essential for 802.3ad operation\n");
pr_warning("Forcing miimon to 100msec\n"); pr_warn("Forcing miimon to 100msec\n");
miimon = BOND_DEFAULT_MIIMON; miimon = BOND_DEFAULT_MIIMON;
} }
} }
if (tx_queues < 1 || tx_queues > 255) { if (tx_queues < 1 || tx_queues > 255) {
pr_warning("Warning: tx_queues (%d) should be between " pr_warn("Warning: tx_queues (%d) should be between 1 and 255, resetting to %d\n",
"1 and 255, resetting to %d\n",
tx_queues, BOND_DEFAULT_TX_QUEUES); tx_queues, BOND_DEFAULT_TX_QUEUES);
tx_queues = BOND_DEFAULT_TX_QUEUES; tx_queues = BOND_DEFAULT_TX_QUEUES;
} }
if ((all_slaves_active != 0) && (all_slaves_active != 1)) { if ((all_slaves_active != 0) && (all_slaves_active != 1)) {
pr_warning("Warning: all_slaves_active module parameter (%d), " pr_warn("Warning: all_slaves_active module parameter (%d), not of valid value (0/1), so it was set to 0\n",
"not of valid value (0/1), so it was set to " all_slaves_active);
"0\n", all_slaves_active);
all_slaves_active = 0; all_slaves_active = 0;
} }
if (resend_igmp < 0 || resend_igmp > 255) { if (resend_igmp < 0 || resend_igmp > 255) {
pr_warning("Warning: resend_igmp (%d) should be between " pr_warn("Warning: resend_igmp (%d) should be between 0 and 255, resetting to %d\n",
"0 and 255, resetting to %d\n",
resend_igmp, BOND_DEFAULT_RESEND_IGMP); resend_igmp, BOND_DEFAULT_RESEND_IGMP);
resend_igmp = BOND_DEFAULT_RESEND_IGMP; resend_igmp = BOND_DEFAULT_RESEND_IGMP;
} }
...@@ -4134,27 +4131,26 @@ static int bond_check_params(struct bond_params *params) ...@@ -4134,27 +4131,26 @@ static int bond_check_params(struct bond_params *params)
/* just warn the user the up/down delay will have /* just warn the user the up/down delay will have
* no effect since miimon is zero... * no effect since miimon is zero...
*/ */
pr_warning("Warning: miimon module parameter not set and updelay (%d) or downdelay (%d) module parameter is set; updelay and downdelay have no effect unless miimon is set\n", pr_warn("Warning: miimon module parameter not set and updelay (%d) or downdelay (%d) module parameter is set; updelay and downdelay have no effect unless miimon is set\n",
updelay, downdelay); updelay, downdelay);
} }
} else { } else {
/* don't allow arp monitoring */ /* don't allow arp monitoring */
if (arp_interval) { if (arp_interval) {
pr_warning("Warning: miimon (%d) and arp_interval (%d) can't be used simultaneously, disabling ARP monitoring\n", pr_warn("Warning: miimon (%d) and arp_interval (%d) can't be used simultaneously, disabling ARP monitoring\n",
miimon, arp_interval); miimon, arp_interval);
arp_interval = 0; arp_interval = 0;
} }
if ((updelay % miimon) != 0) { if ((updelay % miimon) != 0) {
pr_warning("Warning: updelay (%d) is not a multiple of miimon (%d), updelay rounded to %d ms\n", pr_warn("Warning: updelay (%d) is not a multiple of miimon (%d), updelay rounded to %d ms\n",
updelay, miimon, updelay, miimon, (updelay / miimon) * miimon);
(updelay / miimon) * miimon);
} }
updelay /= miimon; updelay /= miimon;
if ((downdelay % miimon) != 0) { if ((downdelay % miimon) != 0) {
pr_warning("Warning: downdelay (%d) is not a multiple of miimon (%d), downdelay rounded to %d ms\n", pr_warn("Warning: downdelay (%d) is not a multiple of miimon (%d), downdelay rounded to %d ms\n",
downdelay, miimon, downdelay, miimon,
(downdelay / miimon) * miimon); (downdelay / miimon) * miimon);
} }
...@@ -4163,7 +4159,7 @@ static int bond_check_params(struct bond_params *params) ...@@ -4163,7 +4159,7 @@ static int bond_check_params(struct bond_params *params)
} }
if (arp_interval < 0) { if (arp_interval < 0) {
pr_warning("Warning: arp_interval module parameter (%d) , not in range 0-%d, so it was reset to 0\n", pr_warn("Warning: arp_interval module parameter (%d), not in range 0-%d, so it was reset to 0\n",
arp_interval, INT_MAX); arp_interval, INT_MAX);
arp_interval = 0; arp_interval = 0;
} }
...@@ -4175,21 +4171,21 @@ static int bond_check_params(struct bond_params *params) ...@@ -4175,21 +4171,21 @@ static int bond_check_params(struct bond_params *params)
__be32 ip; __be32 ip;
if (!in4_pton(arp_ip_target[i], -1, (u8 *)&ip, -1, NULL) || if (!in4_pton(arp_ip_target[i], -1, (u8 *)&ip, -1, NULL) ||
IS_IP_TARGET_UNUSABLE_ADDRESS(ip)) { IS_IP_TARGET_UNUSABLE_ADDRESS(ip)) {
pr_warning("Warning: bad arp_ip_target module parameter (%s), ARP monitoring will not be performed\n", pr_warn("Warning: bad arp_ip_target module parameter (%s), ARP monitoring will not be performed\n",
arp_ip_target[i]); arp_ip_target[i]);
arp_interval = 0; arp_interval = 0;
} else { } else {
if (bond_get_targets_ip(arp_target, ip) == -1) if (bond_get_targets_ip(arp_target, ip) == -1)
arp_target[arp_ip_count++] = ip; arp_target[arp_ip_count++] = ip;
else else
pr_warning("Warning: duplicate address %pI4 in arp_ip_target, skipping\n", pr_warn("Warning: duplicate address %pI4 in arp_ip_target, skipping\n",
&ip); &ip);
} }
} }
if (arp_interval && !arp_ip_count) { if (arp_interval && !arp_ip_count) {
/* don't allow arping if no arp_ip_target given... */ /* don't allow arping if no arp_ip_target given... */
pr_warning("Warning: arp_interval module parameter (%d) specified without providing an arp_ip_target parameter, arp_interval was reset to 0\n", pr_warn("Warning: arp_interval module parameter (%d) specified without providing an arp_ip_target parameter, arp_interval was reset to 0\n",
arp_interval); arp_interval);
arp_interval = 0; arp_interval = 0;
} }
...@@ -4255,7 +4251,7 @@ static int bond_check_params(struct bond_params *params) ...@@ -4255,7 +4251,7 @@ static int bond_check_params(struct bond_params *params)
/* currently, using a primary only makes sense /* currently, using a primary only makes sense
* in active backup, TLB or ALB modes * in active backup, TLB or ALB modes
*/ */
pr_warning("Warning: %s primary device specified but has no effect in %s mode\n", pr_warn("Warning: %s primary device specified but has no effect in %s mode\n",
primary, bond_mode_name(bond_mode)); primary, bond_mode_name(bond_mode));
primary = NULL; primary = NULL;
} }
...@@ -4285,13 +4281,13 @@ static int bond_check_params(struct bond_params *params) ...@@ -4285,13 +4281,13 @@ static int bond_check_params(struct bond_params *params)
} }
fail_over_mac_value = valptr->value; fail_over_mac_value = valptr->value;
if (bond_mode != BOND_MODE_ACTIVEBACKUP) if (bond_mode != BOND_MODE_ACTIVEBACKUP)
pr_warning("Warning: fail_over_mac only affects active-backup mode.\n"); pr_warn("Warning: fail_over_mac only affects active-backup mode\n");
} else { } else {
fail_over_mac_value = BOND_FOM_NONE; fail_over_mac_value = BOND_FOM_NONE;
} }
if (lp_interval == 0) { if (lp_interval == 0) {
pr_warning("Warning: ip_interval must be between 1 and %d, so it was reset to %d\n", pr_warn("Warning: ip_interval must be between 1 and %d, so it was reset to %d\n",
INT_MAX, BOND_ALB_DEFAULT_LP_INTERVAL); INT_MAX, BOND_ALB_DEFAULT_LP_INTERVAL);
lp_interval = BOND_ALB_DEFAULT_LP_INTERVAL; lp_interval = BOND_ALB_DEFAULT_LP_INTERVAL;
} }
......
...@@ -254,7 +254,7 @@ void bond_create_proc_entry(struct bonding *bond) ...@@ -254,7 +254,7 @@ void bond_create_proc_entry(struct bonding *bond)
S_IRUGO, bn->proc_dir, S_IRUGO, bn->proc_dir,
&bond_info_fops, bond); &bond_info_fops, bond);
if (bond->proc_entry == NULL) if (bond->proc_entry == NULL)
pr_warning("Warning: Cannot create /proc/net/%s/%s\n", pr_warn("Warning: Cannot create /proc/net/%s/%s\n",
DRV_NAME, bond_dev->name); DRV_NAME, bond_dev->name);
else else
memcpy(bond->proc_file_name, bond_dev->name, IFNAMSIZ); memcpy(bond->proc_file_name, bond_dev->name, IFNAMSIZ);
...@@ -281,7 +281,7 @@ void __net_init bond_create_proc_dir(struct bond_net *bn) ...@@ -281,7 +281,7 @@ void __net_init bond_create_proc_dir(struct bond_net *bn)
if (!bn->proc_dir) { if (!bn->proc_dir) {
bn->proc_dir = proc_mkdir(DRV_NAME, bn->net->proc_net); bn->proc_dir = proc_mkdir(DRV_NAME, bn->net->proc_net);
if (!bn->proc_dir) if (!bn->proc_dir)
pr_warning("Warning: cannot create /proc/net/%s\n", pr_warn("Warning: cannot create /proc/net/%s\n",
DRV_NAME); DRV_NAME);
} }
} }
......
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