Commit c1e08830 authored by Jesse Brandeburg's avatar Jesse Brandeburg Committed by Jeff Kirsher
Browse files

ice: cleanup unsigned loops



Fix loop variables that are comparing or assigning signed against
unsigned values, mostly by declaring loop counters as unsigned.

Signed-off-by: default avatarJesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 9d68a79c
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -671,7 +671,7 @@ static bool
ice_dcbnl_find_app(struct ice_dcbx_cfg *cfg,
		   struct ice_dcb_app_priority_table *app)
{
	int i;
	unsigned int i;

	for (i = 0; i < cfg->numapps; i++) {
		if (app->selector == cfg->app[i].selector &&
@@ -746,7 +746,8 @@ static int ice_dcbnl_delapp(struct net_device *netdev, struct dcb_app *app)
{
	struct ice_pf *pf = ice_netdev_to_pf(netdev);
	struct ice_dcbx_cfg *old_cfg, *new_cfg;
	int i, j, ret = 0;
	unsigned int i, j;
	int ret = 0;

	if (pf->dcbx_cap & DCB_CAP_DCBX_LLD_MANAGED)
		return -EINVAL;
@@ -869,7 +870,7 @@ void ice_dcbnl_set_all(struct ice_vsi *vsi)
	struct ice_port_info *pi;
	struct dcb_app sapp;
	struct ice_pf *pf;
	int i;
	unsigned int i;

	if (!netdev)
		return;
@@ -941,7 +942,7 @@ ice_dcbnl_flush_apps(struct ice_pf *pf, struct ice_dcbx_cfg *old_cfg,
		     struct ice_dcbx_cfg *new_cfg)
{
	struct ice_vsi *main_vsi = ice_get_main_vsi(pf);
	int i;
	unsigned int i;

	if (!main_vsi)
		return;
+5 −5
Original line number Diff line number Diff line
@@ -205,7 +205,7 @@ ice_get_regs(struct net_device *netdev, struct ethtool_regs *regs, void *p)
	struct ice_pf *pf = np->vsi->back;
	struct ice_hw *hw = &pf->hw;
	u32 *regs_buf = (u32 *)p;
	int i;
	unsigned int i;

	regs->version = 1;

@@ -308,7 +308,7 @@ out:
 */
static bool ice_active_vfs(struct ice_pf *pf)
{
	int i;
	unsigned int i;

	ice_for_each_vf(pf, i) {
		struct ice_vf *vf = &pf->vf[i];
@@ -378,7 +378,7 @@ static int ice_reg_pattern_test(struct ice_hw *hw, u32 reg, u32 mask)
		0x00000000, 0xFFFFFFFF
	};
	u32 val, orig_val;
	int i;
	unsigned int i;

	orig_val = rd32(hw, reg);
	for (i = 0; i < ARRAY_SIZE(patterns); ++i) {
@@ -431,7 +431,7 @@ static u64 ice_reg_test(struct net_device *netdev)
			GLINT_ITR(2, 1) - GLINT_ITR(2, 0)},
		{GLINT_CTL, 0xffff0001, 1, 0}
	};
	int i;
	unsigned int i;

	netdev_dbg(netdev, "Register test\n");
	for (i = 0; i < ARRAY_SIZE(ice_reg_list); ++i) {
@@ -3759,10 +3759,10 @@ ice_get_module_eeprom(struct net_device *netdev,
	struct ice_hw *hw = &pf->hw;
	enum ice_status status;
	bool is_sfp = false;
	unsigned int i;
	u16 offset = 0;
	u8 value = 0;
	u8 page = 0;
	int i;

	status = ice_aq_sff_eeprom(hw, 0, addr, offset, page, 0,
				   &value, 1, 0, NULL);
+2 −2
Original line number Diff line number Diff line
@@ -452,7 +452,7 @@ static void
ice_prepare_for_reset(struct ice_pf *pf)
{
	struct ice_hw *hw = &pf->hw;
	int i;
	unsigned int i;

	/* already prepared for reset */
	if (test_bit(__ICE_PREPARED_FOR_RESET, pf->state))
@@ -1188,8 +1188,8 @@ static void ice_handle_mdd_event(struct ice_pf *pf)
{
	struct device *dev = ice_pf_to_dev(pf);
	struct ice_hw *hw = &pf->hw;
	unsigned int i;
	u32 reg;
	int i;

	if (!test_and_clear_bit(__ICE_MDD_EVENT_PENDING, pf->state)) {
		/* Since the VF MDD event logging is rate limited, check if
+2 −2
Original line number Diff line number Diff line
@@ -80,7 +80,7 @@ ice_vc_vf_broadcast(struct ice_pf *pf, enum virtchnl_ops v_opcode,
		    enum virtchnl_status_code v_retval, u8 *msg, u16 msglen)
{
	struct ice_hw *hw = &pf->hw;
	int i;
	unsigned int i;

	ice_for_each_vf(pf, i) {
		struct ice_vf *vf = &pf->vf[i];
@@ -325,7 +325,7 @@ void ice_free_vfs(struct ice_pf *pf)
{
	struct device *dev = ice_pf_to_dev(pf);
	struct ice_hw *hw = &pf->hw;
	int tmp, i;
	unsigned int tmp, i;

	if (!pf->vf)
		return;