Commit 7c8d008c authored by Shannon Nelson's avatar Shannon Nelson Committed by Jakub Kicinski

ionic: useful names for booleans

With a few more uses of true and false in function calls, we
need to give them some useful names so we can tell from the
calling point what we're doing.
Signed-off-by: default avatarShannon Nelson <snelson@pensando.io>
Reviewed-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 81dbc241
...@@ -25,7 +25,7 @@ static void ionic_watchdog_cb(struct timer_list *t) ...@@ -25,7 +25,7 @@ static void ionic_watchdog_cb(struct timer_list *t)
hb = ionic_heartbeat_check(ionic); hb = ionic_heartbeat_check(ionic);
if (hb >= 0) if (hb >= 0)
ionic_link_status_check_request(ionic->lif, false); ionic_link_status_check_request(ionic->lif, CAN_NOT_SLEEP);
} }
void ionic_init_devinfo(struct ionic *ionic) void ionic_init_devinfo(struct ionic *ionic)
......
...@@ -1074,22 +1074,22 @@ static int ionic_lif_addr(struct ionic_lif *lif, const u8 *addr, bool add, ...@@ -1074,22 +1074,22 @@ static int ionic_lif_addr(struct ionic_lif *lif, const u8 *addr, bool add,
static int ionic_addr_add(struct net_device *netdev, const u8 *addr) static int ionic_addr_add(struct net_device *netdev, const u8 *addr)
{ {
return ionic_lif_addr(netdev_priv(netdev), addr, true, true); return ionic_lif_addr(netdev_priv(netdev), addr, ADD_ADDR, CAN_SLEEP);
} }
static int ionic_ndo_addr_add(struct net_device *netdev, const u8 *addr) static int ionic_ndo_addr_add(struct net_device *netdev, const u8 *addr)
{ {
return ionic_lif_addr(netdev_priv(netdev), addr, true, false); return ionic_lif_addr(netdev_priv(netdev), addr, ADD_ADDR, CAN_NOT_SLEEP);
} }
static int ionic_addr_del(struct net_device *netdev, const u8 *addr) static int ionic_addr_del(struct net_device *netdev, const u8 *addr)
{ {
return ionic_lif_addr(netdev_priv(netdev), addr, false, true); return ionic_lif_addr(netdev_priv(netdev), addr, DEL_ADDR, CAN_SLEEP);
} }
static int ionic_ndo_addr_del(struct net_device *netdev, const u8 *addr) static int ionic_ndo_addr_del(struct net_device *netdev, const u8 *addr)
{ {
return ionic_lif_addr(netdev_priv(netdev), addr, false, false); return ionic_lif_addr(netdev_priv(netdev), addr, DEL_ADDR, CAN_NOT_SLEEP);
} }
static void ionic_lif_rx_mode(struct ionic_lif *lif, unsigned int rx_mode) static void ionic_lif_rx_mode(struct ionic_lif *lif, unsigned int rx_mode)
...@@ -1197,7 +1197,7 @@ static void ionic_set_rx_mode(struct net_device *netdev, bool can_sleep) ...@@ -1197,7 +1197,7 @@ static void ionic_set_rx_mode(struct net_device *netdev, bool can_sleep)
static void ionic_ndo_set_rx_mode(struct net_device *netdev) static void ionic_ndo_set_rx_mode(struct net_device *netdev)
{ {
ionic_set_rx_mode(netdev, false); ionic_set_rx_mode(netdev, CAN_NOT_SLEEP);
} }
static __le64 ionic_netdev_features_to_nic(netdev_features_t features) static __le64 ionic_netdev_features_to_nic(netdev_features_t features)
...@@ -1784,7 +1784,7 @@ static int ionic_txrx_init(struct ionic_lif *lif) ...@@ -1784,7 +1784,7 @@ static int ionic_txrx_init(struct ionic_lif *lif)
if (lif->netdev->features & NETIF_F_RXHASH) if (lif->netdev->features & NETIF_F_RXHASH)
ionic_lif_rss_init(lif); ionic_lif_rss_init(lif);
ionic_set_rx_mode(lif->netdev, true); ionic_set_rx_mode(lif->netdev, CAN_SLEEP);
return 0; return 0;
...@@ -2792,7 +2792,7 @@ static int ionic_station_set(struct ionic_lif *lif) ...@@ -2792,7 +2792,7 @@ static int ionic_station_set(struct ionic_lif *lif)
*/ */
if (!ether_addr_equal(ctx.comp.lif_getattr.mac, if (!ether_addr_equal(ctx.comp.lif_getattr.mac,
netdev->dev_addr)) netdev->dev_addr))
ionic_lif_addr(lif, netdev->dev_addr, true, true); ionic_lif_addr(lif, netdev->dev_addr, ADD_ADDR, CAN_SLEEP);
} else { } else {
/* Update the netdev mac with the device's mac */ /* Update the netdev mac with the device's mac */
memcpy(addr.sa_data, ctx.comp.lif_getattr.mac, netdev->addr_len); memcpy(addr.sa_data, ctx.comp.lif_getattr.mac, netdev->addr_len);
...@@ -2809,7 +2809,7 @@ static int ionic_station_set(struct ionic_lif *lif) ...@@ -2809,7 +2809,7 @@ static int ionic_station_set(struct ionic_lif *lif)
netdev_dbg(lif->netdev, "adding station MAC addr %pM\n", netdev_dbg(lif->netdev, "adding station MAC addr %pM\n",
netdev->dev_addr); netdev->dev_addr);
ionic_lif_addr(lif, netdev->dev_addr, true, true); ionic_lif_addr(lif, netdev->dev_addr, ADD_ADDR, CAN_SLEEP);
return 0; return 0;
} }
......
...@@ -13,6 +13,12 @@ ...@@ -13,6 +13,12 @@
#define IONIC_MAX_NUM_NAPI_CNTR (NAPI_POLL_WEIGHT + 1) #define IONIC_MAX_NUM_NAPI_CNTR (NAPI_POLL_WEIGHT + 1)
#define IONIC_MAX_NUM_SG_CNTR (IONIC_TX_MAX_SG_ELEMS + 1) #define IONIC_MAX_NUM_SG_CNTR (IONIC_TX_MAX_SG_ELEMS + 1)
#define ADD_ADDR true
#define DEL_ADDR false
#define CAN_SLEEP true
#define CAN_NOT_SLEEP false
#define IONIC_RX_COPYBREAK_DEFAULT 256 #define IONIC_RX_COPYBREAK_DEFAULT 256
#define IONIC_TX_BUDGET_DEFAULT 256 #define IONIC_TX_BUDGET_DEFAULT 256
......
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