ANDROID: xt_qtaguid: Remove unnecessary null checks to device's name
authorNathan Chancellor <natechancellor@gmail.com>
Sun, 1 Apr 2018 03:56:23 +0000 (20:56 -0700)
committerivanmeler <i_ivan@windowslive.com>
Wed, 13 Apr 2022 21:13:45 +0000 (21:13 +0000)
'name' will never be NULL since it isn't a plain pointer but an array
of char values.

../net/netfilter/xt_qtaguid.c:1195:27: warning: address of array
'(*el_dev)->name' will always evaluate to 'true'
[-Wpointer-bool-conversion]
        if (unlikely(!(*el_dev)->name)) {
                     ~~~~~~~~~~~~^~~~

Change-Id: If3b25f17829b43e8a639193fb9cd04ae45947200
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
net/netfilter/xt_qtaguid.c

index d67e762ecb563854b1b06ae165723349387118a7..aef139d596fe1eda0fcd84b9f7c75cd10a055551 100644 (file)
@@ -1192,11 +1192,6 @@ static void get_dev_and_dir(const struct sk_buff *skb,
                       par->hooknum, __func__);
                BUG();
        }
-       if (unlikely(!(*el_dev)->name)) {
-               pr_err("qtaguid[%d]: %s(): no dev->name?!!\n",
-                      par->hooknum, __func__);
-               BUG();
-       }
        if (skb->dev && *el_dev != skb->dev) {
                MT_DEBUG("qtaguid[%d]: skb->dev=%p %s vs par->%s=%p %s\n",
                         par->hooknum, skb->dev, skb->dev->name,