]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
amd-xgbe: Use int type to store negative error codes
authorQianfeng Rong <rongqianfeng@vivo.com>
Tue, 26 Aug 2025 14:21:59 +0000 (22:21 +0800)
committerJakub Kicinski <kuba@kernel.org>
Thu, 28 Aug 2025 01:06:46 +0000 (18:06 -0700)
Use int instead of unsigned int for the 'ret' variable to store return
values from functions that either return zero on success or negative error
codes on failure.  Storing negative error codes in an unsigned int causes
no runtime issues, but it's ugly as pants,  Change 'ret' from unsigned int
to int type - this change has no runtime impact.

Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://patch.msgid.link/20250826142159.525059-1-rongqianfeng@vivo.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c
drivers/net/ethernet/amd/xgbe/xgbe-i2c.c
drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c

index 35d73306a2d6b2d60509bc02159b4188a69e3cf8..b6e1b67a2d0e3be7b88a20d46ab703d0db0aa076 100644 (file)
@@ -464,7 +464,7 @@ static int xgbe_set_rxfh(struct net_device *netdev,
 {
        struct xgbe_prv_data *pdata = netdev_priv(netdev);
        struct xgbe_hw_if *hw_if = &pdata->hw_if;
-       unsigned int ret;
+       int ret;
 
        if (rxfh->hfunc != ETH_RSS_HASH_NO_CHANGE &&
            rxfh->hfunc != ETH_RSS_HASH_TOP) {
index d40011e8ddf2bd524539b26c0e15aa17348f2b42..65eb7b577b6524cf6e82e76b98f8929a0286ffd1 100644 (file)
@@ -70,7 +70,7 @@ static int xgbe_i2c_set_enable(struct xgbe_prv_data *pdata, bool enable)
 
 static int xgbe_i2c_disable(struct xgbe_prv_data *pdata)
 {
-       unsigned int ret;
+       int ret;
 
        ret = xgbe_i2c_set_enable(pdata, false);
        if (ret) {
index 23c39e92e783f1f407378f536a96f8ae30daad44..a56efc1bee33992d51839097015a7efe1609f656 100644 (file)
@@ -2902,7 +2902,7 @@ static void xgbe_phy_sfp_setup(struct xgbe_prv_data *pdata)
 static int xgbe_phy_int_mdio_reset(struct xgbe_prv_data *pdata)
 {
        struct xgbe_phy_data *phy_data = pdata->phy_data;
-       unsigned int ret;
+       int ret;
 
        ret = pdata->hw_if.set_gpio(pdata, phy_data->mdio_reset_gpio);
        if (ret)