]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
staging: rtl8723bs: rewrite comparisons to null
authorFabio Aiuto <fabioaiuto83@gmail.com>
Mon, 5 Apr 2021 16:49:55 +0000 (18:49 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 6 Apr 2021 10:54:01 +0000 (12:54 +0200)
fix the following post-commit hook checkpatch issues:

CHECK: Comparison to NULL could be written "!pwep"
147: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:442:
+ if (pwep == NULL)

CHECK: Comparison to NULL could be written "!skb"
226: FILE: drivers/staging/rtl8723bs/os_dep/recv_linux.c:204:
+ if (skb == NULL)

CHECK: Comparison to NULL could be written "!dvobj"
275: FILE: drivers/staging/rtl8723bs/os_dep/sdio_intf.c:398:
+ if (dvobj == NULL)

Suggested-by: Joe Perches <joe@perches.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/92edc9da10838dd99f96a99121343f4ec11b5d90.1617640221.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
drivers/staging/rtl8723bs/os_dep/recv_linux.c
drivers/staging/rtl8723bs/os_dep/sdio_intf.c

index 03360af0645dd7a3ede2724185f908e462a11f5d..297287cff5bef6d2f7bff0e0968b4ab35a868ad4 100644 (file)
@@ -439,7 +439,7 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param,
                        wep_key_len = wep_key_len <= 5 ? 5 : 13;
                        wep_total_len = wep_key_len + FIELD_OFFSET(struct ndis_802_11_wep, KeyMaterial);
                        pwep = kzalloc(wep_total_len, GFP_KERNEL);
-                       if (pwep == NULL)
+                       if (!pwep)
                                goto exit;
 
                        pwep->KeyLength = wep_key_len;
index 63a7e7fe2bb58cf5ad06a89eddf7b13f2dda8205..975aceb7b45b43714e7b0b5fc4655996caf03ed4 100644 (file)
@@ -201,7 +201,7 @@ int rtw_recv_indicatepkt(struct adapter *padapter, union recv_frame *precv_frame
        pfree_recv_queue = &(precvpriv->free_recv_queue);
 
        skb = precv_frame->u.hdr.pkt;
-       if (skb == NULL)
+       if (!skb)
                goto _recv_indicatepkt_drop;
 
        skb->data = precv_frame->u.hdr.rx_data;
index f8e1d15f54ef9f734bd835f24de3a9bb11d4c222..deba03ad6c6efa9556426dd7c868f0d3feaa0f90 100644 (file)
@@ -395,7 +395,7 @@ static int rtw_drv_init(
        struct dvobj_priv *dvobj;
 
        dvobj = sdio_dvobj_init(func);
-       if (dvobj == NULL)
+       if (!dvobj)
                goto exit;
 
        if1 = rtw_sdio_if1_init(dvobj, id);