i40evf: make checkpatch happy
This patch is the result of running checkpatch on the i40evf driver with the --strict option. The vast majority of changes are adding/removing blank lines, aligning function parameters, and correcting over-long lines. The only possible functional change is changing the flags member of the adapter structure to be non-volatile. However, according to the kernel documentation, this is not necessary and the volatile should be removed. Change-ID: Ie8c6414800924f529bef831e8845292b970fe2ed Signed-off-by: Mitch Williams <mitch.a.williams@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
This commit is contained in:

committed by
Jeff Kirsher

parent
2cda3f3be5
commit
75a644358a
@@ -244,7 +244,7 @@ struct i40evf_adapter {
|
||||
struct i40e_hw hw; /* defined in i40e_type.h */
|
||||
|
||||
enum i40evf_state_t state;
|
||||
volatile unsigned long crit_section;
|
||||
unsigned long crit_section;
|
||||
|
||||
struct work_struct watchdog_task;
|
||||
bool netdev_registered;
|
||||
|
@@ -58,7 +58,7 @@ static const struct i40evf_stats i40evf_gstrings_stats[] = {
|
||||
|
||||
#define I40EVF_GLOBAL_STATS_LEN ARRAY_SIZE(i40evf_gstrings_stats)
|
||||
#define I40EVF_QUEUE_STATS_LEN(_dev) \
|
||||
(((struct i40evf_adapter *) \
|
||||
(((struct i40evf_adapter *)\
|
||||
netdev_priv(_dev))->num_active_queues \
|
||||
* 2 * (sizeof(struct i40e_queue_stats) / sizeof(u64)))
|
||||
#define I40EVF_STATS_LEN(_dev) \
|
||||
@@ -175,6 +175,7 @@ static void i40evf_get_strings(struct net_device *netdev, u32 sset, u8 *data)
|
||||
static u32 i40evf_get_msglevel(struct net_device *netdev)
|
||||
{
|
||||
struct i40evf_adapter *adapter = netdev_priv(netdev);
|
||||
|
||||
return adapter->msg_enable;
|
||||
}
|
||||
|
||||
@@ -189,6 +190,7 @@ static u32 i40evf_get_msglevel(struct net_device *netdev)
|
||||
static void i40evf_set_msglevel(struct net_device *netdev, u32 data)
|
||||
{
|
||||
struct i40evf_adapter *adapter = netdev_priv(netdev);
|
||||
|
||||
adapter->msg_enable = data;
|
||||
}
|
||||
|
||||
|
@@ -185,6 +185,7 @@ static void i40evf_tx_timeout(struct net_device *netdev)
|
||||
static void i40evf_misc_irq_disable(struct i40evf_adapter *adapter)
|
||||
{
|
||||
struct i40e_hw *hw = &adapter->hw;
|
||||
|
||||
wr32(hw, I40E_VFINT_DYN_CTL01, 0);
|
||||
|
||||
/* read flush */
|
||||
@@ -200,6 +201,7 @@ static void i40evf_misc_irq_disable(struct i40evf_adapter *adapter)
|
||||
static void i40evf_misc_irq_enable(struct i40evf_adapter *adapter)
|
||||
{
|
||||
struct i40e_hw *hw = &adapter->hw;
|
||||
|
||||
wr32(hw, I40E_VFINT_DYN_CTL01, I40E_VFINT_DYN_CTL01_INTENA_MASK |
|
||||
I40E_VFINT_DYN_CTL01_ITR_INDX_MASK);
|
||||
wr32(hw, I40E_VFINT_ICR0_ENA1, I40E_VFINT_ICR0_ENA_ADMINQ_MASK);
|
||||
@@ -226,7 +228,6 @@ static void i40evf_irq_disable(struct i40evf_adapter *adapter)
|
||||
}
|
||||
/* read flush */
|
||||
rd32(hw, I40E_VFGEN_RSTAT);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -253,8 +254,7 @@ void i40evf_irq_enable_queues(struct i40evf_adapter *adapter, u32 mask)
|
||||
* @adapter: board private structure
|
||||
* @mask: bitmap of vectors to trigger
|
||||
**/
|
||||
static void i40evf_fire_sw_int(struct i40evf_adapter *adapter,
|
||||
u32 mask)
|
||||
static void i40evf_fire_sw_int(struct i40evf_adapter *adapter, u32 mask)
|
||||
{
|
||||
struct i40e_hw *hw = &adapter->hw;
|
||||
int i;
|
||||
@@ -551,6 +551,7 @@ static void i40evf_free_traffic_irqs(struct i40evf_adapter *adapter)
|
||||
{
|
||||
int i;
|
||||
int q_vectors;
|
||||
|
||||
q_vectors = adapter->num_msix_vectors - NONQ_VECS;
|
||||
|
||||
for (i = 0; i < q_vectors; i++) {
|
||||
@@ -584,6 +585,7 @@ static void i40evf_configure_tx(struct i40evf_adapter *adapter)
|
||||
{
|
||||
struct i40e_hw *hw = &adapter->hw;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < adapter->num_active_queues; i++)
|
||||
adapter->tx_rings[i]->tail = hw->hw_addr + I40E_QTX_TAIL1(i);
|
||||
}
|
||||
@@ -881,6 +883,7 @@ static void i40evf_napi_enable_all(struct i40evf_adapter *adapter)
|
||||
|
||||
for (q_idx = 0; q_idx < q_vectors; q_idx++) {
|
||||
struct napi_struct *napi;
|
||||
|
||||
q_vector = adapter->q_vector[q_idx];
|
||||
napi = &q_vector->napi;
|
||||
napi_enable(napi);
|
||||
@@ -920,6 +923,7 @@ static void i40evf_configure(struct i40evf_adapter *adapter)
|
||||
|
||||
for (i = 0; i < adapter->num_active_queues; i++) {
|
||||
struct i40e_ring *ring = adapter->rx_rings[i];
|
||||
|
||||
i40evf_alloc_rx_buffers(ring, ring->count);
|
||||
ring->next_to_use = ring->count - 1;
|
||||
writel(ring->next_to_use, ring->tail);
|
||||
@@ -1088,7 +1092,7 @@ static int i40evf_alloc_queues(struct i40evf_adapter *adapter)
|
||||
struct i40e_ring *tx_ring;
|
||||
struct i40e_ring *rx_ring;
|
||||
|
||||
tx_ring = kzalloc(sizeof(struct i40e_ring) * 2, GFP_KERNEL);
|
||||
tx_ring = kzalloc(sizeof(*tx_ring) * 2, GFP_KERNEL);
|
||||
if (!tx_ring)
|
||||
goto err_out;
|
||||
|
||||
@@ -1172,7 +1176,7 @@ static int i40evf_alloc_q_vectors(struct i40evf_adapter *adapter)
|
||||
num_q_vectors = adapter->num_msix_vectors - NONQ_VECS;
|
||||
|
||||
for (q_idx = 0; q_idx < num_q_vectors; q_idx++) {
|
||||
q_vector = kzalloc(sizeof(struct i40e_q_vector), GFP_KERNEL);
|
||||
q_vector = kzalloc(sizeof(*q_vector), GFP_KERNEL);
|
||||
if (!q_vector)
|
||||
goto err_out;
|
||||
q_vector->adapter = adapter;
|
||||
@@ -1265,8 +1269,8 @@ int i40evf_init_interrupt_scheme(struct i40evf_adapter *adapter)
|
||||
}
|
||||
|
||||
dev_info(&adapter->pdev->dev, "Multiqueue %s: Queue pair count = %u",
|
||||
(adapter->num_active_queues > 1) ? "Enabled" :
|
||||
"Disabled", adapter->num_active_queues);
|
||||
(adapter->num_active_queues > 1) ? "Enabled" : "Disabled",
|
||||
adapter->num_active_queues);
|
||||
|
||||
return 0;
|
||||
err_alloc_queues:
|
||||
@@ -1284,6 +1288,7 @@ err_set_interrupt:
|
||||
static void i40evf_watchdog_timer(unsigned long data)
|
||||
{
|
||||
struct i40evf_adapter *adapter = (struct i40evf_adapter *)data;
|
||||
|
||||
schedule_work(&adapter->watchdog_task);
|
||||
/* timer will be rescheduled in watchdog task */
|
||||
}
|
||||
@@ -1646,9 +1651,8 @@ static void i40evf_adminq_task(struct work_struct *work)
|
||||
i40evf_virtchnl_completion(adapter, v_msg->v_opcode,
|
||||
v_msg->v_retval, event.msg_buf,
|
||||
event.msg_len);
|
||||
if (pending != 0) {
|
||||
if (pending != 0)
|
||||
memset(event.msg_buf, 0, I40EVF_MAX_AQ_BUF_SIZE);
|
||||
}
|
||||
} while (pending);
|
||||
|
||||
/* check for error indications */
|
||||
@@ -1705,7 +1709,6 @@ static void i40evf_free_all_tx_resources(struct i40evf_adapter *adapter)
|
||||
for (i = 0; i < adapter->num_active_queues; i++)
|
||||
if (adapter->tx_rings[i]->desc)
|
||||
i40evf_free_tx_resources(adapter->tx_rings[i]);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2500,6 +2503,7 @@ static struct pci_driver i40evf_driver = {
|
||||
static int __init i40evf_init_module(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
pr_info("i40evf: %s - version %s\n", i40evf_driver_string,
|
||||
i40evf_driver_version);
|
||||
|
||||
|
@@ -637,6 +637,7 @@ void i40evf_set_promiscuous(struct i40evf_adapter *adapter, int flags)
|
||||
void i40evf_request_stats(struct i40evf_adapter *adapter)
|
||||
{
|
||||
struct i40e_virtchnl_queue_select vqs;
|
||||
|
||||
if (adapter->current_op != I40E_VIRTCHNL_OP_UNKNOWN) {
|
||||
/* no error message, this isn't crucial */
|
||||
return;
|
||||
@@ -711,7 +712,6 @@ void i40evf_virtchnl_completion(struct i40evf_adapter *adapter,
|
||||
"%s: Unknown event %d from pf\n",
|
||||
__func__, vpe->event);
|
||||
break;
|
||||
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user