]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
staging: rtl8712: rtl8712_cmd.c: fixed comparison to null
authorJuliana Rodrigues <juliana.orod@gmail.com>
Sun, 13 Mar 2016 18:30:57 +0000 (15:30 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 28 Mar 2016 14:30:36 +0000 (07:30 -0700)
This patch fixes multiple "comparison to NULL"
checkpatch.pl issues:

CHECK: Comparison to NULL could be written "!pcmd"
+               if (pcmd == NULL)

Signed-off-by: Juliana Rodrigues <juliana.orod@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8712/rtl8712_cmd.c

index 50f400234593ab04417e5c5138fadbbe37d76bcb..13c018340ff2710f85d97cb906937080547cb578 100644 (file)
@@ -135,7 +135,7 @@ static u8 read_macreg_hdl(struct _adapter *padapter, u8 *pbuf)
 
        /*  invoke cmd->callback function */
        pcmd_callback = cmd_callback[pcmd->cmdcode].callback;
-       if (pcmd_callback == NULL)
+       if (!pcmd_callback)
                r8712_free_cmd_obj(pcmd);
        else
                pcmd_callback(padapter, pcmd);
@@ -149,7 +149,7 @@ static u8 write_macreg_hdl(struct _adapter *padapter, u8 *pbuf)
 
        /*  invoke cmd->callback function */
        pcmd_callback = cmd_callback[pcmd->cmdcode].callback;
-       if (pcmd_callback == NULL)
+       if (!pcmd_callback)
                r8712_free_cmd_obj(pcmd);
        else
                pcmd_callback(padapter, pcmd);
@@ -165,7 +165,7 @@ static u8 read_bbreg_hdl(struct _adapter *padapter, u8 *pbuf)
        if (pcmd->rsp && pcmd->rspsz > 0)
                memcpy(pcmd->rsp, (u8 *)&val, pcmd->rspsz);
        pcmd_callback = cmd_callback[pcmd->cmdcode].callback;
-       if (pcmd_callback == NULL)
+       if (!pcmd_callback)
                r8712_free_cmd_obj(pcmd);
        else
                pcmd_callback(padapter, pcmd);
@@ -178,7 +178,7 @@ static u8 write_bbreg_hdl(struct _adapter *padapter, u8 *pbuf)
        struct cmd_obj *pcmd  = (struct cmd_obj *)pbuf;
 
        pcmd_callback = cmd_callback[pcmd->cmdcode].callback;
-       if (pcmd_callback == NULL)
+       if (!pcmd_callback)
                r8712_free_cmd_obj(pcmd);
        else
                pcmd_callback(padapter, pcmd);
@@ -194,7 +194,7 @@ static u8 read_rfreg_hdl(struct _adapter *padapter, u8 *pbuf)
        if (pcmd->rsp && pcmd->rspsz > 0)
                memcpy(pcmd->rsp, (u8 *)&val, pcmd->rspsz);
        pcmd_callback = cmd_callback[pcmd->cmdcode].callback;
-       if (pcmd_callback == NULL)
+       if (!pcmd_callback)
                r8712_free_cmd_obj(pcmd);
        else
                pcmd_callback(padapter, pcmd);
@@ -207,7 +207,7 @@ static u8 write_rfreg_hdl(struct _adapter *padapter, u8 *pbuf)
        struct cmd_obj *pcmd  = (struct cmd_obj *)pbuf;
 
        pcmd_callback = cmd_callback[pcmd->cmdcode].callback;
-       if (pcmd_callback == NULL)
+       if (!pcmd_callback)
                r8712_free_cmd_obj(pcmd);
        else
                pcmd_callback(padapter, pcmd);
@@ -227,7 +227,7 @@ static struct cmd_obj *cmd_hdl_filter(struct _adapter *padapter,
 {
        struct cmd_obj *pcmd_r;
 
-       if (pcmd == NULL)
+       if (!pcmd)
                return pcmd;
        pcmd_r = NULL;
 
@@ -416,7 +416,7 @@ _next:
        /* free all cmd_obj resources */
        do {
                pcmd = r8712_dequeue_cmd(&(pcmdpriv->cmd_queue));
-               if (pcmd == NULL)
+               if (!pcmd)
                        break;
                r8712_free_cmd_obj(pcmd);
        } while (1);
@@ -431,7 +431,7 @@ void r8712_event_handle(struct _adapter *padapter, uint *peventbuf)
        void (*event_callback)(struct _adapter *dev, u8 *pbuf);
        struct  evt_priv *pevt_priv = &(padapter->evtpriv);
 
-       if (peventbuf == NULL)
+       if (!peventbuf)
                goto _abort_event_;
        evt_sz = (u16)(le32_to_cpu(*peventbuf) & 0xffff);
        evt_seq = (u8)((le32_to_cpu(*peventbuf) >> 24) & 0x7f);