]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
i40e: redfine I40E_PHY_TYPE_MAX
authorMitch Williams <mitch.a.williams@intel.com>
Tue, 29 Aug 2017 09:32:33 +0000 (05:32 -0400)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Fri, 6 Oct 2017 15:11:31 +0000 (08:11 -0700)
Since I40E_PHY_TYPE_MAX is used as an iterator, usually combined with
some sort of bit-shifting, it should only include actual PHY types and
not error cases. Move it up in the enum declaration so that loops only
iterate across valid PHY types.

Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h
drivers/net/ethernet/intel/i40evf/i40e_adminq_cmd.h

index 4c85ea9cd89aeb7edf8ec2d27f50972966f5cfb4..50c5a4c630b814f43d017445d0d5fa94c2546c03 100644 (file)
@@ -1771,9 +1771,9 @@ enum i40e_aq_phy_type {
        I40E_PHY_TYPE_25GBASE_CR                = 0x20,
        I40E_PHY_TYPE_25GBASE_SR                = 0x21,
        I40E_PHY_TYPE_25GBASE_LR                = 0x22,
+       I40E_PHY_TYPE_MAX,
        I40E_PHY_TYPE_EMPTY                     = 0xFE,
        I40E_PHY_TYPE_DEFAULT                   = 0xFF,
-       I40E_PHY_TYPE_MAX
 };
 
 #define I40E_LINK_SPEED_100MB_SHIFT    0x1
index ed5602f4bbcd6f346c5508227ed5b15bd619a50d..dc6fc8b1bc79815e63e403d204f6298c4bb4d170 100644 (file)
@@ -1767,9 +1767,9 @@ enum i40e_aq_phy_type {
        I40E_PHY_TYPE_25GBASE_CR                = 0x20,
        I40E_PHY_TYPE_25GBASE_SR                = 0x21,
        I40E_PHY_TYPE_25GBASE_LR                = 0x22,
+       I40E_PHY_TYPE_MAX,
        I40E_PHY_TYPE_EMPTY                     = 0xFE,
        I40E_PHY_TYPE_DEFAULT                   = 0xFF,
-       I40E_PHY_TYPE_MAX
 };
 
 #define I40E_LINK_SPEED_100MB_SHIFT    0x1