]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
net: dcb: getnumtcs()/setnumtcs() should return an int
authorJohn Fastabend <john.r.fastabend@intel.com>
Fri, 10 Feb 2012 03:19:41 +0000 (03:19 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Sat, 3 Mar 2012 02:16:49 +0000 (18:16 -0800)
{g|s}etnumtcs() today returns a u8 that is only used by the DCB code
to verify no error occurred. Today the driver implementations return
negative error codes which end up being non-zero so the logic works
out but triggers some sparse warnings.

To fix the sparse warnings convert the return value to an int.

CC: Eilon Greenstein <eilong@broadcom.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c
drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c
include/net/dcbnl.h

index 9a9bd3ab479382c33a7204179c00a299c4f9d762..9a4ed05bb30a0f38ac52924a405078ef498a153b 100644 (file)
@@ -2142,7 +2142,7 @@ static u8 bnx2x_dcbnl_get_cap(struct net_device *netdev, int capid, u8 *cap)
        return rval;
 }
 
-static u8 bnx2x_dcbnl_get_numtcs(struct net_device *netdev, int tcid, u8 *num)
+static int bnx2x_dcbnl_get_numtcs(struct net_device *netdev, int tcid, u8 *num)
 {
        struct bnx2x *bp = netdev_priv(netdev);
        u8 rval = 0;
@@ -2169,7 +2169,7 @@ static u8 bnx2x_dcbnl_get_numtcs(struct net_device *netdev, int tcid, u8 *num)
        return rval;
 }
 
-static u8 bnx2x_dcbnl_set_numtcs(struct net_device *netdev, int tcid, u8 num)
+static int bnx2x_dcbnl_set_numtcs(struct net_device *netdev, int tcid, u8 num)
 {
        struct bnx2x *bp = netdev_priv(netdev);
        DP(NETIF_MSG_LINK, "num tcs = %d; Not supported\n", num);
index 95e5d11bb555aa68780bc670a960549bbe3da955..dde65f951400dc7efc1c6b3d09d5c8e44710db6f 100644 (file)
@@ -490,7 +490,7 @@ static u8 ixgbe_dcbnl_getcap(struct net_device *netdev, int capid, u8 *cap)
        return 0;
 }
 
-static u8 ixgbe_dcbnl_getnumtcs(struct net_device *netdev, int tcid, u8 *num)
+static int ixgbe_dcbnl_getnumtcs(struct net_device *netdev, int tcid, u8 *num)
 {
        struct ixgbe_adapter *adapter = netdev_priv(netdev);
        u8 rval = 0;
@@ -514,7 +514,7 @@ static u8 ixgbe_dcbnl_getnumtcs(struct net_device *netdev, int tcid, u8 *num)
        return rval;
 }
 
-static u8 ixgbe_dcbnl_setnumtcs(struct net_device *netdev, int tcid, u8 num)
+static int ixgbe_dcbnl_setnumtcs(struct net_device *netdev, int tcid, u8 num)
 {
        return -EINVAL;
 }
index 2cd66d0be34839276e202e900dd17392ba15e124..f55c980d8e23d14b42bfdfa583dccdb76aa4d303 100644 (file)
@@ -72,8 +72,8 @@ struct dcbnl_rtnl_ops {
        void (*getpfccfg)(struct net_device *, int, u8 *);
        u8   (*setall)(struct net_device *);
        u8   (*getcap)(struct net_device *, int, u8 *);
-       u8   (*getnumtcs)(struct net_device *, int, u8 *);
-       u8   (*setnumtcs)(struct net_device *, int, u8);
+       int  (*getnumtcs)(struct net_device *, int, u8 *);
+       int  (*setnumtcs)(struct net_device *, int, u8);
        u8   (*getpfcstate)(struct net_device *);
        void (*setpfcstate)(struct net_device *, u8);
        void (*getbcncfg)(struct net_device *, int, u32 *);