lkml.org 
[lkml]   [2017]   [Jan]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Subject[PATCH 3/4] dcbnl: Adjust five checks for null pointers
    From
    Date
    From: Markus Elfring <elfring@users.sourceforge.net>
    Date: Sat, 28 Jan 2017 09:56:36 +0100
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit

    The script "checkpatch.pl" pointed information out like the following.

    Comparison to NULL could be written !…

    Thus fix the affected source code places.

    Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
    ---
    net/dcb/dcbnl.c | 10 +++++-----
    1 file changed, 5 insertions(+), 5 deletions(-)

    diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c
    index f29e19d962ec..0903081a1212 100644
    --- a/net/dcb/dcbnl.c
    +++ b/net/dcb/dcbnl.c
    @@ -398,7 +398,7 @@ static int dcbnl_setnumtcs(struct net_device *netdev, struct nlmsghdr *nlh,
    return ret;

    for (i = DCB_NUMTCS_ATTR_ALL+1; i <= DCB_NUMTCS_ATTR_MAX; i++) {
    - if (data[i] == NULL)
    + if (!data[i])
    continue;

    value = nla_get_u8(data[i]);
    @@ -741,7 +741,7 @@ static int dcbnl_setpfccfg(struct net_device *netdev, struct nlmsghdr *nlh,
    return ret;

    for (i = DCB_PFC_UP_ATTR_0; i <= DCB_PFC_UP_ATTR_7; i++) {
    - if (data[i] == NULL)
    + if (!data[i])
    continue;
    value = nla_get_u8(data[i]);
    netdev->dcbnl_ops->setpfccfg(netdev,
    @@ -955,7 +955,7 @@ static int dcbnl_bcn_setcfg(struct net_device *netdev, struct nlmsghdr *nlh,
    return ret;

    for (i = DCB_BCN_ATTR_RP_0; i <= DCB_BCN_ATTR_RP_7; i++) {
    - if (data[i] == NULL)
    + if (!data[i])
    continue;
    value_byte = nla_get_u8(data[i]);
    netdev->dcbnl_ops->setbcnrp(netdev,
    @@ -963,7 +963,7 @@ static int dcbnl_bcn_setcfg(struct net_device *netdev, struct nlmsghdr *nlh,
    }

    for (i = DCB_BCN_ATTR_BCNA_0; i <= DCB_BCN_ATTR_RI; i++) {
    - if (data[i] == NULL)
    + if (!data[i])
    continue;
    value_int = nla_get_u32(data[i]);
    netdev->dcbnl_ops->setbcncfg(netdev,
    @@ -1632,7 +1632,7 @@ static int dcbnl_setfeatcfg(struct net_device *netdev, struct nlmsghdr *nlh,
    goto err;

    for (i = DCB_FEATCFG_ATTR_ALL+1; i <= DCB_FEATCFG_ATTR_MAX; i++) {
    - if (data[i] == NULL)
    + if (!data[i])
    continue;

    value = nla_get_u8(data[i]);
    --
    2.11.0
    \
     
     \ /
      Last update: 2017-01-28 10:40    [W:2.253 / U:0.040 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site