mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-07 00:59:06 +00:00
ice: reduce scope of variables
There are some places where the scope of a variable can be reduced so do that. Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com> Tested-by: Tony Brelinski <tonyx.brelinski@intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
This commit is contained in:
parent
0c526d440f
commit
b6b0501d8d
2 changed files with 6 additions and 6 deletions
|
@ -1205,11 +1205,11 @@ static int ice_vsi_setup_vector_base(struct ice_vsi *vsi)
|
||||||
num_q_vectors = vsi->num_q_vectors;
|
num_q_vectors = vsi->num_q_vectors;
|
||||||
/* reserve slots from OS requested IRQs */
|
/* reserve slots from OS requested IRQs */
|
||||||
if (vsi->type == ICE_VSI_CTRL && vsi->vf_id != ICE_INVAL_VFID) {
|
if (vsi->type == ICE_VSI_CTRL && vsi->vf_id != ICE_INVAL_VFID) {
|
||||||
struct ice_vf *vf;
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
ice_for_each_vf(pf, i) {
|
ice_for_each_vf(pf, i) {
|
||||||
vf = &pf->vf[i];
|
struct ice_vf *vf = &pf->vf[i];
|
||||||
|
|
||||||
if (i != vsi->vf_id && vf->ctrl_vsi_idx != ICE_NO_VSI) {
|
if (i != vsi->vf_id && vf->ctrl_vsi_idx != ICE_NO_VSI) {
|
||||||
base = pf->vsi[vf->ctrl_vsi_idx]->base_vector;
|
base = pf->vsi[vf->ctrl_vsi_idx]->base_vector;
|
||||||
break;
|
break;
|
||||||
|
@ -2873,11 +2873,11 @@ int ice_vsi_release(struct ice_vsi *vsi)
|
||||||
* cleared in the same manner.
|
* cleared in the same manner.
|
||||||
*/
|
*/
|
||||||
if (vsi->type == ICE_VSI_CTRL && vsi->vf_id != ICE_INVAL_VFID) {
|
if (vsi->type == ICE_VSI_CTRL && vsi->vf_id != ICE_INVAL_VFID) {
|
||||||
struct ice_vf *vf;
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
ice_for_each_vf(pf, i) {
|
ice_for_each_vf(pf, i) {
|
||||||
vf = &pf->vf[i];
|
struct ice_vf *vf = &pf->vf[i];
|
||||||
|
|
||||||
if (i != vsi->vf_id && vf->ctrl_vsi_idx != ICE_NO_VSI)
|
if (i != vsi->vf_id && vf->ctrl_vsi_idx != ICE_NO_VSI)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5631,7 +5631,6 @@ ice_update_vsi_tx_ring_stats(struct ice_vsi *vsi, struct ice_ring **rings,
|
||||||
static void ice_update_vsi_ring_stats(struct ice_vsi *vsi)
|
static void ice_update_vsi_ring_stats(struct ice_vsi *vsi)
|
||||||
{
|
{
|
||||||
struct rtnl_link_stats64 *vsi_stats = &vsi->net_stats;
|
struct rtnl_link_stats64 *vsi_stats = &vsi->net_stats;
|
||||||
struct ice_ring *ring;
|
|
||||||
u64 pkts, bytes;
|
u64 pkts, bytes;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -5655,7 +5654,8 @@ static void ice_update_vsi_ring_stats(struct ice_vsi *vsi)
|
||||||
|
|
||||||
/* update Rx rings counters */
|
/* update Rx rings counters */
|
||||||
ice_for_each_rxq(vsi, i) {
|
ice_for_each_rxq(vsi, i) {
|
||||||
ring = READ_ONCE(vsi->rx_rings[i]);
|
struct ice_ring *ring = READ_ONCE(vsi->rx_rings[i]);
|
||||||
|
|
||||||
ice_fetch_u64_stats_per_ring(ring, &pkts, &bytes);
|
ice_fetch_u64_stats_per_ring(ring, &pkts, &bytes);
|
||||||
vsi_stats->rx_packets += pkts;
|
vsi_stats->rx_packets += pkts;
|
||||||
vsi_stats->rx_bytes += bytes;
|
vsi_stats->rx_bytes += bytes;
|
||||||
|
|
Loading…
Reference in a new issue